/* ══════════════════════════════════════════════════
   Auth Pages — Login split-layout + centered variant
   ══════════════════════════════════════════════════
 *
 * NOTA ARQUITECTÓNICA — Auth tiene su propio mini design system:
 * Las views auth/* extienden layouts/guest.blade.php que SOLO carga este auth.css
 * (no carga tokens.css ni el resto del DS principal). Por eso usan clases auth-*
 * (.auth-input, .auth-card, .auth-submit, .auth-code-input, etc.) en lugar de
 * los componentes <x-form-field> / <x-page-header> del sistema principal.
 *
 * Excepción: two-factor-setup.blade.php SÍ usa layouts/app.blade.php (DS principal)
 * porque el usuario ya está autenticado cuando configura 2FA.
 *
 * Este archivo es self-contained: no asume que tokens.css está cargado.
 */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-layout { display: flex; min-height: 100vh; }

/* ── Left Panel — Branding ── */

.auth-brand {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        160deg,
        color-mix(in srgb, var(--secondary, #1F2937) 90%, black) 0%,
        var(--secondary, #1F2937) 40%,
        color-mix(in srgb, var(--secondary, #1F2937) 70%, var(--primary, #DC2626)) 100%
    );
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand::before {
    top: -30%; right: -20%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary, #DC2626) 8%, transparent) 0%, transparent 70%);
}

.auth-brand::after {
    bottom: -20%; left: -10%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary, #DC2626) 6%, transparent) 0%, transparent 70%);
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
    color: #F9FAFB;
}

.auth-brand-logo { margin-bottom: 2rem; }
.auth-brand-logo img { height: 64px; width: auto; filter: brightness(0) invert(1); }

.auth-brand-wordmark {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: #FFFFFF;
}

.auth-brand-tagline {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

.auth-brand-features { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }

.auth-brand-feature {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
}

.auth-brand-feature i,
.auth-brand-feature svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--primary, #DC2626); opacity: 0.9; }

.auth-brand-copyright {
    position: absolute;
    bottom: 2rem; left: 2rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}

/* ── Right Panel — Form ── */

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    padding: 3rem 2rem;
}

.auth-form-wrapper { width: 100%; max-width: 400px; }

.auth-form-logo { display: none; text-align: center; margin-bottom: 1.5rem; }
.auth-form-logo img { height: 48px; width: auto; }

.auth-form-header { margin-bottom: 2rem; }
.auth-form-header h2 { font-size: 1.5rem; font-weight: 700; color: #111827; margin-bottom: 0.375rem; }
.auth-form-header p { font-size: 0.9375rem; color: #6B7280; }

/* ── Form Elements ── */

.auth-input-group { margin-bottom: 1.25rem; }
.auth-input-group label { display: block; font-weight: 500; font-size: 0.875rem; color: #374151; margin-bottom: 0.5rem; }

.auth-input-group .auth-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.auth-input-group .auth-label-row label { margin-bottom: 0; }
.auth-input-group .auth-label-row a { font-size: 0.8125rem; color: var(--primary, #DC2626); text-decoration: none; font-weight: 500; }
.auth-input-group .auth-label-row a:hover { text-decoration: underline; }

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #D1D5DB;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #111827;
    background: #FFFFFF;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary, #DC2626);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #DC2626) 15%, transparent);
}

.auth-input::placeholder { color: #9CA3AF; }

/* Password toggle */
.auth-password-wrapper { position: relative; }
.auth-password-wrapper .auth-input { padding-right: 3rem; }

.auth-password-toggle {
    position: absolute;
    right: 0.75rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; padding: 0.25rem;
    color: #9CA3AF;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s;
}

.auth-password-toggle:hover { color: #6B7280; }
.auth-password-toggle i,
.auth-password-toggle svg { width: 18px; height: 18px; }

/* Remember me */
.auth-remember { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.auth-remember input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--primary, #DC2626); cursor: pointer; }
.auth-remember label { font-size: 0.875rem; color: #6B7280; cursor: pointer; }

/* Submit */
.auth-submit {
    width: 100%;
    padding: 0.8125rem 1.5rem;
    background: var(--primary, #DC2626);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: inherit;
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.auth-submit:hover {
    background: color-mix(in srgb, var(--primary, #DC2626) 85%, black);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary, #DC2626) 25%, transparent);
}

.auth-submit:active { transform: translateY(0); }

/* ── Messages ── */

.auth-error {
    background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B;
    padding: 0.75rem 1rem; border-radius: 0.5rem;
    margin-bottom: 1.25rem; font-size: 0.875rem; line-height: 1.5;
}

.auth-success {
    background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534;
    padding: 0.75rem 1rem; border-radius: 0.5rem;
    margin-bottom: 1.25rem; font-size: 0.875rem; line-height: 1.5;
}

/* ── Links, Footer, Install ── */

.auth-link { text-align: center; margin-top: 1.25rem; }
.auth-link a { font-size: 0.875rem; color: var(--primary, #DC2626); text-decoration: none; font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }

.auth-footer {
    margin-top: 2.5rem; padding-top: 1.25rem;
    border-top: 1px solid #E5E7EB;
    text-align: center; font-size: 0.75rem; color: #9CA3AF; line-height: 1.6;
}

.auth-footer span { display: block; }

.auth-install-prompt { text-align: center; margin-top: 1rem; }
.auth-install-prompt p { font-size: 0.75rem; color: #D1D5DB; }

/* ══════════════════════════════════════════════════
   Centered Variant — forgot, reset, 2FA
   ══════════════════════════════════════════════════ */

.auth-centered {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #111827 0%, var(--secondary, #1F2937) 50%, var(--primary, #DC2626) 100%);
    padding: 1rem;
}

.auth-card {
    width: 100%; max-width: 420px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.auth-card-header { text-align: center; margin-bottom: 1.5rem; }
.auth-card-header i,
.auth-card-header svg { width: 40px; height: 40px; color: var(--primary, #DC2626); margin-bottom: 0.75rem; }
.auth-card-header h2 { font-size: 1.25rem; font-weight: 700; color: #111827; margin-bottom: 0.25rem; }
.auth-card-header p { font-size: 0.875rem; color: #6B7280; }

.auth-card .auth-link { margin-top: 1.5rem; }

/* ══════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .auth-layout:not(.auth-centered) { flex-direction: column; }

    .auth-brand { flex: none; padding: 2.5rem 2rem 2rem; }
    .auth-brand-inner { max-width: 100%; text-align: center; }
    .auth-brand-logo { margin-bottom: 1rem; }
    .auth-brand-logo img { height: 48px; }
    .auth-brand-wordmark { font-size: 1.75rem; }
    .auth-brand-tagline { margin-bottom: 0; font-size: 0.9375rem; }
    .auth-brand-features,
    .auth-brand-copyright,
    .auth-brand::before,
    .auth-brand::after { display: none; }

    .auth-form-panel { flex: 1; padding: 2rem 1.5rem; align-items: flex-start; }
    .auth-form-logo { display: block; }
    .auth-card { padding: 2rem 1.5rem; }
}

@media (max-width: 480px) {
    .auth-brand { padding: 2rem 1.5rem 1.5rem; }
    .auth-brand-wordmark { font-size: 1.5rem; }
    .auth-form-panel { padding: 1.5rem 1.25rem; }
    .auth-form-header h2 { font-size: 1.25rem; }
    .auth-card { padding: 1.75rem 1.25rem; border-radius: 1rem; }
    .auth-footer { margin-top: 2rem; }
}

/* ──────────────────────────────────────────────
 * 2FA Challenge — input de código de 6 dígitos
 * ────────────────────────────────────────────── */

.auth-code-input {
    text-align: center;
    font-family: 'SF Mono', Menlo, Monaco, 'Courier New', monospace;
    font-size: 1.5rem;
    letter-spacing: 0.5em;
}
