/* ═════════════════════════════════════════════════════════════════════════════
   New Motors — Trabajá con nosotros
   Estilo inspirado en Flexxi: flat dark, columna única, label-izquierda
   Ruta: /template-parts/join-us/style.css
   ═════════════════════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────────────────────── */
.nm-trabaja {
    --nm-red:           #cc2200;
    --nm-bg:            #0c0c0c;
    --nm-border:        rgba(255, 255, 255, 0.09);
    --nm-text:          #ffffff;
    --nm-text-dim:      rgba(255, 255, 255, 0.5);
    --nm-label-color:   rgba(255, 255, 255, 0.82);
    --nm-input-bg:      rgba(255, 255, 255, 0.05);
    --nm-input-border:  rgba(255, 255, 255, 0.11);
    --nm-input-focus:   rgba(255, 255, 255, 0.32);
    --nm-radius:        8px;
    --nm-ease:          0.18s ease;
    --nm-font:          "Nunito Sans", sans-serif;
    --nm-label-width:   210px;
}

/* ── Sección base ───────────────────────────────────────────────────────────── */
.nm-trabaja {
    position: relative;
    background-color: var(--nm-bg);
    padding: 120px 60px 110px;
    overflow: hidden;
    color: var(--nm-text);
    font-family: var(--nm-font);
    box-sizing: border-box;
    scroll-margin-top: 100px;
}

/* Textura de puntos muy sutil — único elemento decorativo */
.nm-trabaja::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

/* Glow orbes — ocultos en estilo Flexxi */
.nm-trabaja__glow { display: none; }

/* ── Contenedor ─────────────────────────────────────────────────────────────── */
.nm-trabaja__inner {
    position: relative;
    max-width: 780px;
    margin: 0 auto;
    z-index: 1;
}

/* ── Encabezado — left-aligned ──────────────────────────────────────────────── */
.nm-trabaja__header {
    text-align: left;
    margin-bottom: 52px;
}

.nm-trabaja__title {
    font-size: clamp(3.2rem, 6vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    color: #fff;
    text-transform: none;       /* Flexxi no usa uppercase */
    margin: 0 0 20px;
}

/* En Flexxi el acento cromático es mínimo — dejamos el <em> blanco */
.nm-trabaja__title em {
    font-style: normal;
    color: #fff;
    display: inline;
}

.nm-trabaja__subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--nm-text-dim);
    line-height: 1.72;
    margin: 0;
    max-width: 520px;
}

/* ── Tarjeta del form — sin card (flat) ─────────────────────────────────────── */
.nm-trabaja__form {
    background:       transparent;
    border:           none;
    border-radius:    0;
    padding:          0;
    backdrop-filter:  none;
    -webkit-backdrop-filter: none;
    box-shadow:       none;
}

/* ── Fila de campo ──────────────────────────────────────────────────────────── */
.nm-field {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    padding: 18px 0;
    border-bottom: 1px solid var(--nm-border);
    margin-bottom: 0;
}

/* Primera fila también tiene borde arriba */
.nm-trabaja__form .nm-field:first-of-type {
    border-top: 1px solid var(--nm-border);
}

/* Variante apilada — mensaje y CV */
.nm-field--stack {
    flex-direction: column;
    gap: 12px;
    padding: 22px 0;
    align-items: stretch;
}

.nm-field--stack .nm-field__label {
    padding-top: 0;
    max-width: none;
    flex: none;
}

/* ── Columna label ──────────────────────────────────────────────────────────── */
.nm-field__label {
    flex: 0 0 var(--nm-label-width);
    max-width: var(--nm-label-width);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--nm-label-color);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.45;
    margin: 0;
    padding-top: 10px;        /* Alinea vertically con el input */
}

.nm-required {
    color: var(--nm-red);
    font-weight: 600;
}

.nm-field__hint {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.28);
    margin-top: 3px;
    letter-spacing: 0;
}

/* ── Columna control (input + error) ────────────────────────────────────────── */
.nm-field__control {
    flex: 1;
    min-width: 0;
}

/* ── Inputs ─────────────────────────────────────────────────────────────────── */
.nm-field__input {
    width: 100%;
    background: var(--nm-input-bg);
    border: 1px solid var(--nm-input-border);
    border-radius: var(--nm-radius);
    padding: 10px 14px;
    color: var(--nm-text);
    font-family: var(--nm-font);
    font-size: 0.93rem;
    font-weight: 400;
    outline: none;
    transition:
        border-color var(--nm-ease),
        background   var(--nm-ease);
    box-sizing: border-box;
    -webkit-appearance: none;
}

.nm-field__input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.nm-field__input:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.nm-field__input:focus {
    border-color: var(--nm-input-focus);
    background: rgba(255, 255, 255, 0.07);
}

.nm-field__input.nm-invalid {
    border-color: rgba(204, 34, 0, 0.65);
}

.nm-field__textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.65;
}

/* ── Mensajes de error ──────────────────────────────────────────────────────── */
.nm-field__error {
    display: block;
    font-size: 0.74rem;
    color: #ff6b4a;
    margin-top: 6px;
    min-height: 1em;
}

/* ── Contador de chars ──────────────────────────────────────────────────────── */
.nm-field__charcount {
    display: block;
    font-size: 0.70rem;
    color: rgba(255, 255, 255, 0.25);
    text-align: right;
    margin-top: 6px;
}

/* ── Toggle buttons (Sí/No, Full/Part) ──────────────────────────────────────── */
.nm-toggle-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nm-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 22px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--nm-radius);
    font-family: var(--nm-font);
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all var(--nm-ease);
    user-select: none;
    background: transparent;
    letter-spacing: 0;
}

.nm-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.nm-toggle:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
}

/* Activo: blanco sólido (estilo Flexxi) */
.nm-toggle--active,
.nm-toggle:has(input:checked) {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    font-weight: 600;
}

/* ── Drop zone CV ───────────────────────────────────────────────────────────── */
.nm-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px 24px;
    border: 1.5px dashed rgba(255, 255, 255, 0.18);
    border-radius: var(--nm-radius);
    cursor: pointer;
    transition: all var(--nm-ease);
    background: transparent;
    text-align: center;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.3);
}

.nm-dropzone:hover,
.nm-dropzone.nm-dropzone--hover {
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.55);
}

.nm-dropzone__text {
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
    transition: color var(--nm-ease);
}

.nm-dropzone:hover .nm-dropzone__text {
    color: rgba(255, 255, 255, 0.7);
}

.nm-dropzone__filename {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nm-dropzone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.nm-dropzone.nm-dropzone--ready {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

/* ── Footer / Botón submit ──────────────────────────────────────────────────── */
.nm-trabaja__footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 44px;
    padding-top: 0;
    border-top: none;
}

/* Botón estilo Flexxi: blanco + pill + flecha */
.nm-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 100px;
    font-family: var(--nm-font);
    font-size: 0.97rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: all var(--nm-ease);
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.nm-btn:hover {
    background: rgba(255, 255, 255, 0.88);
    gap: 14px;
}

.nm-btn:active {
    transform: scale(0.98);
}

.nm-btn__arrow {
    transition: transform var(--nm-ease);
    flex-shrink: 0;
}

.nm-btn:hover .nm-btn__arrow {
    transform: translateX(3px);
}

/* ── Alerta de error servidor ───────────────────────────────────────────────── */
.nm-trabaja__alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(204, 34, 0, 0.07);
    border: 1px solid rgba(204, 34, 0, 0.25);
    border-radius: var(--nm-radius);
    padding: 16px 20px;
    color: #ff6b4a;
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 32px;
}
.nm-trabaja__alert svg { flex-shrink: 0; margin-top: 1px; }

/* ── Estado de éxito ────────────────────────────────────────────────────────── */
.nm-trabaja__success {
    text-align: left;
    padding: 64px 0;
    animation: nm-fade-in 0.5s ease forwards;
}

@keyframes nm-fade-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nm-trabaja__success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 200, 100, 0.07);
    border: 1.5px solid rgba(0, 200, 100, 0.3);
    color: #00c864;
    margin-bottom: 24px;
}

.nm-trabaja__success h3 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 14px;
    text-transform: none;
    letter-spacing: -0.5px;
}

.nm-trabaja__success p {
    color: var(--nm-text-dim);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 10px;
}

.nm-trabaja__success-email {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.28);
}

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.nm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.nm-modal[hidden] { display: none; }

.nm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.nm-modal__card {
    position: relative;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    padding: 44px 40px 38px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    animation: nm-modal-in 0.25s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
    box-sizing: border-box;
}

@keyframes nm-modal-in {
    from { transform: scale(0.92) translateY(10px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.nm-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 18px;
}

.nm-modal__title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    text-transform: none;
    letter-spacing: -0.5px;
}

.nm-modal__body {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.65;
    margin: 0 0 8px;
}
.nm-modal__body strong { color: #fff; }

.nm-modal__note {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.28);
    margin: 0 0 30px;
}
.nm-modal__note em {
    font-style: normal;
    color: rgba(255, 255, 255, 0.42);
}

.nm-modal__actions {
    display: flex;
    gap: 10px;
}

.nm-modal__cancel {
    flex: 1;
    padding: 11px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    color: rgba(255, 255, 255, 0.45);
    font-family: var(--nm-font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--nm-ease);
}
.nm-modal__cancel:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Botón confirmar también en blanco (consistente con nm-btn) */
.nm-modal__confirm {
    flex: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    background: #ffffff;
    border: none;
    border-radius: 100px;
    color: #000000;
    font-family: var(--nm-font);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: all var(--nm-ease);
    box-shadow: none;
}
.nm-modal__confirm:hover   { background: rgba(255, 255, 255, 0.88); }
.nm-modal__confirm:disabled { opacity: 0.5; cursor: not-allowed; }

.nm-modal__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: nm-spin 0.6s linear infinite;
}
@keyframes nm-spin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .nm-trabaja { padding: 90px 40px 90px; }
    --nm-label-width: 180px;
}

@media (max-width: 768px) {
    .nm-trabaja { padding: 120px 24px 80px; }

    .nm-trabaja__title { letter-spacing: -1.5px; }

    /* En mobile, cada campo se apila: label arriba, input abajo */
    .nm-field {
        flex-direction: column;
        gap: 8px;
        padding: 16px 0;
    }

    .nm-field__label {
        flex: none;
        max-width: none;
        padding-top: 0;
        font-size: 0.82rem;
        color: rgba(255, 255, 255, 0.65);
    }

    .nm-modal__card    { padding: 32px 22px 28px; }
    .nm-modal__actions { flex-direction: column; }
    .nm-modal__confirm,
    .nm-modal__cancel  { flex: none; width: 100%; }
}

@media (max-width: 480px) {
    .nm-trabaja { padding: 110px 18px 64px; }
    .nm-trabaja__header { margin-bottom: 36px; }
    
    .nm-trabaja__title { font-size: 2.6rem; }

    .nm-toggle { padding: 8px 16px; font-size: 0.82rem; }

    .nm-btn { width: 100%; justify-content: center; }
    .nm-trabaja__footer { justify-content: stretch; }
}