/* ============================================================
   TimsConecta — Login «Apertura»
   Formulario en papel a la izquierda · escenario espresso con
   vasos reales y vapor a la derecha. Solo lo usa login_access;
   recuperar/restablecer contraseña siguen en login-access.css.
   ============================================================ */
@import url('fonts.css');

:root {
    --paper: #FFFDFA;
    --ink: #241711;
    --ink-soft: rgba(36, 23, 17, 0.55);
    --ink-faint: rgba(36, 23, 17, 0.38);
    --hairline: rgba(36, 23, 17, 0.14);
    --hairline-soft: rgba(36, 23, 17, 0.08);
    --tim-red: #C8102E;
    --tim-red-deep: #A00D26;
    --crema: #F6ECDD;
    --noche: #170D08;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    color-scheme: light;
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Sofia Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.split {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    min-height: 100svh;
}

/* ── Formulario (izquierda, papel) ── */
.panel {
    display: flex;
    flex-direction: column;
    padding: 36px 48px 28px;
    background: var(--paper);
}

.panel-top {
    width: min(392px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--hairline-soft);
    animation: rise 0.7s var(--ease-out) both;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: var(--ink);
}

.brand img {
    height: 28px;
    width: auto;
    display: block;
}

.brand span {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    transform: translateY(1px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ink-soft);
    text-decoration: none;
}

.back-link svg {
    width: 14px;
    height: 14px;
}

.back-link:hover { color: var(--ink); }

.panel-form {
    width: min(392px, 100%);
    margin: auto;
    padding: 32px 0;
}

.form-title {
    margin: 0 0 8px;
    font-size: 33px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    animation: rise 0.7s var(--ease-out) 0.08s both;
}

.form-sub {
    margin: 0 0 34px;
    font-size: 15px;
    color: var(--ink-soft);
    animation: rise 0.7s var(--ease-out) 0.16s both;
}

/* Mensajes de estado (expirada, error, éxito, info) */
.auth-feedback {
    margin: 0 0 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 10px 13px;
    font-size: 13px;
    line-height: 1.5;
    animation: rise 0.7s var(--ease-out) 0.2s both;
}

.auth-feedback-error {
    background: rgba(200, 16, 46, 0.06);
    border-color: rgba(200, 16, 46, 0.25);
    color: #8C0B20;
}

.auth-feedback-success {
    background: rgba(22, 163, 74, 0.07);
    border-color: rgba(22, 163, 74, 0.28);
    color: #14622F;
}

.auth-feedback-info {
    background: rgba(36, 23, 17, 0.04);
    border-color: var(--hairline);
    color: var(--ink);
}

.auth-feedback-warning {
    background: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.3);
    color: #92400E;
}

/* Campos de subrayado con icono */
.u-field {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 2px;
    border-bottom: 1px solid var(--hairline);
    transition: border-color 0.2s ease;
    animation: rise 0.7s var(--ease-out) 0.24s both;
}

.u-field + .u-field { animation-delay: 0.3s; }

.u-field:focus-within { border-bottom-color: var(--tim-red); }

.u-field > svg {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--ink-faint);
    transition: color 0.2s ease;
}

.u-field:focus-within > svg { color: var(--tim-red); }

.u-field input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
}

.u-field input:focus { outline: none; }

.u-field input::placeholder { color: var(--ink-faint); }

.toggle-visibility {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: -6px -6px -6px 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.toggle-visibility:hover {
    color: var(--ink);
    background: var(--hairline-soft);
}

.toggle-visibility svg {
    width: 17px;
    height: 17px;
    display: block;
}

.turnstile-wrap {
    margin-top: 20px;
    animation: rise 0.7s var(--ease-out) 0.34s both;
}

.credentials-btn {
    display: block;
    width: 100%;
    margin-top: 36px;
    padding: 16px;
    border: none;
    border-radius: 9px;
    background: var(--tim-red);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s var(--ease-out);
    animation: rise 0.7s var(--ease-out) 0.38s both;
}

.credentials-btn:hover { background: var(--tim-red-deep); }

.credentials-btn:active { transform: scale(0.99); }

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 26px 0;
    font-size: 13px;
    color: var(--ink-faint);
    animation: rise 0.7s var(--ease-out) 0.32s both;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--hairline-soft);
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--hairline);
    border-radius: 9px;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    animation: rise 0.7s var(--ease-out) 0.24s both;
}

.google-btn:hover {
    background: #F7F2EA;
    border-color: rgba(36, 23, 17, 0.24);
}

.google-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.google-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--ink-faint);
    text-align: center;
    animation: rise 0.7s var(--ease-out) 0.28s both;
}

/* En el login el formulario va después de Google: entra al final */
.divider ~ .credentials-form .u-field { animation-delay: 0.36s; }
.divider ~ .credentials-form .u-field + .u-field { animation-delay: 0.42s; }
.divider ~ .credentials-form .turnstile-wrap { animation-delay: 0.46s; }
.divider ~ .credentials-form .credentials-btn { animation-delay: 0.5s; }

.panel-bottom {
    width: min(392px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    animation: rise 0.7s var(--ease-out) 0.6s both;
}

.recover {
    margin: 0;
    font-size: 13.5px;
    color: var(--ink-soft);
}

.recover a {
    color: var(--tim-red);
    font-weight: 700;
    text-decoration: none;
}

.recover a:hover { text-decoration: underline; }

.legal {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.brand:focus-visible,
.back-link:focus-visible,
.credentials-btn:focus-visible,
.google-btn:focus-visible,
.toggle-visibility:focus-visible,
.recover a:focus-visible {
    outline: 2px solid var(--tim-red);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Variante de una sola columna (recuperar, restablecer, 2FA) ── */
.panel.solo { min-height: 100svh; }

.field-note {
    margin: 14px 0 8px;
    font-size: 13px;
    color: var(--ink-soft);
    animation: rise 0.7s var(--ease-out) 0.3s both;
}

.password-requirements {
    margin-top: 18px;
    padding: 12px 16px;
    border: 1px solid var(--hairline-soft);
    border-radius: 9px;
    font-size: 12.5px;
    color: var(--ink-soft);
    animation: rise 0.7s var(--ease-out) 0.34s both;
}

.password-requirements p {
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink);
}

.password-requirements ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 2px;
}

.qr-wrapper {
    display: flex;
    justify-content: center;
    margin: 0 0 14px;
    padding: 18px;
    border: 1px solid var(--hairline-soft);
    border-radius: 12px;
    background: #FFFFFF;
    animation: rise 0.7s var(--ease-out) 0.24s both;
}

.qr-wrapper img {
    width: 200px;
    height: 200px;
    display: block;
}

.manual-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    padding: 10px 13px;
    border: 1px solid var(--hairline);
    border-radius: 9px;
    background: rgba(36, 23, 17, 0.03);
    animation: rise 0.7s var(--ease-out) 0.3s both;
}

.otp-input {
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
}

/* ── Escenario (derecha, amanecer de café) ── */
.stage {
    position: relative;
    overflow: hidden;
    background:
        repeating-linear-gradient(90deg, rgba(255, 240, 220, 0.045) 0 2px, transparent 2px 9px),
        repeating-linear-gradient(90deg, rgba(255, 240, 220, 0.03) 0 1px, transparent 1px 5px),
        radial-gradient(56% 60% at 82% 78%, rgba(255, 179, 107, 0.42), transparent 70%),
        radial-gradient(70% 80% at 18% 20%, rgba(200, 16, 46, 0.5), transparent 68%),
        radial-gradient(60% 70% at 88% 12%, rgba(122, 27, 59, 0.55), transparent 70%),
        radial-gradient(50% 55% at 55% 55%, rgba(224, 102, 43, 0.3), transparent 72%),
        linear-gradient(168deg, #2A100E 0%, var(--noche) 52%, #0E0805 100%);
}

.stage::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 15%;
    background: linear-gradient(to bottom, transparent, rgba(10, 5, 3, 0.75) 55%);
    pointer-events: none;
}

.welcome-wrap {
    position: absolute;
    left: clamp(32px, 5vw, 64px);
    right: clamp(32px, 5vw, 64px);
    bottom: 38%;
    z-index: 2;
}

.welcome {
    margin: 0;
    font-size: clamp(58px, 7.4vw, 106px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 0.96;
    color: #FFF6EA;
    text-wrap: balance;
    animation: rise 1s var(--ease-out) 0.45s both;
}

.welcome .dot { color: var(--tim-red); }

.welcome-sub {
    margin: 22px 0 0;
    max-width: 36ch;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(246, 236, 221, 0.66);
    animation: rise 1s var(--ease-out) 0.6s both;
}

/* Vasos reales al pie del panel, con resplandor y vapor */
.cup-scene {
    position: absolute;
    right: clamp(20px, 3vw, 56px);
    bottom: 0;
    z-index: 1;
    width: clamp(340px, 42vw, 500px);
    aspect-ratio: 593 / 339;
    animation: rise 1.1s var(--ease-out) 0.55s both;
}

.cup-scene .glow {
    position: absolute;
    left: 50%;
    bottom: -30px;
    width: 135%;
    height: 160%;
    transform: translateX(-50%);
    background: radial-gradient(50% 55% at 50% 68%, rgba(255, 179, 107, 0.3), transparent 70%);
    animation: glow 5.5s ease-in-out infinite;
}

.cups-art {
    position: absolute;
    inset: auto 0 0;
    width: 100%;
    display: block;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

/* Vapor en tres capas: hilos (sw), bocanadas (sp) y neblina (sh) */
.steam-group {
    position: absolute;
    width: 92px;
    height: 170px;
    pointer-events: none;
}

.steam-left { left: 13%; bottom: 76%; }
.steam-right { left: 51%; bottom: 92%; }

.steam-group i {
    position: absolute;
    bottom: 0;
    display: block;
    opacity: 0;
}

.sw {
    width: 6px;
    border-radius: 6px;
    background: linear-gradient(to top, rgba(246, 236, 221, 0) 0%, rgba(246, 236, 221, 0.85) 35%, rgba(246, 236, 221, 0) 100%);
    filter: blur(2px);
    animation: steam-wisp 4.6s ease-in-out infinite;
}

.sp {
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(246, 236, 221, 0.75), transparent 72%);
    filter: blur(8px);
    animation: steam-puff 5.8s ease-in-out infinite;
}

.sh {
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(246, 236, 221, 0.5), transparent 75%);
    filter: blur(16px);
    animation: steam-puff 7.2s ease-in-out infinite;
}

.s1 { left: 18px; height: 84px; animation-delay: 0.2s; }
.s2 { left: 44px; height: 112px; animation-duration: 5.2s; animation-delay: 1.9s; }
.s3 { left: 64px; height: 70px; animation-duration: 4.2s; animation-delay: 3.2s; }
.s4 { left: 4px; width: 34px; height: 70px; animation-delay: 1.1s; }
.s5 { left: 46px; width: 40px; height: 82px; animation-duration: 6.6s; animation-delay: 2.8s; }
.s6 { left: 8px; width: 76px; height: 120px; animation-delay: 0.6s; }
.s7 { left: 30px; height: 96px; animation-duration: 4.9s; animation-delay: 2.4s; }
.s8 { left: 22px; width: 30px; height: 64px; animation-duration: 5.4s; animation-delay: 3.9s; }
.s9 { left: 54px; height: 80px; animation-duration: 4.4s; animation-delay: 1.2s; }

.steam-right .s1 { animation-delay: 1.5s; }
.steam-right .s2 { animation-delay: 3.1s; }
.steam-right .s3 { animation-delay: 0.4s; }
.steam-right .s4 { animation-delay: 2.3s; }
.steam-right .s5 { animation-delay: 0.9s; }
.steam-right .s6 { animation-delay: 2s; }
.steam-right .s7 { animation-delay: 0s; }
.steam-right .s8 { animation-delay: 1.7s; }
.steam-right .s9 { animation-delay: 3.5s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes steam-wisp {
    0% { opacity: 0; transform: translate3d(0, 14px, 0) scaleY(0.6); }
    22% { opacity: 1; }
    55% { transform: translate3d(-10px, -56px, 0) scaleY(1.05); }
    80% { opacity: 0.35; }
    100% { opacity: 0; transform: translate3d(10px, -140px, 0) scaleY(1.4); }
}

@keyframes steam-puff {
    0% { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.6); }
    28% { opacity: 0.8; }
    100% { opacity: 0; transform: translate3d(-16px, -128px, 0) scale(1.8); }
}

@keyframes glow {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 920px) {
    .split {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .stage {
        order: -1;
        min-height: 420px;
    }

    .welcome-wrap { bottom: 14%; }

    .welcome { font-size: clamp(44px, 11.5vw, 64px); }

    .welcome-sub { display: none; }

    .cup-scene {
        right: -14px;
        width: min(60vw, 250px);
    }

    .steam-group {
        transform: scale(0.65);
        transform-origin: bottom left;
    }

    .panel { padding: 8px 24px 28px; }

    .panel-top { padding-top: 18px; }

    .panel-form { padding: 30px 0 36px; }

    .form-title { font-size: 27px; }
}
