/* PolTraders — login y registro con tarjeta de cristal (partials/auth-glass.php, assets/js/pt-auth-glass.js).
   Fondo de bandas brillantes, tarjeta con dos esquinas cortadas y dos piezas de cristal que, al cambiar
   entre "Iniciar sesión" y "Crear cuenta", se juntan en el centro formando el logo. */

.ag-auth { --ag-c: 96px; --ag-p: 74px; --ag-ease: cubic-bezier(.22, 1, .36, 1); background: #050403; }
.ag-auth .auth-brand { display: none !important; }
.ag-auth .auth-split { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; place-items: center !important; padding: 88px 16px 32px !important; }

/* ---------- Fondo ---------- */
.ag-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: radial-gradient(70% 60% at 50% 45%, #15110a, #050403 70%); }
.ag-bg svg { position: absolute; inset: -6%; width: 112%; height: 112%; }
.ag-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 50%, transparent 30%, rgba(5, 4, 3, .75) 100%); }
.ag-bg__a { animation: ag-drift-a 22s ease-in-out infinite alternate; transform-origin: 50% 50%; }
.ag-bg__b { animation: ag-drift-b 26s ease-in-out infinite alternate; transform-origin: 50% 50%; }
.ag-bg__c { animation: ag-drift-c 30s ease-in-out infinite alternate; transform-origin: 50% 50%; }
@keyframes ag-drift-a { to { transform: translate(-60px, 40px) rotate(-2deg); } }
@keyframes ag-drift-b { to { transform: translate(70px, -30px) rotate(1.5deg); } }
@keyframes ag-drift-c { to { transform: translate(-40px, 20px) rotate(2deg); } }
.ag-auth .auth-footer, .ag-auth .auth-back, .ag-auth .auth-lang { position: relative; z-index: 2; }
.ag-auth .auth-lang { position: fixed; }
.ag-auth .auth-back { position: fixed; }

/* ---------- Tarjeta ---------- */
.ag-auth .auth-card {
    --clip: polygon(var(--ag-c) 0, 100% 0, 100% calc(100% - var(--ag-c)), calc(100% - var(--ag-c)) 100%, 0 100%, 0 var(--ag-c));
    position: relative; z-index: 1; width: 100%; max-width: 470px; padding: 46px 42px 38px; text-align: left;
    background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
.ag-auth .auth-card > .ag-shadow { position: absolute; inset: 8% 4% -2%; z-index: -3; pointer-events: none; background: radial-gradient(closest-side, rgba(0, 0, 0, .75), transparent), radial-gradient(closest-side, rgba(232, 177, 42, .14), transparent 120%); filter: blur(30px); }
/* Borde (capa de atrás) y cristal (capa de delante, 1 px más adentro) */
.ag-auth .auth-card::before, .ag-auth .auth-card::after {
    content: ""; position: absolute; pointer-events: none; clip-path: var(--clip); border-radius: 0; -webkit-mask: none; mask: none; padding: 0;
}
.ag-auth .auth-card::before {
    inset: 0; z-index: -2;
    background: linear-gradient(150deg, rgba(255, 231, 163, .75), rgba(255, 236, 190, .12) 28%, rgba(255, 236, 190, .06) 60%, rgba(232, 177, 42, .55));
}
.ag-auth .auth-card::after {
    inset: 1.5px; z-index: -1;
    --clip: polygon(calc(var(--ag-c) - .6px) 0, 100% 0, 100% calc(100% - var(--ag-c) + .6px), calc(100% - var(--ag-c) + .6px) 100%, 0 100%, 0 calc(var(--ag-c) - .6px));
    background:
        radial-gradient(120% 60% at 15% 0%, rgba(246, 207, 98, .16), transparent 55%),
        radial-gradient(90% 70% at 100% 100%, rgba(232, 177, 42, .1), transparent 60%),
        linear-gradient(180deg, rgba(26, 21, 13, .5), rgba(10, 8, 6, .66));
    -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
}

/* ---------- Piezas de las esquinas ---------- */
.ag-piece {
    position: absolute; z-index: 3; width: var(--ag-p); height: var(--ag-p); pointer-events: none;
    filter: drop-shadow(0 0 14px rgba(232, 177, 42, .45));
    transition: transform .75s var(--ag-ease), filter .5s;
}
.ag-piece::before, .ag-piece i { content: ""; position: absolute; inset: 0; display: block; }
.ag-piece--tl { left: 0; top: 0; }
.ag-piece--br { right: 0; bottom: 0; }
.ag-piece--tl::before { clip-path: polygon(0 0, 100% 0, 0 100%); }
.ag-piece--br::before { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.ag-piece::before { background: linear-gradient(135deg, rgba(255, 241, 196, .95), rgba(232, 177, 42, .7) 45%, rgba(185, 130, 25, .35)); }
.ag-piece i { inset: 2px; }
.ag-piece--tl i { clip-path: polygon(0 0, calc(100% - 2.8px) 0, 0 calc(100% - 2.8px)); }
.ag-piece--br i { clip-path: polygon(100% 2.8px, 100% 100%, 2.8px 100%); }
.ag-piece i { background: linear-gradient(135deg, rgba(255, 231, 163, .35), rgba(120, 86, 22, .32) 50%, rgba(20, 15, 8, .55)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.ag-piece--tl i::after, .ag-piece--br i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 255, 255, .45), transparent 40%); }

/* Al juntarse forman un cuadrado partido en diagonal en el centro de la tarjeta (JS calcula --gx/--gy) */
.auth-card.is-merged .ag-piece--tl { transform: translate(calc(var(--gx, 180px) - 3px), calc(var(--gy, 200px) - 3px)); }
.auth-card.is-merged .ag-piece--br { transform: translate(calc(var(--gx, 180px) * -1 + 3px), calc(var(--gy, 200px) * -1 + 3px)); }
.auth-card.is-merged .ag-piece { filter: drop-shadow(0 0 26px rgba(232, 177, 42, .8)); }

/* Núcleo: el logo aparece sobre las piezas juntas, con un anillo de luz */
.ag-core {
    position: absolute; left: 50%; top: 50%; z-index: 4; width: calc(var(--ag-p) + 6px); height: calc(var(--ag-p) + 6px);
    margin: calc((var(--ag-p) + 6px) / -2) 0 0 calc((var(--ag-p) + 6px) / -2);
    display: grid; place-items: center; border-radius: 18px; pointer-events: none;
    opacity: 0; transform: scale(.6); transition: opacity .35s, transform .5s var(--ag-ease);
}
.ag-core img { position: relative; width: 58%; height: auto; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .6)); }
.ag-core__ring { position: absolute; inset: -18px; border-radius: 50%; border: 1px solid rgba(246, 207, 98, .55); box-shadow: 0 0 40px rgba(232, 177, 42, .35), inset 0 0 30px rgba(232, 177, 42, .25); opacity: 0; }
.auth-card.is-core .ag-core { opacity: 1; transform: none; }
.auth-card.is-core .ag-core__ring { animation: ag-ring 1.1s var(--ag-ease) infinite; }
@keyframes ag-ring { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.9); } }

/* Contenido: se va y vuelve escalonado */
.ag-auth .auth-card > :not(.ag-piece):not(.ag-core):not(.ag-shadow):not(script) {
    position: relative; z-index: 2; transition: opacity .35s ease, transform .5s var(--ag-ease), filter .35s;
}
.auth-card.is-hidden > :not(.ag-piece):not(.ag-core):not(.ag-shadow):not(script) { opacity: 0; transform: translateY(10px); filter: blur(6px); pointer-events: none; }
.ag-auth .auth-card > :nth-child(6) { transition-delay: .04s; }
.ag-auth .auth-card > :nth-child(7) { transition-delay: .08s; }
.ag-auth .auth-card > :nth-child(8) { transition-delay: .12s; }
.ag-auth .auth-card > :nth-child(9) { transition-delay: .16s; }
.ag-auth .auth-card > :nth-child(10) { transition-delay: .2s; }

/* ---------- Textos y campos ---------- */
.ag-auth .login-logo { display: block; width: max-content; margin: 0 0 18px auto; }
.ag-auth .login-logo img { height: 34px; }
.ag-auth .auth-card h2 {
    display: inline-block; margin: 0 0 6px; font-size: clamp(1.9rem, 4vw, 2.3rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.1;
    background: linear-gradient(90deg, #fff 0, #fff 42%, #f6cf62 58%, #e8b12a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ag-auth .auth-card .subtitle { display: block; margin: 0 0 26px; color: rgba(246, 241, 231, .6); font-size: 14px; }
.ag-auth .auth-form { gap: 14px; }
.ag-auth .auth-form .fl > input {
    border-radius: 12px !important; background: rgba(6, 5, 3, .55) !important;
    border: 1px solid rgba(255, 236, 190, .1) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
    transition: border-color .25s, box-shadow .25s, background .25s;
}
.ag-auth .auth-form .fl > input:hover { border-color: rgba(255, 236, 190, .2) !important; }
.ag-auth .auth-form .fl > input:focus { border-color: rgba(232, 177, 42, .65) !important; background: rgba(12, 10, 6, .7) !important; box-shadow: 0 0 0 4px rgba(232, 177, 42, .12), 0 0 24px -6px rgba(232, 177, 42, .5) !important; }
.ag-auth .auth-form .pt-btn--gold { height: 52px; margin-top: 4px; border-radius: 12px; box-shadow: 0 14px 34px -14px rgba(232, 177, 42, .9), inset 0 1px 0 rgba(255, 255, 255, .45); }
.ag-auth .auth-form .pt-btn--gold:hover { box-shadow: 0 18px 40px -12px rgba(232, 177, 42, 1), inset 0 1px 0 rgba(255, 255, 255, .5); }
.ag-auth .auth-card .links { margin-top: 20px; text-align: center; font-size: 13.5px; color: rgba(246, 241, 231, .55); }
.ag-auth .auth-card .links p { margin: 4px 0; }
.ag-auth .auth-card .links a { color: #f6cf62; font-weight: 600; }
.ag-auth .auth-card .auth-legal { text-align: center; }

@media (max-width: 520px) {
    .ag-auth { --ag-c: 54px; --ag-p: 44px; }
    .ag-auth .auth-card { padding: 40px 24px 30px; }
}
@media (prefers-reduced-motion: reduce) {
    .ag-bg__a, .ag-bg__b, .ag-bg__c { animation: none; }
}

/* Al llegar desde la otra página la tarjeta ya está en su sitio: sin la animación de entrada general */
.js .ag-auth .auth-card.is-arriving, .js .ag-auth .auth-card[data-morphed] { animation: none; opacity: 1; transform: none; }

/* Llegada: la tarjeta cambia suave de la altura de la página anterior a la suya */
.ag-auth .auth-card { transition: height .6s var(--ag-ease); }
/* Hueco de la barra de desplazamiento siempre reservado: si una página es más alta que otra, nada se mueve de lado */
html:has(> body.ag-auth) { scrollbar-gutter: stable; }

/* El fondo sigue donde iba en la página anterior (el retraso negativo lo pone el script del fondo) */
.ag-bg__a, .ag-bg__b, .ag-bg__c { animation-delay: calc(var(--ag-t, 0s) * -1); }

/* Títulos largos (recuperar / restablecer) más pequeños para que quepan en una línea con el mismo degradado */
.ag-auth .auth-card h2.ag-long { font-size: clamp(1.3rem, 5.2vw, 1.62rem); white-space: nowrap; }

/* Registro: ya existe una cuenta con ese correo -> botones para entrar o recuperar la contraseña */
.ag-auth .reg-exists { display: grid; gap: 10px; margin: 12px 0 18px; }
.ag-auth .reg-exists .pt-btn { height: 48px; border-radius: 12px; }
/* "¿Quisiste decir ...@gmail.com?" debajo del correo */
.ag-auth .email-typo { margin-top: -4px; }
.email-typo__fix { padding: 0; border: 0; background: none; color: #f6cf62; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.email-typo__fix:hover { color: #fff1c4; }

/* ---------- Verificar correo (verify.php + assets/js/pt-verify.js) ---------- */
.ag-auth .ev-card { text-align: center; }
.ag-auth .ev-card .login-logo { display: none; }
.ev-badge { position: relative; width: 80px; height: 80px; margin: 2px auto 18px; display: grid; place-items: center; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 231, 163, .22), rgba(232, 177, 42, .06) 60%), rgba(12, 10, 6, .6);
    box-shadow: inset 0 1px 0 rgba(255, 240, 200, .18), 0 0 0 1px rgba(232, 177, 42, .28), 0 18px 40px -18px rgba(232, 177, 42, .6);
    transition: background .5s, box-shadow .5s, transform .5s var(--ag-ease); }
.ev-badge i { position: absolute; font-size: 24px; transition: opacity .35s, transform .5s var(--ag-ease); }
.ev-badge__lock { color: #f6cf62; }
.ev-badge__ok { color: #062b16; opacity: 0; transform: scale(.4) rotate(-30deg); }
.ev-badge__ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); }
.ev-badge__ring circle { fill: none; stroke: #f6cf62; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 60 232; opacity: 0; transition: opacity .3s, stroke .4s; }
.ev-busy .ev-badge__ring { animation: ev-spin 1s linear infinite; }
.ev-busy .ev-badge__ring circle { opacity: 1; }
@keyframes ev-spin { to { transform: rotate(270deg); } }
.ev-bad .ev-badge { box-shadow: inset 0 1px 0 rgba(255, 200, 190, .2), 0 0 0 1px rgba(240, 71, 62, .55), 0 18px 40px -18px rgba(240, 71, 62, .7); }
.ev-bad .ev-badge__lock { color: #f3a597; }
.ev-ok .ev-badge { background: radial-gradient(circle at 35% 30%, #a4f0c2, #3fbf75 70%); box-shadow: 0 0 0 6px rgba(79, 199, 128, .18), 0 0 40px rgba(79, 199, 128, .55); transform: scale(1.06); }
.ev-ok .ev-badge__lock { opacity: 0; transform: scale(.4); }
.ev-ok .ev-badge__ok { opacity: 1; transform: none; }

.ag-auth .ev-card .subtitle b { color: #fff; font-weight: 600; }
.ev-boxes { display: flex; justify-content: center; gap: 10px; margin: 4px 0 6px; }
.ev-box {
    width: 52px; height: 62px; padding: 0; text-align: center; font: 700 26px/1 var(--f-mono, ui-monospace, monospace); color: #fff;
    border-radius: 14px; border: 1px solid rgba(255, 236, 190, .14); background: rgba(6, 5, 3, .6); caret-color: #f6cf62;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); outline: 0;
    transition: border-color .25s, box-shadow .25s, background .35s, transform .35s cubic-bezier(.34, 1.56, .64, 1), color .3s;
}
.ev-box:focus { border-color: rgba(232, 177, 42, .75); box-shadow: 0 0 0 4px rgba(232, 177, 42, .14), 0 0 24px -6px rgba(232, 177, 42, .6); transform: translateY(-3px); }
.ev-box.is-filled { border-color: rgba(246, 207, 98, .45); animation: ev-pop .32s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes ev-pop { 0% { transform: scale(.86); } 100% { transform: none; } }
.ev-bad .ev-box { border-color: rgba(240, 71, 62, .7); color: #f3a597; background: rgba(40, 10, 8, .55); }
.ev-ok .ev-box { border-color: transparent; color: #062b16; background: linear-gradient(180deg, #8ff0b5, #3fbf75); box-shadow: 0 12px 26px -12px rgba(63, 191, 117, .9); transform: translateY(-2px); }
.ev-msg { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 10px 0 0; color: #f3a597; font-size: 13.5px; }
.ev-msg[hidden] { display: none; }
.ev-form .ev-btn { position: relative; overflow: hidden; margin-top: 18px; isolation: isolate;
    background: rgba(255, 244, 214, .06) !important; color: rgba(246, 241, 231, .55) !important; box-shadow: none !important; transition: color .3s, box-shadow .3s; }
.ev-btn__fill { position: absolute; inset: 0; z-index: -1; width: var(--fill, 0%); background: linear-gradient(180deg, #f6cf62, #e8b12a); transition: width .45s var(--ag-ease), background .4s; }
.ev-form .ev-btn.is-ready { color: #1d1503 !important; box-shadow: 0 14px 34px -14px rgba(232, 177, 42, .9), inset 0 1px 0 rgba(255, 255, 255, .45) !important; }
.ev-ok .ev-btn { color: #062b16 !important; }
.ev-ok .ev-btn__fill { width: 100% !important; background: linear-gradient(180deg, #8ff0b5, #3fbf75); }
.ev-spin { display: inline-block; width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; border-radius: 50%; border: 2px solid rgba(29, 21, 3, .25); border-top-color: #1d1503; animation: ev-spin2 .7s linear infinite; }
@keyframes ev-spin2 { to { transform: rotate(360deg); } }
.ev-resend p:first-child { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ev-box::selection { background: transparent; }
.ev-card .ev-resend[hidden] { display: none !important; }
.ev-resend__btn { padding: 0; border: 0; background: none; color: #f6cf62; font: inherit; font-weight: 700; cursor: pointer; }
.ev-resend__btn:hover { text-decoration: underline; }
.ev-resend [hidden] { display: none !important; }
.ev-clock { width: 14px; height: 14px; vertical-align: -2px; transform: rotate(-90deg); }
.ev-clock circle { fill: none; stroke: #f6cf62; stroke-width: 2.4; stroke-dasharray: 50.3; stroke-dashoffset: calc(50.3 * (1 - var(--left, 1))); transition: stroke-dashoffset .25s linear; }
#evResendWait b { color: #fff; font-variant-numeric: tabular-nums; }
.ev-note { font-size: 12.5px !important; opacity: .8; }
.ev-dev { position: relative; z-index: 2; margin: -6px auto 10px; text-align: center; font-size: 13px; color: rgba(246, 241, 231, .6); }
.ev-dev b { color: #f6cf62; letter-spacing: .12em; }
@media (max-width: 520px) { .ev-boxes { gap: 7px; } .ev-box { width: 44px; height: 54px; font-size: 22px; } }

/* ---------- Colores y fondo de la web (los mismos que el inicio) ----------
   Fondo negro cálido con el brillo dorado de arriba, las partículas y las manchas suaves de la web
   (pt-site.js / .pt-aurora) y una línea dorada como la del inicio en lugar de las bandas. */
.ag-auth { background: transparent; }
.ag-bg { background: none; }
.ag-bg::after { background: radial-gradient(70% 60% at 50% 50%, transparent 40%, rgba(11, 10, 8, .55) 100%); }
.ag-bg__line { filter: drop-shadow(0 0 8px rgba(232, 177, 42, .55)); }

/* Tarjeta con las superficies y el borde dorado de las tarjetas de la web */
.ag-auth .auth-card::before {
    background: linear-gradient(155deg, rgba(246, 207, 98, .7), rgba(232, 177, 42, .18) 22%, rgba(245, 230, 200, .08) 45%, rgba(245, 230, 200, .06) 72%, rgba(232, 177, 42, .4));
}
.ag-auth .auth-card::after {
    background:
        radial-gradient(90% 45% at 50% 0%, rgba(232, 177, 42, .13), transparent 70%),
        linear-gradient(180deg, rgba(27, 25, 20, .9), rgba(16, 15, 12, .92));
}
.ag-auth .auth-card > .ag-shadow { background: radial-gradient(closest-side, rgba(0, 0, 0, .8), transparent), radial-gradient(closest-side, rgba(232, 177, 42, .1), transparent 120%); }

/* Títulos como los de la web: palabra en dorado cursiva (Instrument Serif) */
.ag-auth .auth-card h2 { background: none; -webkit-text-fill-color: currentColor; color: var(--text); font-weight: 600; letter-spacing: -.045em; }
.ag-auth .auth-card h2 em {
    font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: 1.12em; letter-spacing: -.01em; padding-right: .06em;
    background: var(--grad-gold, linear-gradient(100deg, #f9dc85, #e8b12a 40%, #fff0c2 55%, #e8b12a 70%, #b98219)); background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
    animation: pt-shine 8s linear infinite;
}
.ag-auth .auth-card .subtitle { color: var(--text-2); }

/* Campos y botones con las formas de la web: botón dorado en píldora con brillo */
.ag-auth .auth-form .fl > input { border-radius: 14px !important; background: rgba(11, 10, 8, .72) !important; border-color: var(--line-2) !important; }
.ag-auth .auth-form .pt-btn--gold, .ag-auth .reg-exists .pt-btn, .ag-auth .ev-form .ev-btn { border-radius: 999px; }
.ag-auth .auth-form .pt-btn--gold { box-shadow: 0 16px 36px -14px rgba(232, 177, 42, .85), inset 0 1px 0 rgba(255, 255, 255, .45); }
.ag-auth .auth-card .links a, .ag-auth .ev-resend__btn { color: var(--gold-hi); }
.ag-auth .ev-box { border-color: var(--line-2); background: rgba(11, 10, 8, .72); }
/* Autorrelleno del navegador (correo y contraseña guardados): sin el fondo gris azulado de Chrome */
.ag-auth .auth-form input:-webkit-autofill,
.ag-auth .auth-form input:-webkit-autofill:hover,
.ag-auth .auth-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text); caret-color: var(--gold-hi);
    -webkit-box-shadow: 0 0 0 1000px #0e0d0a inset !important; box-shadow: 0 0 0 1000px #0e0d0a inset !important;
    transition: background-color 9999s ease-out 0s;
}
/* La etiqueta sube también cuando el navegador ha rellenado el campo (si no, se monta encima del texto) */
.ag-auth .fl input:-webkit-autofill + label { top: 17px; transform: translateY(-50%) scale(.78); color: var(--gold); }
