/* Chapin Radios GT - pantalla de inicio de sesion */
:root {
    --ink: #121a33;
    --ink-2: #4a5470;
    --ink-3: #8a93ab;
    --line: #e3e7f1;
    --brand: #3949ab;
    --brand-2: #5c6bf0;
    --brand-deep: #1b2468;
    --accent: #22d3a6;
    --red: #d64545;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.auth-page {
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink); background: #f4f6fb; -webkit-font-smoothing: antialiased;
}
.material-icons { font-size: 20px; line-height: 1; }

.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }

/* ---------- Panel de marca ---------- */
.auth-brand {
    --mx: 50%; --my: 40%;
    position: relative; overflow: hidden; color: #fff;
    display: flex; align-items: center; justify-content: center; padding: 48px;
    background:
        radial-gradient(600px circle at var(--mx) var(--my), rgba(255, 255, 255, .10), transparent 45%),
        linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 55%, var(--brand-2) 100%);
    background-size: 100% 100%, 200% 200%;
    animation: gradientShift 14s ease-in-out infinite alternate;
}
@keyframes gradientShift { from { background-position: 0 0, 0% 50%; } to { background-position: 0 0, 100% 50%; } }

.auth-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.blob-1 { width: 420px; height: 420px; background: #7c4dff; top: -120px; left: -100px; animation: float1 16s ease-in-out infinite alternate; }
.blob-2 { width: 360px; height: 360px; background: var(--accent); bottom: -140px; right: -80px; opacity: .35; animation: float2 18s ease-in-out infinite alternate; }
@keyframes float1 { to { transform: translate(120px, 90px) scale(1.15); } }
@keyframes float2 { to { transform: translate(-100px, -70px) scale(1.1); } }

.auth-grid {
    position: absolute; inset: 0; pointer-events: none; opacity: .14;
    background-image: linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 70%);
            mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 70%);
}

.auth-brand-inner { position: relative; z-index: 1; max-width: 440px; text-align: center; animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
.auth-brand h1 { font-size: 36px; font-weight: 700; margin: 26px 0 8px; letter-spacing: -.5px; }
.auth-brand p { margin: 0 auto; color: rgba(255, 255, 255, .78); font-size: 15px; line-height: 1.6; max-width: 340px; }

.auth-logo-wrap { position: relative; width: 112px; height: 112px; margin: 0 auto; display: grid; place-items: center; }
.auth-logo {
    position: relative; z-index: 2; width: 96px; height: 96px; border-radius: 26px;
    box-shadow: 0 18px 40px rgba(10, 16, 60, .45), 0 0 0 6px rgba(255, 255, 255, .12);
    animation: bob 5s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px); } }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); animation: pulse 3.6s cubic-bezier(.2, .6, .4, 1) infinite; }
.ring-2 { animation-delay: 1.2s; }
.ring-3 { animation-delay: 2.4s; }
@keyframes pulse { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(2.3); opacity: 0; } }

/* Ecualizador */
.eq { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 56px; margin: 34px auto 30px; }
.eq span {
    width: 5px; border-radius: 4px; height: 100%;
    background: linear-gradient(to top, var(--accent), rgba(255, 255, 255, .95));
    transform-origin: bottom; transform: scaleY(.2);
    animation: eq 1.2s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.137s);
    animation-duration: calc(0.9s + (var(--i) * 0.031s));
    opacity: .9;
}
@keyframes eq { 0%, 100% { transform: scaleY(.15); } 25% { transform: scaleY(.85); } 50% { transform: scaleY(.35); } 75% { transform: scaleY(1); } }

.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; text-align: left; }
.auth-features li {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; font-size: 14px;
    background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    animation: rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-features li:nth-child(1) { animation-delay: .25s; }
.auth-features li:nth-child(2) { animation-delay: .35s; }
.auth-features li:nth-child(3) { animation-delay: .45s; }
.auth-features .material-icons { color: var(--accent); }

.live-badge {
    position: absolute; top: 24px; left: 24px; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 600; letter-spacing: .14em; padding: 7px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 0 rgba(255, 77, 109, .7); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(255, 77, 109, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); } }

/* ---------- Formulario ---------- */
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-form { width: 100%; max-width: 380px; animation: rise .7s .1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.auth-logo-sm { display: none; width: 56px; height: 56px; border-radius: 16px; margin-bottom: 18px; box-shadow: 0 10px 24px rgba(57, 73, 171, .3); }
.auth-form h2 { font-size: 28px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.4px; }
.auth-sub { color: var(--ink-3); font-size: 14.5px; margin: 0 0 28px; }

.auth-alert {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 18px; border-radius: 12px;
    background: #fdecec; color: #a12f2f; font-size: 14px; animation: rise .35s both;
}

.field { position: relative; margin-bottom: 16px; }
.field input {
    width: 100%; height: 56px; padding: 22px 46px 6px 46px; font: inherit; font-size: 15px; color: var(--ink);
    border: 1.5px solid var(--line); border-radius: 14px; background: #f8f9fc; outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:hover { border-color: #cfd5e6; }
.field input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(57, 73, 171, .12); }
.field label {
    position: absolute; left: 46px; top: 50%; transform: translateY(-50%); pointer-events: none;
    color: var(--ink-3); font-size: 15px; transition: top .18s, font-size .18s, color .18s;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label { top: 16px; font-size: 11.5px; font-weight: 500; color: var(--brand); }
.field-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-3); transition: color .2s; }
.field:focus-within .field-icon { color: var(--brand); }
.field-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
    border: 0; background: none; border-radius: 10px; color: var(--ink-3); cursor: pointer; display: grid; place-items: center;
}
.field-toggle:hover { background: #eef1f8; color: var(--ink); }
.field.invalid input { border-color: var(--red); background: #fffafa; }
.field.invalid .field-icon, .field.invalid label { color: var(--red); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.caps-hint { display: none; align-items: center; gap: 6px; font-size: 12.5px; color: #a26b00; margin: -6px 0 12px 4px; }
.caps-hint.show { display: flex; }
.caps-hint .material-icons { font-size: 16px; }

.auth-submit {
    position: relative; overflow: hidden; width: 100%; height: 54px; margin-top: 8px; border: 0; border-radius: 14px; cursor: pointer;
    font: inherit; font-size: 15.5px; font-weight: 600; color: #fff; letter-spacing: .2px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    box-shadow: 0 10px 24px rgba(57, 73, 171, .32);
    transition: transform .15s, box-shadow .2s, filter .2s;
}
.auth-submit:before {
    content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(110deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg);
    transition: left .7s;
}
.auth-submit:hover { box-shadow: 0 14px 30px rgba(57, 73, 171, .42); filter: brightness(1.05); }
.auth-submit:hover:before { left: 120%; }
.auth-submit:active { transform: translateY(1px) scale(.995); }
.auth-submit:focus-visible { outline: 3px solid rgba(57, 73, 171, .35); outline-offset: 3px; }
.auth-arrow { transition: transform .2s; }
.auth-submit:hover .auth-arrow { transform: translateX(4px); }
.auth-spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.auth-submit.loading { pointer-events: none; }
.auth-submit.loading .auth-spinner { display: inline-block; }
.auth-submit.loading .auth-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 28px 0 0; font-size: 12.5px; color: var(--ink-3); }
.auth-foot .material-icons { font-size: 16px; color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-panel {
        min-height: 100vh; padding: 32px 20px;
        background:
            radial-gradient(500px circle at 0% 0%, rgba(92, 107, 240, .16), transparent 60%),
            radial-gradient(500px circle at 100% 100%, rgba(34, 211, 166, .12), transparent 60%),
            #f6f7fc;
    }
    .auth-form { background: #fff; padding: 32px 24px; border-radius: 22px; border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(18, 26, 51, .08); }
    .auth-logo-sm { display: block; }
    .auth-form h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after { animation: none !important; transition: none !important; }
    .eq span { transform: scaleY(.5); }
}
