/*
 * auth.css
 * Login / autenticación
 *
 * Depende de:
 * - theme.css
 *
 * No contiene branding específico del cliente.
 */


/* ==========================================================
   AUTH BODY
   ========================================================== */

body.auth-page {
    min-height: 100vh;

    margin: 0;

    display: grid;
    place-items: center;

    padding: 28px;

    background: var(--background);
}


/*
 * Compatibilidad:
 * si el login actual no utiliza auth-page,
 * aplicamos el fondo al body que contiene login-shell.
 */

body:has(.login-shell) {
    min-height: 100vh;

    margin: 0;

    display: grid;
    place-items: center;

    padding: 28px;

    background: var(--background);
}


/* ==========================================================
   LOGIN SHELL
   ========================================================== */

.login-shell {
    width: min(1280px, 100%);

    min-height: 720px;

    display: grid;

    grid-template-columns: 1.04fr .96fr;

    background: var(--surface);

    border-radius: var(--radius-xl);

    overflow: hidden;

    box-shadow: var(--shadow-xl);
}


/* ==========================================================
   BRAND PANEL
   ========================================================== */

.brand-panel {
    position: relative;

    overflow: hidden;

    padding: 54px 64px 38px;

    background:
        linear-gradient(
            145deg,
            var(--surface) 0%,
            var(--brand-primary-soft-2) 52%,
            var(--brand-primary-soft) 100%
        );
}

.brand-panel::after {
    content: '';

    position: absolute;

    right: -100px;
    bottom: -100px;

    width: 300px;
    height: 300px;

    border-radius: 50%;

    background: rgba(32, 184, 184, .06);
}


/* ==========================================================
   BRAND
   ========================================================== */

.brand {
    position: relative;
    z-index: 2;
}

.brand img {
    width: 300px;
    height: auto;
}


/* ==========================================================
   BRAND COPY
   ========================================================== */

.brand-copy {
    position: relative;
    z-index: 2;

    margin-top: 65px;

    max-width: 510px;
}

.eyebrow {
    font-size: 12px;

    font-weight: 700;

    letter-spacing: 2px;

    color: var(--brand-primary-dark);
}

.brand-copy h1,
.brand-panel h1 {
    font-size: 47px;

    line-height: 1.12;

    letter-spacing: -1.5px;

    margin: 15px 0 18px;

    color: var(--text-primary);

    font-weight: 500;
}

.brand-copy h1 strong,
.brand-panel h1 strong {
    font-weight: 700;
}

.brand-copy p {
    font-size: 17px;

    line-height: 1.7;

    color: var(--text-secondary);

    max-width: 455px;

    margin: 0;
}


/* ==========================================================
   HERO ILLUSTRATION
   ========================================================== */

.hero-illustration {
    display: block;

    width: min(590px, 100%);

    margin: 15px auto 0;

    position: relative;
    z-index: 1;
}


/* ==========================================================
   BENEFITS
   ========================================================== */

.benefits {
    position: relative;
    z-index: 2;

    display: flex;

    gap: 34px;

    margin-top: 4px;
}

.benefit {
    display: flex;
    align-items: center;

    gap: 10px;

    color: var(--text-primary);
}

.benefit-icon {
    width: 35px;
    height: 35px;

    border: 1.5px solid var(--brand-primary);

    border-radius: 50%;

    display: grid;
    place-items: center;

    color: var(--brand-primary-dark);

    font-weight: 700;
}

.benefit b,
.benefit small {
    display: block;
}

.benefit b {
    font-size: 12px;
}

.benefit small {
    font-size: 11px;

    color: var(--text-muted);

    margin-top: 3px;
}


/* ==========================================================
   FORM PANEL
   ========================================================== */

.form-panel {
    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    padding: 42px 48px;

    background: var(--surface);
}


/* ==========================================================
   LOGIN CARD
   ========================================================== */

.login-card {
    width: min(480px, 100%);

    padding: 42px 44px 34px;

    background: var(--surface);

    border: 1px solid var(--border-light);

    border-radius: var(--radius-xl);

    box-shadow: var(--shadow-lg);
}


/* ==========================================================
   MOBILE LOGO
   ========================================================== */

.mobile-logo {
    display: none;

    text-align: center;

    margin-bottom: 20px;
}

.mobile-logo img {
    width: 58px;
}


/* ==========================================================
   LOGIN TITLES
   ========================================================== */

.login-card h2 {
    text-align: center;

    font-size: 27px;

    line-height: 1.2;

    margin: 0;

    color: var(--text-primary);

    letter-spacing: -.5px;
}

.subtitle {
    text-align: center;

    margin: 10px 0 32px;

    color: var(--text-secondary);

    font-size: 14px;
}


/* ==========================================================
   LABEL
   ========================================================== */

.login-card form label:not(.remember) {
    display: block;

    font-size: 13px;

    font-weight: 600;

    margin: 0 0 8px;

    color: var(--text-primary);
}


/* ==========================================================
   INPUT FIELD
   ========================================================== */

.field {
    height: 52px;

    border: 1px solid var(--border);

    border-radius: var(--radius-sm);

    display: flex;

    align-items: center;

    margin-bottom: 20px;

    transition: .2s;

    background: var(--surface);
}

.field:focus-within {
    border-color: var(--brand-primary);

    box-shadow:
        0 0 0 3px var(--focus-ring);
}

.field-icon {
    width: 42px;

    text-align: center;

    color: var(--text-secondary);

    font-size: 18px;
}

.field input {
    border: 0;

    outline: 0;

    width: 100%;

    height: 100%;

    font: inherit;

    font-size: 14px;

    color: var(--text-primary);

    background: transparent;
}

.field input::placeholder {
    color: var(--text-muted);
}


/* ==========================================================
   PASSWORD TOGGLE
   ========================================================== */

.toggle-password {
    border: 0;

    background: none;

    color: var(--text-secondary);

    cursor: pointer;

    padding: 12px;

    font-size: 15px;
}

.toggle-password:hover {
    color: var(--brand-primary-dark);
}


/* ==========================================================
   OPTIONS
   ========================================================== */

.options {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin: -4px 0 22px;

    font-size: 12px;
}

.remember {
    display: flex;

    align-items: center;

    gap: 7px;

    color: var(--text-secondary);
}

.remember input {
    accent-color: var(--brand-primary);

    width: 15px;
    height: 15px;
}


/* ==========================================================
   LINKS
   ========================================================== */

.link {
    color: var(--brand-primary-dark);

    text-decoration: none;

    font-weight: 600;
}

.link:hover {
    color: var(--brand-primary);

    text-decoration: underline;
}


/* ==========================================================
   PRIMARY LOGIN BUTTON
   ========================================================== */

.primary {
    width: 100%;

    height: 54px;

    border: 0;

    border-radius: var(--radius-sm);

    background: var(--brand-gradient);

    color: #fff;

    font: 600 15px Inter, Arial, sans-serif;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(20, 158, 170, .20);

    transition:
        .2s;
}

.primary:hover {
    transform: translateY(-1px);

    box-shadow:
        0 10px 25px rgba(20, 158, 170, .27);
}

.primary span {
    font-size: 18px;

    margin-right: 8px;
}


/* ==========================================================
   SEPARATOR
   ========================================================== */

.separator {
    display: flex;

    align-items: center;

    gap: 12px;

    color: var(--text-muted);

    font-size: 12px;

    margin: 26px 0;
}

.separator::before,
.separator::after {
    content: '';

    height: 1px;

    background: var(--border-light);

    flex: 1;
}


/* ==========================================================
   HELP BUTTON
   ========================================================== */

.help-button {
    height: 48px;

    border: 1px solid var(--border);

    border-radius: var(--radius-sm);

    display: grid;

    place-items: center;

    color: var(--text-secondary);

    background: var(--surface);

    text-decoration: none;

    font-size: 13px;

    font-weight: 600;

    transition:
        border-color .15s ease,
        color .15s ease,
        background-color .15s ease;
}

.help-button span {
    margin-right: 7px;
}

.help-button:hover {
    color: var(--brand-primary-dark);

    border-color: var(--brand-primary);

    background: var(--brand-primary-soft);

    text-decoration: none;
}


/* ==========================================================
   REGISTER
   ========================================================== */

.register {
    text-align: center;

    color: var(--text-secondary);

    font-size: 12px;

    margin: 24px 0 0;
}


/* ==========================================================
   MESSAGE
   ========================================================== */

.login-card .message {
    min-height: 18px;

    text-align: center;

    font-size: 12px;

    color: var(--danger);

    margin-top: 10px;
}


/* ==========================================================
   FOOTER
   ========================================================== */

.login-card footer,
.form-panel footer {
    font-size: 11px;

    color: var(--text-muted);

    margin-top: 26px;

    text-align: center;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 900px) {

    body:has(.login-shell) {
        padding: 0;
    }

    .login-shell {
        min-height: 100vh;

        border-radius: 0;

        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        padding: 28px 20px;
    }

    .login-card {
        box-shadow: none;

        border: 0;

        padding: 22px 4px;

        width: min(440px, 100%);
    }

    .mobile-logo {
        display: block;
    }

}


@media (max-width: 480px) {

    .form-panel {
        padding: 20px 16px;
    }

    .login-card {
        padding: 18px 0;
    }

    .login-card h2 {
        font-size: 24px;
    }

    .subtitle {
        margin-bottom: 27px;
    }

    .options {
        font-size: 11px;
    }

    .primary {
        height: 52px;
    }

    .help-button {
        height: 46px;
    }

}