/*
 * ═══════════════════════════════════════════════════════════════
 *  Páginas públicas de acceso (registro y recuperar contraseña)
 * ═══════════════════════════════════════════════════════════════
 *  Marco: panel izquierdo con foto + velo carbón (login/components/auth_aside.php)
 *  y tarjeta blanca a la derecha. Colores institucionales del logo:
 *  rojo #F5313E (botones y textos #D42531 por contraste) y gris carbón #141612.
 *  Verde / ámbar / rojo vino solo para estados.
 */

:root {
    --au-brand: #F5313E;
    --au-accent: #D42531;
    --au-accent-ink: #A8141F;
    --au-accent-ring: rgba(245, 49, 62, .20);
    --au-accent-soft: rgba(245, 49, 62, .10);
    --au-dark: #141612;
    --au-dark-2: #2A2E2B;
    --au-bg: #E6E8EB;
    --au-border: #DDE1E6;
    --au-border-strong: #C9CFD6;
    --au-text: #141612;
    --au-muted: #555B57;
    --au-surface-2: #F7F8F9;
    --au-ok: #15603A;
    --au-ok-dot: #16A34A;
    --au-ok-soft: rgba(22, 163, 74, .12);
    --au-warn: #92400E;
    --au-warn-soft: rgba(217, 119, 6, .12);
    --au-danger: #9F1239;
    --au-danger-soft: rgba(159, 18, 57, .09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.auth {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    background: var(--au-bg);
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 13px;
    color: var(--au-text);
}

.auth a { color: var(--au-accent); font-weight: 800; text-decoration: none; }
.auth a:hover { color: var(--au-accent-ink); text-decoration: underline; }

/* ── Panel izquierdo ── */
.auth-aside {
    position: relative;
    flex: 1 1 460px;
    min-height: 100vh;
    display: flex;
    background-color: var(--au-dark);
    background-size: cover;
    background-position: center;
    color: #FFFFFF;
}

.auth-aside::before { content: ''; position: absolute; inset: 0; background: rgba(20, 22, 18, .80); }

.auth-aside-inner {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 40px 48px;
}

.auth-logo { width: 150px; height: auto; }
.auth-aside-copy { display: flex; flex-direction: column; gap: 16px; max-width: 440px; }

.auth-eyebrow {
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--au-brand);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.auth-aside h2 { font-size: 30px; font-weight: 800; line-height: 1.2; }
.auth-aside p { font-size: 14px; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.auth-points { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: rgba(255, 255, 255, .9); }
.auth-points li { display: flex; align-items: center; gap: 10px; }

.auth-points i {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.auth-copy { font-size: 12px; color: rgba(255, 255, 255, .7); }

/* ── Lado del formulario ── */
.auth-main {
    flex: 1 1 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #FFFFFF;
    border: 1px solid var(--au-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(20, 22, 18, .08);
    overflow: hidden;
}

.auth-card.is-wide { max-width: 560px; }
.auth-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.auth-body.is-center { text-align: center; }

.auth-steps { display: flex; gap: 6px; padding: 14px 22px 0; }
.auth-steps span { flex: 1; height: 4px; border-radius: 2px; background: #EEF0F2; }
.auth-steps span.is-done { background: var(--au-accent); }
.auth-step-label { font-size: 11.5px; font-weight: 700; color: var(--au-accent); }

.auth-head { display: flex; flex-direction: column; gap: 4px; }
.auth-head h1 { font-size: 20px; font-weight: 800; }
.auth-head p { color: var(--au-muted); line-height: 1.45; }

.auth-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }

.auth-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--au-accent-soft);
    color: var(--au-accent);
}

.auth-icon.is-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 24px; align-self: center; }
.auth-icon.is-warn { background: var(--au-warn-soft); color: var(--au-warn); }
.auth-icon.is-danger { background: var(--au-danger-soft); color: var(--au-danger); }
.auth-icon.is-ok { background: var(--au-ok-soft); color: var(--au-ok); }

/* ── Campos ── */
.auth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.auth-grid .is-full { grid-column: 1 / -1; }
.auth-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.auth-label { font-size: 11.5px; font-weight: 700; color: #2F3430; }
.auth-req { color: var(--au-danger); }
.auth-opt { font-weight: 400; color: var(--au-muted); }
.auth-help { font-size: 11.5px; color: var(--au-muted); }

.auth-input {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--au-border-strong);
    border-radius: 8px;
    background: #FFFFFF;
    transition: border-color .15s, box-shadow .15s;
}

.auth-input > i { color: var(--au-muted); font-size: 13px; width: 14px; text-align: center; }
.auth-input .auth-prefix { color: var(--au-muted); font-weight: 800; }

.auth-input input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    color: var(--au-text);
}

.auth-input:focus-within { border-color: var(--au-accent); box-shadow: 0 0 0 3px var(--au-accent-ring); }
.auth-input.is-readonly { background: var(--au-surface-2); }
.auth-input.is-match { border-color: rgba(22, 163, 74, .55); }

.auth-input-btn {
    border: none;
    background: none;
    padding: 0;
    color: var(--au-muted);
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
}

.auth-input-btn:hover,
.auth-input-btn:focus-visible { color: var(--au-accent); outline: none; }
.auth-match { color: var(--au-ok-dot); font-size: 14px; }
.auth-match[hidden] { display: none; }

/* Foto opcional */
.auth-photo { display: flex; align-items: center; gap: 12px; }

.auth-photo-preview {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--au-dark-2);
    color: #FFFFFF;
    font-size: 20px;
}

.auth-photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.auth-file-btn {
    align-self: flex-start;
    height: 28px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px dashed var(--au-border-strong);
    border-radius: 8px;
    background: #FFFFFF;
    font: inherit;
    font-weight: 600;
    color: var(--au-text);
    cursor: pointer;
}

.auth-file-btn:hover { border-color: var(--au-accent); }
.auth-photo input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Requisitos de contraseña */
.auth-reqs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }

.auth-reqs li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--au-danger-soft);
    color: var(--au-danger);
}

.auth-reqs li::before { content: "\f057"; font-family: 'Font Awesome 6 Free'; font-weight: 900; }
.auth-reqs li.is-ok { background: var(--au-ok-soft); color: var(--au-ok); }
.auth-reqs li.is-ok::before { content: "\f058"; }

/* Barra de seguridad */
.auth-strength { display: flex; gap: 4px; margin-top: 2px; }
.auth-strength span { flex: 1; height: 4px; border-radius: 2px; background: #EEF0F2; transition: background .2s; }
.auth-strength-text { font-size: 11.5px; font-weight: 700; color: var(--au-muted); }

/* ── Botones y avisos ── */
.auth-btn {
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--au-accent);
    color: #FFFFFF;
    font: inherit;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(212, 37, 49, .28);
    text-decoration: none;
}

.auth-btn:hover { background: var(--au-accent-ink); color: #FFFFFF; text-decoration: none; }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--au-accent-ring); }

.auth-btn.is-outline {
    background: #FFFFFF;
    color: var(--au-text);
    border: 1px solid var(--au-border-strong);
    box-shadow: none;
    font-weight: 700;
}

.auth-btn.is-outline:hover { border-color: var(--au-muted); background: var(--au-surface-2); color: var(--au-text); }

.auth-alert {
    display: flex;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.45;
    text-align: left;
}

.auth-alert > i { margin-top: 2px; flex: none; }
.auth-alert.is-error { background: var(--au-danger-soft); color: var(--au-danger); }
.auth-alert.is-warn  { background: var(--au-warn-soft); color: var(--au-warn); }
.auth-alert.is-ok    { background: var(--au-ok-soft); color: var(--au-ok); }
.auth-alert.is-info  { background: var(--au-surface-2); color: var(--au-muted); }
.auth-alert a { font-weight: 800; }

.auth-verified {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(22, 163, 74, .10);
    color: var(--au-ok);
    word-break: break-all;
}

.auth-who {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--au-surface-2);
}

.auth-who-avatar {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    background: var(--au-dark-2);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
}

.auth-who-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.auth-who-name small { font-size: 12px; color: var(--au-muted); }
.auth-expires { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--au-warn); white-space: nowrap; }

.auth-steplist { list-style: none; display: flex; flex-direction: column; gap: 8px; text-align: left; }

.auth-steplist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--au-surface-2);
}

.auth-steplist b {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    background: var(--au-dark-2);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.auth-foot { text-align: center; color: var(--au-muted); font-size: 12px; }

/* Enlace de desarrollo (solo si el servidor lo deja en sesión) */
.auth-dev { padding: 10px 12px; border: 1px dashed var(--au-warn); border-radius: 8px; background: var(--au-warn-soft); color: var(--au-warn); font-size: 12px; word-break: break-all; display: flex; flex-direction: column; gap: 6px; }

/* ── Celular: la foto se reduce arriba ── */
@media (max-width: 920px) {
    .auth-aside { flex-basis: 100%; min-height: 0; }
    .auth-aside-inner { padding: 22px 20px; gap: 14px; }
    .auth-aside h2 { font-size: 20px; }
    .auth-aside p,
    .auth-points,
    .auth-copy { display: none; }
    .auth-logo { width: 110px; }
    .auth-main { padding: 20px 14px 32px; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════
 *  Estilo del login (opción 2E) para registro y recuperar contraseña
 * ═══════════════════════════════════════════════════════════════
 *  Reemplaza el marco anterior (tarjeta + panel de foto):
 *  - la foto con velo carbón (72%) es el fondo de toda la página;
 *  - a la izquierda solo la frase, abajo;
 *  - a la derecha un panel blanco a toda la altura, con el logo a color,
 *    campos con línea inferior y botón redondeado, como login/index.php.
 *  En escritorio todo cabe en la ventana; si un formulario es más alto
 *  (Completa tus datos) el panel se desplaza por dentro.
 */
body.auth {
    height: 100vh;
    min-height: 560px;
    overflow: hidden;
    flex-wrap: nowrap;
    background:
        linear-gradient(rgba(20, 22, 18, .72), rgba(20, 22, 18, .72)),
        url('../file/img/fondo_cursos_1600.jpg') center / cover no-repeat;
    background-color: var(--au-dark);
}

/* Izquierda: solo la frase abajo, sobre la foto */
.auth-aside {
    flex: 1 1 auto;
    min-height: 0;
    background: none;
}

.auth-aside::before { display: none; }
.auth-aside-inner { justify-content: flex-end; gap: 14px; }
.auth-aside h2 { font-size: 26px; line-height: 1.25; }
.auth-aside p { max-width: 440px; }
.auth-copy { font-size: 11.5px; color: rgba(255, 255, 255, .6); }

/* Derecha: panel blanco a toda la altura */
.auth-main {
    position: relative;
    flex: 0 0 440px;
    height: 100vh;
    overflow-y: auto;
    flex-direction: column;
    /* Centrado con márgenes automáticos (::before / ::after): si el contenido es
       más alto que la ventana no se recorta arriba, solo se desplaza */
    justify-content: flex-start;
    align-items: stretch;
    padding: 32px 40px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: -20px 0 40px rgba(0, 0, 0, .25);
}

.auth-main:has(.auth-card.is-wide) { flex-basis: 580px; }

/* Logo a color arriba del formulario */
.auth-main::before {
    content: '';
    flex: none;
    width: 128px;
    height: 74px;
    margin: auto 0 18px;
    align-self: flex-start;
    background: url('../file/img/logo_ddhqro_color.png') left center / contain no-repeat;
}

.auth-main::after { content: ''; flex: none; margin-top: auto; }

.auth-main .auth-card {
    max-width: none;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.auth-main .auth-steps,
.auth-main .auth-body { padding-left: 0; padding-right: 0; }
.auth-main .auth-steps { padding-top: 0; }
.auth-main .auth-body { padding-bottom: 0; gap: 16px; }
.auth-head h1 { font-size: 24px; }

/* Campos con línea inferior (como el login) */
.auth-input {
    height: 40px;
    padding: 0;
    border: none;
    border-bottom: 2px solid rgba(20, 22, 18, .25);
    border-radius: 0;
    background: transparent;
}

.auth-input input { font-size: 15px; }
.auth-input:focus-within { border-bottom-color: var(--au-accent); box-shadow: none; }
.auth-input.is-readonly { background: transparent; border-bottom-style: dashed; }
.auth-input.is-match { border-bottom-color: var(--au-ok-dot); }

.auth-label {
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--au-muted);
}

/* Área táctil de 40px para el ojo de la contraseña */
.auth-input-btn {
    width: 40px;
    height: 40px;
    margin-right: -10px;
    align-items: center;
    justify-content: center;
}

/* Botones redondeados */
.auth-btn {
    height: 46px;
    border-radius: 23px;
    font-size: 15px;
    box-shadow: 0 6px 16px rgba(212, 37, 49, .30);
}

.auth-btn.is-outline { border-radius: 23px; }

/* Celular: foto en franja arriba y formulario debajo (aquí sí se desplaza) */
@media (max-width: 920px) {
    body.auth {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .auth-aside { flex: 0 0 auto; }
    .auth-aside-inner { padding: 24px 20px; }
    .auth-aside h2 { font-size: 19px; }
    .auth-aside p { display: block; font-size: 13px; }

    .auth-main,
    .auth-main:has(.auth-card.is-wide) {
        flex: 1 1 auto;
        height: auto;
        overflow: visible;
        padding: 24px 20px 32px;
        box-shadow: none;
    }

    .auth-main::before { margin-top: 0; width: 110px; height: 64px; }
}

/* Pantallas bajas en escritorio: compactar */
@media (max-height: 640px) and (min-width: 921px) {
    .auth-main::before { width: 104px; height: 60px; margin-bottom: 10px; }
    .auth-main .auth-body { gap: 12px; }
    .auth-head h1 { font-size: 21px; }
}

/* Barra de pasos visible sobre el panel claro */
.auth-main .auth-steps span { background: rgba(20, 22, 18, .12); }
.auth-main .auth-steps span.is-done { background: var(--au-accent); }
