/* =========================================================
   AUTH FLOW — GlezSystem
   Usado por: registro.html, codigo_otp.html, confirmacion.html
   Requiere que base.css se cargue primero (variables, nav, footer, botones, alertas)
   ========================================================= */

body{
    min-height:100vh;
    display:flex;
    flex-direction:column;
}

/* En el flujo de auth los botones ocupan toda la tarjeta */
.btn-primary,
.btn-secondary{ width:100%; }

/* ---------- AUTH SHELL ---------- */
.auth-shell{
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:56px 24px;
    position:relative;
    overflow:hidden;
}
.auth-shell::before{
    content:"";
    position:absolute;
    inset:0;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size:56px 56px;
    mask-image:radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 100%);
    -webkit-mask-image:radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 100%);
    pointer-events:none;
}
.auth-shell::after{
    content:"";
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%, -50%);
    width:800px;
    height:600px;
    background:radial-gradient(ellipse, rgba(34,211,238,.10), transparent 60%);
    pointer-events:none;
}

.auth-card{
    position:relative;
    z-index:1;
    width:100%;
    max-width:480px;
    background:var(--bg-elevated);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:40px;
    box-shadow:0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(34,211,238,.06);
}

/* La tarjeta de confirmación es un poco más ancha y centrada */
.auth-card.auth-card-success{
    max-width:520px;
    padding:48px 40px;
    text-align:center;
}

/* ---------- PROGRESS ---------- */
.auth-progress{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:28px;
}
.progress-step{
    flex:1;
    height:3px;
    border-radius:100px;
    background:var(--border);
    transition:background var(--transition);
}
.progress-step.active{ background:var(--accent); box-shadow:0 0 12px rgba(34,211,238,.5); }
.progress-step.done{ background:var(--accent); }

/* ---------- HEAD (eyebrow + título + subtítulo) ---------- */
.auth-head{ margin-bottom:32px; }
.auth-eyebrow{
    font-size:.72rem;
    font-weight:700;
    letter-spacing:.12em;
    text-transform:uppercase;
    color:var(--accent);
    margin-bottom:12px;
    font-family:'JetBrains Mono', monospace;
    display:flex;
    align-items:center;
    gap:8px;
}
.auth-eyebrow::before{ content:""; width:16px; height:1px; background:var(--accent); }
.auth-title{
    font-size:1.65rem;
    font-weight:800;
    letter-spacing:-0.025em;
    line-height:1.15;
    margin-bottom:10px;
}
.auth-title .gradient{
    background:linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
}
.auth-subtitle{
    font-size:.92rem;
    color:var(--text-secondary);
    line-height:1.55;
}
.auth-subtitle strong{ color:var(--text); font-weight:600; }

/* ---------- FORM FIELDS (registro) ---------- */
.field{ margin-bottom:18px; }
.field label{
    display:block;
    font-size:.82rem;
    font-weight:600;
    color:var(--text-secondary);
    margin-bottom:8px;
    letter-spacing:-0.005em;
}
.field label .req{ color:var(--accent); margin-left:2px; }
.input-wrap{ position:relative; }
.field input{
    width:100%;
    background:var(--surface);
    border:1px solid var(--border-strong);
    color:var(--text);
    padding:13px 16px;
    border-radius:10px;
    font-size:.94rem;
    font-family:inherit;
    transition:border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline:none;
}
.field input::placeholder{ color:var(--text-muted); }
.field input:hover{ border-color:#3a3f4d; }
.field input:focus{
    border-color:var(--accent);
    background:var(--surface-hover);
    box-shadow:0 0 0 3px var(--accent-soft);
}
.field.error input{
    border-color:var(--error-border);
    background:var(--error-soft);
}
.field.error input:focus{
    border-color:var(--error);
    box-shadow:0 0 0 3px rgba(248,113,113,.15);
}
.field-hint{
    font-size:.75rem;
    color:var(--text-muted);
    margin-top:6px;
    line-height:1.4;
}
.field-error{
    font-size:.78rem;
    color:var(--error);
    margin-top:6px;
    display:none;
    align-items:center;
    gap:6px;
    line-height:1.4;
}
.field.error .field-error{ display:flex; }

/* Toggle mostrar/ocultar contraseña */
.input-toggle{
    position:absolute;
    top:50%;
    right:12px;
    transform:translateY(-50%);
    background:transparent;
    border:none;
    color:var(--text-muted);
    cursor:pointer;
    padding:4px 6px;
    border-radius:6px;
    font-size:.72rem;
    font-weight:700;
    font-family:'JetBrains Mono', monospace;
    letter-spacing:.04em;
    transition:color var(--transition), background var(--transition);
}
.input-toggle:hover{ color:var(--accent); background:var(--accent-soft); }

/* Checkbox de aceptación de aviso/términos */
.checkbox-field{
    display:flex;
    gap:12px;
    align-items:flex-start;
    margin:22px 0 26px;
    cursor:pointer;
    user-select:none;
    padding:14px 16px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:10px;
    transition:border-color var(--transition), background var(--transition);
}
.checkbox-field:hover{ border-color:var(--border-strong); background:var(--surface-hover); }
.checkbox-field.checked{ border-color:rgba(34,211,238,.35); background:var(--accent-soft); }
.checkbox-field.error{ border-color:var(--error-border); background:var(--error-soft); }
.checkbox-field input{
    appearance:none;
    -webkit-appearance:none;
    width:18px;
    height:18px;
    border:1.5px solid var(--border-strong);
    border-radius:5px;
    background:var(--bg);
    flex-shrink:0;
    margin-top:1px;
    cursor:pointer;
    position:relative;
    transition:all var(--transition);
}
.checkbox-field input:checked{
    background:var(--accent);
    border-color:var(--accent);
}
.checkbox-field input:checked::after{
    content:"";
    position:absolute;
    left:5px;
    top:1.5px;
    width:5px;
    height:9px;
    border:solid var(--bg);
    border-width:0 2px 2px 0;
    transform:rotate(45deg);
}
.checkbox-field.error input{ border-color:var(--error); }
.checkbox-label{
    font-size:.85rem;
    color:var(--text-secondary);
    line-height:1.5;
}
.checkbox-label a{
    color:var(--accent);
    text-decoration:underline;
    text-underline-offset:2px;
    text-decoration-thickness:1px;
    font-weight:600;
}
.checkbox-label a:hover{ color:var(--accent-hover); }

/* ---------- OTP (codigo_otp) ---------- */
.otp-group{
    display:grid;
    grid-template-columns:repeat(6, 1fr);
    gap:10px;
    margin:28px 0 20px;
}
.otp-group input{
    width:100%;
    aspect-ratio:1;
    background:var(--surface);
    border:1px solid var(--border-strong);
    color:var(--text);
    border-radius:12px;
    font-size:1.5rem;
    font-weight:700;
    font-family:'JetBrains Mono', monospace;
    text-align:center;
    outline:none;
    transition:all var(--transition);
    caret-color:var(--accent);
}
.otp-group input::placeholder{ color:var(--text-muted); }
.otp-group input:hover{ border-color:#3a3f4d; }
.otp-group input:focus{
    border-color:var(--accent);
    background:var(--surface-hover);
    box-shadow:0 0 0 3px var(--accent-soft);
    transform:translateY(-2px);
}
.otp-group input.filled{
    border-color:rgba(34,211,238,.5);
    background:linear-gradient(180deg, var(--accent-soft), transparent);
}
.otp-group.error input{
    border-color:var(--error-border);
    background:var(--error-soft);
}
.otp-group.error input:focus{
    border-color:var(--error);
    box-shadow:0 0 0 3px rgba(248,113,113,.15);
}

.otp-meta{
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-size:.82rem;
    color:var(--text-secondary);
    margin-bottom:26px;
    gap:12px;
    flex-wrap:wrap;
}
.otp-meta-label{ color:var(--text-muted); }
.otp-resend{
    background:transparent;
    border:none;
    color:var(--accent);
    font-family:inherit;
    font-weight:700;
    font-size:.82rem;
    cursor:pointer;
    padding:6px 10px;
    border-radius:6px;
    transition:background var(--transition), color var(--transition);
}
.otp-resend:hover:not(:disabled){ background:var(--accent-soft); }
.otp-resend:disabled{ color:var(--text-muted); cursor:not-allowed; }

/* ---------- FOOT (link secundario bajo la tarjeta) ---------- */
.auth-foot{
    margin-top:24px;
    text-align:center;
    font-size:.86rem;
    color:var(--text-secondary);
}
.auth-foot a{
    color:var(--accent);
    text-decoration:none;
    font-weight:700;
    transition:color var(--transition);
}
.auth-foot a:hover{ color:var(--accent-hover); text-decoration:underline; text-underline-offset:2px; }

/* ---------- CONFIRMACIÓN (success) ---------- */
.success-icon{
    width:88px;
    height:88px;
    margin:0 auto 28px;
    border-radius:50%;
    background:radial-gradient(circle, var(--accent-soft), transparent 70%);
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
    animation:pop 500ms cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop{
    0%{ transform:scale(0); opacity:0; }
    60%{ transform:scale(1.1); }
    100%{ transform:scale(1); opacity:1; }
}
.success-icon::before{
    content:"";
    position:absolute;
    inset:0;
    border-radius:50%;
    border:2px solid var(--accent);
    box-shadow:0 0 30px rgba(34,211,238,.5), inset 0 0 30px rgba(34,211,238,.2);
}
.success-icon::after{
    content:"";
    position:absolute;
    width:32px;
    height:32px;
    background:var(--accent);
    border-radius:50%;
    box-shadow:0 0 20px rgba(34,211,238,.8);
}
.success-check{
    position:relative;
    z-index:1;
    width:16px;
    height:16px;
    color:#001014;
    font-size:1.1rem;
    font-weight:900;
    line-height:1;
    display:flex;
    align-items:center;
    justify-content:center;
}

.status-chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 16px;
    background:var(--accent-soft);
    border:1px solid rgba(34,211,238,.25);
    border-radius:100px;
    font-size:.78rem;
    font-weight:700;
    color:var(--accent);
    margin-bottom:32px;
    font-family:'JetBrains Mono', monospace;
    letter-spacing:.02em;
}
.status-dot{
    width:6px;
    height:6px;
    border-radius:50%;
    background:var(--accent);
    box-shadow:0 0 8px var(--accent);
    animation:pulse 2s ease-in-out infinite;
}

.next-steps{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:22px;
    margin-bottom:28px;
    text-align:left;
}
.next-steps-title{
    font-size:.72rem;
    font-weight:700;
    letter-spacing:.1em;
    text-transform:uppercase;
    color:var(--text-muted);
    margin-bottom:14px;
    font-family:'JetBrains Mono', monospace;
}
.next-step{
    display:flex;
    gap:12px;
    font-size:.88rem;
    color:var(--text-secondary);
    padding:8px 0;
    line-height:1.5;
}
.next-step-num{
    width:22px;
    height:22px;
    border-radius:6px;
    background:var(--accent-soft);
    border:1px solid rgba(34,211,238,.25);
    color:var(--accent);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:.7rem;
    font-weight:800;
    flex-shrink:0;
    margin-top:1px;
    font-family:'JetBrains Mono', monospace;
}
.next-step strong{ color:var(--text); font-weight:600; }

/* ---------- RESPONSIVE ---------- */
@media (max-width:560px){
    .auth-shell{ padding:32px 16px; }
    .auth-card{ padding:28px 22px; }
    .auth-card.auth-card-success{ padding:36px 24px; }
    .auth-title{ font-size:1.35rem; }
    .otp-group{ gap:6px; }
    .otp-group input{ font-size:1.2rem; border-radius:10px; }
    .success-icon{ width:72px; height:72px; margin-bottom:22px; }
}
