/* ============================================================
   DITE LOGIN / AUTH — login.css
   Usa exclusivamente los tokens de styles.css.
   Sin colores hardcodeados. Sin override del reset global.
   ============================================================ */

/* ════════════════════════════════════════════
   TOKENS EXTRA PARA AUTH
   ════════════════════════════════════════════ */

:root,
[data-theme="light"] {
    --auth-brand-bg-from: #001257;
    --auth-brand-bg-to: #0047ff;
    --auth-brand-text: #ffffff;
    --auth-brand-tag: rgba(255, 255, 255, .55);
    --auth-brand-mascot-bg: rgba(255, 255, 255, .08);

    --auth-card-bg: #ffffff;
    --auth-card-border: rgba(0, 0, 0, .06);
    --auth-card-shadow: 0 12px 48px rgba(0, 0, 0, .10);

    --auth-input-bg: var(--surface-container-low);
    --auth-input-border: var(--outline-variant);
    --auth-input-focus: var(--primary);

    --auth-tab-track: var(--surface-container-low);
    --auth-tab-active-bg: #ffffff;
    --auth-tab-active-text: var(--primary);
    --auth-tab-inactive: var(--on-surface-variant);

    --auth-info-bg: #eff6ff;
    --auth-info-border: #bfdbfe;
    --auth-info-text: #1e40af;
    --auth-info-accent: #2563eb;

    --auth-pass-track: var(--surface-container-high);
    --auth-nav-h: var(--nav-h, 5rem);
}

[data-theme="dark"] {
    --auth-brand-bg-from: #06080f;
    --auth-brand-bg-to: #0d1225;
    --auth-brand-text: #ffffff;
    --auth-brand-tag: rgba(255, 255, 255, .45);
    --auth-brand-mascot-bg: rgba(0, 71, 255, .12);

    --auth-card-bg: rgba(255, 255, 255, .04);
    --auth-card-border: rgba(255, 255, 255, .08);
    --auth-card-shadow: 0 24px 64px rgba(0, 0, 0, .55);

    --auth-input-bg: var(--surface-container);
    --auth-input-border: var(--outline-variant);
    --auth-input-focus: var(--primary);

    --auth-tab-track: rgba(255, 255, 255, .06);
    --auth-tab-active-bg: var(--primary);
    --auth-tab-active-text: #ffffff;
    --auth-tab-inactive: rgba(255, 255, 255, .5);

    --auth-info-bg: rgba(0, 71, 255, .07);
    --auth-info-border: rgba(0, 71, 255, .18);
    --auth-info-text: rgba(196, 197, 218, .85);
    --auth-info-accent: #4d7fff;

    --auth-pass-track: var(--surface-container-high);
}

/* ════════════════════════════════════════════
   BODY OVERRIDE — solo para auth
   (sin overflow:hidden global que rompe móvil)
   ════════════════════════════════════════════ */

.auth-body {
    overflow-x: hidden;
}

/* ════════════════════════════════════════════
   LAYOUT PRINCIPAL (split 50/50)
   ════════════════════════════════════════════ */

.auth {
    display: flex;
    min-height: 100vh;
}

/* ════════════════════════════════════════════
   LADO IZQUIERDO — BRANDING
   ════════════════════════════════════════════ */

.auth__brand {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 4rem 8%;
    background: linear-gradient(160deg, var(--auth-brand-bg-from) 0%, var(--auth-brand-bg-to) 100%);
    position: relative;
    overflow: hidden;
}

/* Glow decorativo en dark */
[data-theme="dark"] .auth__brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 25% 30%, rgba(0, 71, 255, .18), transparent 55%);
    pointer-events: none;
}

/* Oculta en tablet/mobile */
@media (max-width: 900px) {
    .auth__brand {
        display: none;
    }
}

.auth__brand-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    color: var(--auth-brand-text);
    position: relative;
    z-index: 1;

}

/* Logo de la columna izquierda */
.auth__brand-logo {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: 1.375rem;
    letter-spacing: -.03em;
    color: var(--auth-brand-text);
    text-decoration: none;
    margin-bottom: 2.5rem;
}

.auth__brand-logo span {
    color: rgba(185, 195, 255, .85);
}

/* Título hero */
.auth__brand-title {
    font-family: var(--font-headline);
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--auth-brand-text);
    max-width: 30rem;
    margin-bottom: 3.5rem;
}

/* Mascota */
.auth__brand-mascot {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 12rem;
}

.auth__brand-mascot img {
    max-width: 20rem;
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 48px rgba(0, 0, 0, .35));
    animation: auth-float 7s ease-in-out infinite;
}



@keyframes auth-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-16px);
    }
}

/* Tag inferior */
.auth__brand-tag {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .18em;
    color: var(--auth-brand-tag);
    text-transform: uppercase;
    margin-top: auto;
}

/* ════════════════════════════════════════════
   LADO DERECHO — PANEL DEL FORMULARIO
   ════════════════════════════════════════════ */

.auth__panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    background: var(--background);
    /* En mobile ocupa toda la pantalla */
}

@media (max-width: 900px) {
    .auth__panel {
        flex: 1;
        width: 100%;
        min-height: 100vh;
        align-items: flex-start;
        padding: 1.5rem 1.25rem 2rem;
    }
}

/* Radios ocultos — control de tabs sin JS */
.auth__radio {
    display: none;
}

/* ════════════════════════════════════════════
   CARD
   ════════════════════════════════════════════ */

.auth__card {
    position: relative;
    width: 100%;
    max-width: 35rem;
    padding: 1rem;
    border-radius: 1.5rem;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background .3s, border-color .3s, box-shadow .3s;
}

[data-theme="light"] .auth__card {
    backdrop-filter: none;
}

@media (max-width: 900px) {
    .auth__card {
        max-width: 100%;
    }
}

/* ── Acciones de card (theme toggle + home) ── */
.auth__card-actions {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    gap: .5rem;
    z-index: 10;
}

/* El .theme-toggle base viene de styles.css.
   Solo ajustamos el look dentro de la card oscura. */
[data-theme="dark"] .auth__card-toggle,
[data-theme="dark"] .auth__card-home {
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .85);
}

[data-theme="dark"] .auth__card-toggle:hover,
[data-theme="dark"] .auth__card-home:hover {
    background: rgba(255, 255, 255, .18);
    color: #ffffff;
}

/* El enlace home hereda .theme-toggle pero necesita display:flex */
.auth__card-home {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* ── Header móvil ── */
.auth__mobile-header {
    display: none;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    margin-bottom: 1.75rem;
}

@media (max-width: 900px) {
    .auth__mobile-header {
        display: flex;
    }
}

.auth__mobile-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-xl);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.auth__mobile-logo-text {
    font-family: var(--font-headline);
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -.04em;
    color: var(--primary);
}

/* ── Títulos ── */
.auth__card-title {
    font-family: var(--font-headline);
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--on-surface);
    margin-bottom: .375rem;
    padding-right: 5.5rem;
    /* espacio para los botones de acción */
}

.auth__card-sub {
    font-size: .9rem;
    color: var(--on-surface-variant);
    margin-bottom: 0;
}

/* ════════════════════════════════════════════
   TABS (CSS-only con radio inputs)
   ════════════════════════════════════════════ */

.auth__tabs {
    display: flex;
    gap: .25rem;
    background: var(--auth-tab-track);
    border-radius: var(--radius-lg);
    padding: .375rem;
    margin: 1.5rem 0 0;
}

.auth__tab {
    flex: 1;
    padding: .5rem .75rem;
    border-radius: var(--radius-md);
    font-size: .8125rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    color: var(--auth-tab-inactive);
    transition: background .2s, color .2s, box-shadow .2s;
    user-select: none;
}

/* Tab activa — login */
#tab-login:checked~.auth__card .auth__tab[for="tab-login"],
#tab-register:checked~.auth__card .auth__tab[for="tab-register"] {
    background: var(--auth-tab-active-bg);
    color: var(--auth-tab-active-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

/* ════════════════════════════════════════════
   FORMS — visibilidad
   ════════════════════════════════════════════ */

.auth-form {
    display: none;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    animation: auth-fadein .25s ease;
}

@keyframes auth-fadein {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#tab-login:checked~.auth__card .auth-form--login {
    display: flex;
}

#tab-register:checked~.auth__card .auth-form--register {
    display: flex;
}

/* Footer de la card (switch hint) */
.auth__switch-hint {
    font-size: .8125rem;
    text-align: center;
    color: var(--on-surface-variant);
    margin-top: .25rem;
}

.auth__switch-link {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s;
}

.auth__switch-link:hover {
    opacity: .8;
}

/* ════════════════════════════════════════════
   FORM FIELDS
   ════════════════════════════════════════════ */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: .875rem;
    }
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: .4375rem;
}

.form-field__label {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--on-surface-variant);
}

.form-field__input {
    width: 100%;
    padding: .75rem 1rem;
    border-radius: .625rem;
    border: 1px solid var(--auth-input-border);
    background: var(--auth-input-bg);
    color: var(--on-surface);
    font-family: var(--font-body);
    font-size: .9375rem;
    font-weight: 500;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-field__input::placeholder {
    color: var(--on-surface-variant);
    opacity: .45;
}

.form-field__input:focus {
    border-color: var(--auth-input-focus);
    box-shadow: 0 0 0 3px rgba(0, 71, 255, .18);
}

/* Input con icono (password) */
.form-field__icon-wrap {
    position: relative;
}

.form-field__icon-wrap .form-field__input {
    padding-right: 3rem;
}

.form-field__icon-btn {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--on-surface-variant);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    opacity: .6;
    transition: opacity .2s;
    padding: 0;
}

.form-field__icon-btn:hover {
    opacity: 1;
    color: var(--primary);
}

/* Input con sufijo (subdominio) */
.form-field__suffix-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--auth-input-border);
    border-radius: .625rem;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.form-field__suffix-wrap:focus-within {
    border-color: var(--auth-input-focus);
    box-shadow: 0 0 0 3px rgba(0, 71, 255, .18);
}

.form-field__input--suffix {
    border: none;
    border-radius: 0;
    box-shadow: none !important;
}

.form-field__input--suffix:focus {
    border: none;
    box-shadow: none !important;
}

.form-field__suffix {
    padding: .75rem 1rem;
    background: var(--surface-container);
    color: var(--primary);
    font-weight: 700;
    font-size: .875rem;
    white-space: nowrap;
    flex-shrink: 0;
    border-left: 1px solid var(--auth-input-border);
}

[data-theme="dark"] .form-field__suffix {
    background: var(--surface-container-high);
}

/* Hint messages */
.form-field__hint {
    display: flex;
    align-items: center;
    gap: .3125rem;
    font-size: .75rem;
    font-weight: 600;
}

.form-field__hint--ok {
    color: #16a34a;
}

[data-theme="dark"] .form-field__hint--ok {
    color: #34d399;
}

.form-field__hint .material-symbols-outlined {
    font-size: 1rem;
}

/* ── Forgot password ── */
.auth-form__forgot {
    display: flex;
    justify-content: flex-end;
    margin-top: -.5rem;
}

.auth-form__forgot-link {
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary);
    opacity: .8;
    transition: opacity .2s;
}

.auth-form__forgot-link:hover {
    opacity: 1;
}

/* ── Submit button ── */
.auth-form__submit {
    margin-top: .375rem;
}

/* ── Legal text ── */
.auth-form__legal {
    font-size: .75rem;
    text-align: center;
    color: var(--on-surface-variant);
    line-height: 1.6;
    opacity: .75;
}

.auth-form__legal-link {
    color: var(--primary);
    font-weight: 600;
}

/* ════════════════════════════════════════════
   PASSWORD STRENGTH METER
   ════════════════════════════════════════════ */

.pass-strength {
    display: none;
    /* shown via JS when user types */
    flex-direction: column;
    gap: .3125rem;
    margin-top: .25rem;
}

.pass-strength.is-visible {
    display: flex;
}

.pass-strength__bar {
    height: 4px;
    border-radius: 2px;
    background: var(--auth-pass-track);
    overflow: hidden;
}

.pass-strength__fill {
    display: block;
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width .4s ease, background .4s ease;
}

.pass-strength__fill[data-level="1"] {
    width: 25%;
    background: #ef4444;
}

.pass-strength__fill[data-level="2"] {
    width: 50%;
    background: #f97316;
}

.pass-strength__fill[data-level="3"] {
    width: 75%;
    background: #eab308;
}

.pass-strength__fill[data-level="4"] {
    width: 100%;
    background: #22c55e;
}

.pass-strength__label {
    font-size: .6875rem;
    font-weight: 700;
    color: var(--on-surface-variant);
}

/* ════════════════════════════════════════════
   INFO BOX (nota demo)
   ════════════════════════════════════════════ */

.auth-info {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .875rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--auth-info-bg);
    border: 1px solid var(--auth-info-border);
    font-size: .8125rem;
    line-height: 1.55;
    color: var(--auth-info-text);
}

.auth-info__icon {
    font-size: 1.25rem;
    color: var(--auth-info-accent);
    flex-shrink: 0;
    margin-top: .0625rem;
    display: inline-block;
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    line-height: 1;
    vertical-align: middle;
}

.auth-info__title {
    display: block;
    font-size: .6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--auth-info-accent);
    margin-bottom: .25rem;
}

.auth-info__body b {
    color: var(--auth-info-accent);
    font-weight: 600;
}

/* ════════════════════════════════════════════
   RESPONSIVE AJUSTES FINOS
   ════════════════════════════════════════════ */

/* Tablet (1025 → 901): ambos lados pero más compactos */
@media (max-width: 1024px) and (min-width: 901px) {
    .auth__brand {
        padding: 6% 5%;
    }

    .auth__brand-title {
        font-size: 2.25rem;
    }

    .auth__brand-mascot-placeholder {
        width: 8rem;
        height: 8rem;
        font-size: 3rem;
    }
}

/* Mobile: form a pantalla completa, sin branding */
@media (max-width: 640px) {
    .auth__card {
        border-radius: 1rem;
        padding: 1.5rem 1.25rem;
    }

    .auth__card-title {
        font-size: 1.375rem;
    }

    .auth__tabs {
        margin-top: 1.25rem;
    }

    .auth-form {
        gap: .875rem;
    }

    /* .form-row stacking ya se maneja en el breakpoint de 768px */

    .form-field__input {
        padding: .6875rem .875rem;
        font-size: .875rem;
    }
}

@media (max-width: 400px) {
    .auth__panel {
        padding: 1.5rem 1rem 2.5rem;
    }

    .auth__card {
        padding: 1.25rem 1rem;
    }

    .form-field__suffix-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .form-field__suffix {
        border-left: none;
        border-top: 1px solid var(--auth-input-border);
        text-align: right;
        padding: .5rem .75rem;
        font-size: .75rem;
    }
}