/* ============================================================
 * login.css — Página pública de inicio de sesión
 * G1 v1.2 — refactor de login.php (Lote 15)
 *
 * Cromática: azul corporativo (--color-blue-*) + cyan en el
 * gradient del header. Toda la página es coherente con el
 * sistema de tokens canónicos. Excepción: 4 hex de Google
 * brand identity (mantenidos inline en el SVG de login.php).
 * ============================================================ */

/* ============================================================
 * 1. PAGE LAYOUT
 * ============================================================ */
body {
    background: linear-gradient(135deg,
        var(--color-blue-50) 0%,
        var(--bg-body) 50%,
        var(--color-blue-50) 100%);
    display: flex;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.login-container {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
}

/* ============================================================
 * 2. LOGIN CARD
 * ============================================================ */
.login-card {
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

/* ============================================================
 * 3. HEADER (banner azul→cyan con animación de fondo)
 * ============================================================ */
.login-header {
    background: linear-gradient(135deg,
        var(--color-blue-700) 0%,
        var(--color-cyan) 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 70%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(20px, -20px) rotate(5deg); }
}

.login-header h2 {
    position: relative;
    z-index: 1;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    position: relative;
    z-index: 1;
    opacity: 0.9;
    margin-bottom: 0;
}

/* ============================================================
 * 4. BODY
 * ============================================================ */
.login-body {
    padding: 40px;
}

.login-body h4 {
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================
 * 5. FORM CONTROLS
 * ============================================================ */
.form-label {
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid var(--border-light);
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--color-blue-500);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-check-input:checked {
    background-color: var(--color-blue-500);
    border-color: var(--color-blue-500);
}

.form-check-label {
    color: var(--text-secondary);
}

/* ============================================================
 * 6. PRIMARY BUTTON
 * ============================================================ */
.btn-primary {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background: var(--color-blue-700);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 86, 163, 0.3);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============================================================
 * 7. PASSWORD TOGGLE
 * ============================================================ */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    z-index: 10;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: var(--color-blue-500);
}

.position-relative {
    position: relative;
}

/* ============================================================
 * 8. HOME LINK + REGISTER PROMPT
 * ============================================================ */
.home-link {
    text-align: center;
    margin-top: 20px;
}

.home-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.home-link a:hover {
    color: var(--color-blue-500);
}

.register-prompt {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.register-prompt a {
    color: var(--color-blue-500);
    font-weight: 600;
}

.register-prompt a:hover {
    color: var(--color-blue-700);
}

/* ============================================================
 * 9. STATUS INFO BOX
 * ============================================================ */
.status-info {
    background: var(--bg-blue-soft);
    border-left: 4px solid var(--color-blue-400);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 12px;
}

.status-info h6 {
    margin-bottom: 10px;
    color: var(--color-blue-500);
    font-weight: 700;
}

.status-info ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.status-info li {
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.status-info a {
    color: var(--color-blue-500);
    font-weight: 600;
}

/* ============================================================
 * 10. ALERTS
 * ============================================================ */
.alert {
    border-radius: 12px;
    border: none;
}

.alert-danger {
    background: linear-gradient(135deg,
        var(--color-danger-soft),
        var(--color-danger-soft));
    color: var(--color-danger-dark);
}

.alert-success {
    background: linear-gradient(135deg,
        var(--color-success-soft),
        var(--color-success-soft));
    color: var(--color-success-dark);
}

.alert-warning {
    background: linear-gradient(135deg,
        var(--color-warning-soft),
        var(--color-warning-soft));
    color: var(--color-warning-dark);
}

.alert a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

.alert a:hover {
    text-decoration: none;
}

/* ============================================================
 * 11. LOCKOUT WARNING (rate limit)
 * ============================================================ */
.lockout-warning {
    background: linear-gradient(135deg,
        var(--color-warning-soft),
        var(--color-warning-soft));
    border-left: 4px solid var(--color-warning);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 12px;
    text-align: center;
}

.lockout-warning i {
    font-size: 2rem;
    color: var(--color-warning);
    margin-bottom: 10px;
}

.lockout-warning h6 {
    color: var(--color-warning-dark);
    font-weight: 700;
    margin-bottom: 5px;
}

.lockout-warning p {
    color: var(--color-warning-dark);
    margin-bottom: 0;
}

/* Helper: hidden lockout (replaces inline display:none from JS) */
.lockout-warning--hidden {
    display: none !important;
}

#countdown {
    font-weight: 700;
    font-size: 1.2rem;
}

/* ============================================================
 * 12. GOOGLE SIGN-IN BUTTON
 *
 * Note: el SVG inline en login.php usa los 4 colores oficiales
 * de Google brand identity (#4285F4, #34A853, #FBBC05, #EA4335)
 * que NO son parte del sistema de tokens. Son brand guidelines
 * inmutables de Google. El botón en sí (fondo, borde, texto)
 * sí usa tokens canónicos.
 * ============================================================ */
.google-login-section {
    text-align: center;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-google:hover {
    background: var(--bg-body);
    border-color: var(--border-light);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-google svg {
    flex-shrink: 0;
}

.divider-text {
    display: flex;
    align-items: center;
    margin: 20px 0 0 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider-text span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
