/*
 * auth.css
 * ------------------------------------------------------------
 * Estilos modernos para pantallas de login y de instalación.
 * Diseño: full-screen con card centrada, gradient sutil,
 * inputs grandes, spacing generoso. Mobile-first.
 * ------------------------------------------------------------
 */

.auth-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(23,23,23,0.05), transparent 60%),
        radial-gradient(800px 400px at 110% 110%, rgba(23,23,23,0.04), transparent 60%),
        linear-gradient(180deg, #fafafa 0%, #f3f3f3 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 20px 50px -20px rgba(0,0,0,0.15),
                0 6px 15px -6px rgba(0,0,0,0.08);
    padding: 2.5rem;
    animation: auth-fade-in 300ms ease;
}

.auth-card--wide {
    max-width: 560px;
}

@keyframes auth-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

.auth-brand__logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--color-primary);
    color: var(--color-primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.auth-card .auth-subtitle {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}

/* ==========================================================
   Inputs modernos (solo en pantallas de auth)
   ========================================================== */
.auth-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.1rem;
    min-width: 0;
}

.auth-field:last-child { margin-bottom: 0; }

.auth-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 0 0.9rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    margin: 0;
    box-shadow: none;
}

.auth-field input::placeholder { color: var(--color-text-subtle); }

.auth-field input:hover {
    border-color: var(--color-border-strong);
}

.auth-field input:focus {
    outline: none;
    border-color: var(--color-text);
    box-shadow: 0 0 0 3px rgba(23,23,23,0.08);
}

.auth-field__hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Wrapper para input + botón (toggle de password, etc.) */
.auth-field__control {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.auth-field__control input { flex: 1 1 auto; min-width: 0; }

/* Reservar espacio a la derecha para el toggle */
.auth-field--password .auth-field__control input { padding-right: 4rem; }

.auth-field__toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 6px;
    line-height: 1;
}
.auth-field__toggle:hover { color: var(--color-text); background: var(--color-bg-hover); }
.auth-field__toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(23,23,23,0.15);
}

/* ==========================================================
   Submit full-width
   ========================================================== */
.auth-submit {
    width: 100%;
    height: 46px;
    padding: 0 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 0.75rem;
    border-radius: 10px;
}

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-align: center;
}

.auth-footer a { color: var(--color-text-muted); }

/* ==========================================================
   Alerts (override más suave en auth)
   ========================================================== */
.auth-alert {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.auth-alert--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert--success {
    background: #f0fdf4;
    color: #14532d;
    border: 1px solid #bbf7d0;
}

.auth-alert--info {
    background: #f5f5f5;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

/* ==========================================================
   Instalador: stepper + fieldsets
   ========================================================== */
.auth-steps {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.auth-step {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-step__dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--color-border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--color-bg);
    color: var(--color-text-muted);
    flex: 0 0 auto;
    line-height: 1;
}

.auth-step--active {
    color: var(--color-text);
    font-weight: 600;
}

.auth-step--active .auth-step__dot {
    background: var(--color-primary);
    color: var(--color-primary-text);
    border-color: var(--color-primary);
}

.auth-step__sep {
    flex: 0 0 1.75rem;
    height: 1px;
    background: var(--color-border);
}

.auth-fieldset {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem 1.25rem;
    margin: 0 0 1.25rem;
    background: var(--color-bg-alt);
}

.auth-fieldset legend {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--color-text-muted);
    padding: 0 0.4rem;
    margin: 0;
}

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem 1rem;
    align-items: start;
}

@media (max-width: 560px) {
    .auth-card { padding: 1.75rem 1.25rem; border-radius: 14px; }
    .auth-grid-2 { grid-template-columns: 1fr; gap: 0; }
    .auth-fieldset { padding: 1rem 1rem 1.1rem; }
}

/* ==========================================================
   Pantalla "done" del instalador
   ========================================================== */
.auth-done__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f0fdf4;
    color: #15803d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.8rem;
    border: 1px solid #bbf7d0;
}

.auth-done__center { text-align: center; }
