/**
 * @path /public/css/login.css
 * @description Diseño Minimalista y Profesional para sistema de autenticación.
 */
:root {
    --login-bg: #122c45;
    /* Color corporativo principal como fondo */
    --login-card-bg: #ffffff;
    --login-text-main: #1e293b;
    --login-text-sub: #64748b;
    --login-accent: #b05232;
    /* Terracotta para botones/acciones */
    --login-border: #e2e8f0;
    --login-input-bg: #f8fafc;

    --shadow-card: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-input: 0 1px 2px 0 rgb(0 0 0 / 0.05);

    --radius-card: 24px;
    --radius-input: 12px;
}

body.login {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--login-bg);
    /* Patrón sutil opcional o gradiente muy suave */
    background-image: radial-gradient(circle at top right, rgba(255, 255, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(36, 104, 109, 0.2) 0%, transparent 40%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    margin: 0;
}

.login-container {
    width: 100%;
    max-width: 440px;
    /* Ancho cómodo para lectura */
}

/* === Tarjeta Principal === */
.login-card {
    background: var(--login-card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    padding: 48px 40px;
    text-align: center;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Header / Branding === */
.login-header {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* El icono ya tiene estilos inline para el fondo blanco, aquí ajustamos su posición si hace falta */
.brand-icon {
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.brand-icon:hover {
    transform: scale(1.05);
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--login-text-main);
    margin: 0;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 14px;
    color: var(--login-text-sub);
    margin: 0;
    font-weight: 400;
}

/* === Alertas === */
.login-alert,
.alert-success {
    padding: 16px;
    border-radius: var(--radius-input);
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    line-height: 1.5;
}

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

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.login-alert .material-icons {
    color: #dc2626;
    font-size: 20px;
}

.alert-success .material-icons {
    color: #059669;
    font-size: 20px;
}

/* === Formulario === */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--login-text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label .material-icons {
    font-size: 16px;
    color: var(--login-text-sub);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--login-input-bg);
    border: 1px solid transparent;
    /* Sin borde por defecto para look limpio */
    border-radius: var(--radius-input);
    font-size: 15px;
    color: var(--login-text-main);
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.form-control:focus {
    background: white;
    border-color: var(--login-accent);
    outline: none;
    box-shadow: 0 0 0 4px rgba(176, 82, 50, 0.1);
}

.form-control::placeholder {
    color: #cbd5e1;
}

/* Password Input Wrapper */
.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    color: var(--login-text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--login-text-main);
}

/* === Botones === */
.login-button {
    width: 100%;
    padding: 16px;
    background: var(--login-accent);
    color: white;
    border: none;
    border-radius: var(--radius-input);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(176, 82, 50, 0.2);
    margin-top: 8px;
}

.login-button:hover {
    background: #9a462b;
    /* Slightly darker accent */
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(176, 82, 50, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* === Links === */
.form-text {
    font-size: 13px;
    color: var(--login-accent);
    text-decoration: none;
    font-weight: 500;
}

.form-text:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--login-text-sub);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.back-link:hover {
    background: #f1f5f9;
    color: var(--login-text-main);
}

/* === Footer === */
.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--login-border);
}

.footer-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--login-text-sub);
    font-size: 12px;
}

.footer-info .material-icons {
    font-size: 14px;
}

/* ============================================================
   === Estilos 2FA (challenge.twig & setup.twig) ===
   ============================================================ */

/* Ícono decorativo de escudo (challenge) */
.twofa-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.twofa-shield-icon {
    font-size: 56px;
    color: var(--login-accent);
    background: rgba(176, 82, 50, 0.08);
    border-radius: 50%;
    padding: 16px;
    display: block;
    animation: shieldPulse 2.4s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(176, 82, 50, 0.15); }
    50%       { box-shadow: 0 0 0 12px rgba(176, 82, 50, 0); }
}

/* Texto descriptivo 2FA */
.twofa-description {
    font-size: 14px;
    color: var(--login-text-sub);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.6;
}

/* Input estilo grande centrado para el PIN */
.twofa-code-input {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 10px;
    padding: 16px 20px;
}

.twofa-code-input::placeholder {
    letter-spacing: 8px;
    font-weight: 400;
    font-size: 22px;
    color: #cbd5e1;
}

/* Hint de expiración */
.twofa-hint {
    font-size: 12px;
    color: var(--login-text-sub);
    text-align: center;
    margin-top: 6px;
    display: block;
}

/* Badge de acción requerida (setup) */
.twofa-required-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 28px;
    width: 100%;
    justify-content: center;
}

.twofa-required-badge .material-icons {
    font-size: 18px;
    color: #ea580c;
}

/* Pasos numerados */
.twofa-step {
    margin-bottom: 28px;
}

.twofa-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.twofa-step-number {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--login-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.twofa-step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--login-text-main);
}

.twofa-step-desc {
    font-size: 13px;
    color: var(--login-text-sub);
    line-height: 1.6;
    margin-bottom: 16px;
    padding-left: 40px;
}

/* Código QR */
.twofa-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 12px 0;
    padding-left: 40px;
}

.twofa-qr-img {
    width: 180px;
    height: 180px;
    border: 2px solid var(--login-border);
    border-radius: 12px;
    padding: 8px;
    background: #fff;
}

/* Caja del secreto de recuperación */
.twofa-secret-box {
    background: #f8fafc;
    border: 1px dashed var(--login-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 28px;
    text-align: center;
}

.twofa-secret-header {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--login-text-sub);
    margin-bottom: 10px;
}

.twofa-secret-header .material-icons {
    font-size: 16px;
    color: var(--login-accent);
}

.twofa-secret-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--login-text-main);
    background: #fff;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    padding: 10px 16px;
    word-break: break-all;
    margin-bottom: 12px;
}

.twofa-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--login-text-sub);
    cursor: pointer;
    transition: all 0.2s ease;
}

.twofa-copy-btn:hover {
    background: #f1f5f9;
    border-color: var(--login-accent);
    color: var(--login-accent);
}

.twofa-copy-btn .material-icons {
    font-size: 15px;
}

/* Animación de carga (spinning icon) */
.spin-icon {
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}