/*
    AUTH-UI-02 · Hoja de estilos ÚNICA y compartida de todas las superficies de
    autenticación de Barbeo (login, registro, recuperación, reset, verificación,
    cambio de contraseña obligatorio y acceso bloqueado).

    Reemplaza los 7 bloques <style> casi idénticos que vivían dentro de cada vista.
    Se sirve como asset estático (sin build) y es 100% autónoma: no arrastra el CSS
    del panel ni de Livewire, igual que barbeo-public-booking.css. La marca corporativa
    (isotipo + "Barbeo") la aporta <x-barbeo-brand>; el ojo mostrar/ocultar contraseña,
    <x-password-input> (que autoestila .pw-field/.pw-input/.pw-toggle).

    Fuente de verdad de color: #6366F1 (indigo Barbeo), espejo de los tokens del panel.
*/

:root {
    /* Marca — espejo de barbeo-panel.css (no inventar morados nuevos). */
    --brand: #6366f1;
    --brand-hover: #4f52e0;
    --brand-strong: #4338ca;
    --brand-2: #8b5cf6;
    --brand-soft: #eef0ff;
    --brand-ring: rgba(99, 102, 241, 0.14);
    --brand-shadow: rgba(99, 102, 241, 0.35);

    /* Superficie / texto */
    --bg: #f8fafc;
    --card: #ffffff;
    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Estados */
    --ok: #047857;      --ok-bg: #ecfdf5;  --ok-border: #a7f3d0;
    --danger: #dc2626;  --danger-bg: #fef2f2; --danger-border: #fecaca;
    --warn: #b45309;    --warn-bg: #fffbeb;   --warn-border: #fde68a;

    --radius-lg: 24px;
    --radius-md: 12px;
}

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

.auth-body {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background:
        radial-gradient(1200px 600px at 100% 0%, rgba(99, 102, 241, 0.08), transparent 60%),
        radial-gradient(900px 500px at 0% 100%, rgba(139, 92, 246, 0.06), transparent 55%),
        var(--bg);
    color: var(--ink);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Shell — split (login/registro) vs tarjeta única (resto)
   ============================================================ */
.auth-shell {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -30px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.auth-shell--split {
    max-width: 1080px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

.auth-shell--single {
    max-width: 440px;
}
.auth-shell--wide { max-width: 480px; }

/* Panel del formulario */
.auth-panel {
    padding: 46px 48px;
    display: flex;
    flex-direction: column;
}
.auth-shell--single .auth-panel { padding: 44px 40px; }
.auth-panel--center { text-align: center; align-items: center; }

/* Cabecera de marca */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}
.auth-panel--center .auth-brand { justify-content: center; }

/* Título + bajada */
.auth-head { margin-bottom: 4px; }
.auth-head h1 {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 8px;
}
.auth-head p {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.55;
    max-width: 400px;
}
.auth-panel--center .auth-head p { max-width: 360px; margin-inline: auto; }

/* ============================================================
   Formulario
   ============================================================ */
.auth-form { margin-top: 28px; }

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    line-height: 1.45;
    margin-bottom: 20px;
}
.auth-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.auth-alert--error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }
.auth-alert--ok    { background: var(--ok-bg);     border: 1px solid var(--ok-border);     color: var(--ok); }

.auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.auth-field { margin-bottom: 18px; }
.auth-field > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ink-soft);
}
/* Inputs planos y el <input> interno de <x-password-input> (.pw-input) */
.auth-field input,
.auth-field .pw-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14.5px;
    color: var(--ink);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.auth-field input::placeholder { color: var(--faint); }
.auth-field input:focus,
.auth-field .pw-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-ring);
}
.auth-field input.has-error,
.auth-field .pw-input.has-error { border-color: var(--danger); }

.auth-field__error {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--danger);
}
.auth-hint {
    font-size: 12.5px;
    color: var(--muted);
    margin: -8px 0 20px;
}

/* Fila recordarme / recuperar */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 24px;
}
.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: #475569;
    cursor: pointer;
    user-select: none;
}
.auth-remember input { width: 16px; height: 16px; accent-color: var(--brand); }

.auth-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    border-radius: 4px;
}
.auth-link:hover { color: var(--brand-strong); }

/* ============================================================
   Botones
   ============================================================ */
.auth-btn {
    width: 100%;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
    box-shadow: 0 10px 22px -12px var(--brand-shadow);
}
.auth-btn:hover { background: var(--brand-hover); }
.auth-btn:active { transform: translateY(1px); }

.auth-btn--secondary {
    height: 46px;
    background: #fff;
    color: var(--ink);
    border-color: var(--border);
    font-size: 14.5px;
    font-weight: 600;
    box-shadow: none;
}
.auth-btn--secondary:hover { background: #f8fafc; border-color: var(--border-strong); }

/* Enlace con forma de botón secundario (registro desde login) */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0 18px;
    color: var(--faint);
    font-size: 12px;
}
.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.auth-actions { display: flex; flex-direction: column; gap: 12px; }

/* Pie de la tarjeta */
.auth-foot {
    margin-top: 26px;
    font-size: 13.5px;
    color: var(--muted);
}
.auth-panel--center .auth-foot { text-align: center; }
.auth-foot a, .auth-foot button {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}
.auth-foot a:hover, .auth-foot button:hover { color: var(--brand-strong); }
.auth-foot form { display: inline; margin: 0; }

/* ============================================================
   Consentimiento legal (registro) — LEGAL-CONSENT-01
   ============================================================ */
.auth-consent { margin: 6px 0 4px; }
.auth-consent__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.auth-consent__row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--brand);
    cursor: pointer;
}
.auth-consent__row label {
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--ink-soft);
    cursor: pointer;
}
.auth-consent__row a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.auth-consent__row a:hover { color: var(--brand-strong); }
.auth-consent .auth-field__error { margin: -6px 0 12px 30px; }

/* ============================================================
   Insignia de estado (acceso bloqueado / verificación)
   ============================================================ */
.auth-badge {
    width: 56px;
    height: 56px;
    margin: 0 auto 22px;
    border-radius: 16px;
    display: grid;
    place-items: center;
}
.auth-badge svg { width: 26px; height: 26px; }
.auth-badge--warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn); }
.auth-badge--brand { background: var(--brand-soft); border: 1px solid #d9dcff; color: var(--brand); }

/* ============================================================
   Panel lateral de marca (desktop) — aporta valor real, no relleno
   ============================================================ */
.auth-aside {
    background:
        radial-gradient(700px 400px at 100% 0%, rgba(139, 92, 246, 0.35), transparent 60%),
        linear-gradient(160deg, #1e1b4b 0%, #0f172a 62%);
    color: #e2e8f0;
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-aside__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #c7d2fe;
    margin-bottom: 22px;
}
.auth-aside__title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #fff;
    margin-bottom: 8px;
}
.auth-aside__sub {
    font-size: 14px;
    color: #a5b4cf;
    line-height: 1.5;
    margin-bottom: 28px;
    max-width: 340px;
}
.auth-feature {
    display: flex;
    gap: 14px;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-feature:first-of-type { border-top: none; }
.auth-feature__ico {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: rgba(139, 92, 246, 0.18);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
}
.auth-feature__ico svg { width: 19px; height: 19px; }
.auth-feature__txt strong {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
}
.auth-feature__txt span {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.45;
}

/* ============================================================
   Accesibilidad
   ============================================================ */
:where(a, button, input, .auth-remember):focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    .auth-btn:active { transform: none; }
}

/* ============================================================
   Responsive — móvil primero: SIEMPRE una sola columna
   ============================================================ */
@media (max-width: 900px) {
    .auth-shell--split {
        grid-template-columns: 1fr;   /* nunca dos columnas en móvil */
        max-width: 480px;
    }
    .auth-aside { display: none; }    /* el panel lateral no aporta en móvil */
    .auth-panel { padding: 40px 32px; }
}

@media (max-width: 520px) {
    .auth-body { padding: 20px 16px; justify-content: flex-start; }
    .auth-shell { border-radius: 20px; }
    .auth-panel { padding: 30px 22px 34px; }
    .auth-shell--single .auth-panel { padding: 32px 24px; }
    .auth-brand { margin-bottom: 26px; }
    .auth-head h1 { font-size: 23px; }
    .auth-head p { font-size: 14px; }
    .auth-form { margin-top: 24px; }
    .auth-grid-2 { grid-template-columns: 1fr; gap: 0; }

    /* font-size >= 16px evita el zoom automático de iOS al enfocar */
    .auth-field input,
    .auth-field .pw-input { height: 50px; font-size: 16px; }
    .auth-btn { height: 52px; font-size: 16px; }
    .auth-btn--secondary { height: 50px; }
    .auth-foot { margin-top: 22px; }
}
