/**
 * auth.css — Layout and form styles for login.php and register.php
 * Loaded only by those two pages; never affects the rest of the site.
 *
 * login.php   → .auth-split   (two-column: brand panel + form panel)
 * register.php → .auth-col    (centred single column)
 */

/* ===== STICKY-FOOTER LAYOUT ===== */
body.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Compact footer on auth pages — doesn't steal vertical space */
body.auth-page .footer {
    margin-top: 0;
    flex-shrink: 0;
    padding: 0.6rem 0 0.4rem;
}

body.auth-page .footer .mb-3      { margin-bottom: 0.35rem; }
body.auth-page .footer .footer-bottom {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
}

/* ===== MAIN AREA ===== */
/* Background with clearly visible blurred colour blobs */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 1.25rem 0 1.5rem;
    position: relative;
    overflow: hidden;
    background: #f0f4ff;   /* azul-indigo muy suave, claramente visible */
}

/* Top-left decorative blob */
.auth-main::before {
    content: '';
    position: absolute;
    top: -80px;
    left: -80px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.22);
    filter: blur(80px);
    pointer-events: none;
}

/* Bottom-right decorative blob */
.auth-main::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -60px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.18);
    filter: blur(70px);
    pointer-events: none;
}

.auth-main .container {
    width: 100%;
    position: relative;
    z-index: 1;   /* encima de los blobs */
}

/* Tighter mb-3 spacing inside auth forms */
.auth-main .mb-3 { margin-bottom: 0.65rem; }

/* ===== SPLIT LAYOUT (login.php) ===== */
.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 68vh;
    max-width: 860px;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(99, 102, 241, 0.22);
}

/* --- Left panel: gradient branding area --- */
.auth-panel-left {
    background: var(--primary-gradient);
    padding: 2.75rem 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Decorative circles inside the left branding panel */
.auth-panel-left::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.auth-panel-left::after {
    content: '';
    position: absolute;
    bottom: -70px;
    left: -40px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
}

.auth-panel-content {
    position: relative;
    z-index: 1;
}

.auth-brand {
    font-size: 1.55rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.auth-brand:hover { opacity: 0.9; color: white; }

.auth-brand i { font-size: 1.75rem; }

.auth-panel-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.65rem;
    line-height: 1.25;
}

.auth-panel-sub {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 1.75rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9rem;
}

.auth-features li i {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* --- Right panel: form area --- */
.auth-panel-right {
    background: #ffffff;
    padding: 2.25rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Form heading inside the right panel */
.auth-form-header {
    margin-bottom: 1.25rem;
}

.auth-form-header h3 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.auth-form-header p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Register: narrower left panel to give the form more room */
.auth-split-register {
    max-width: 960px;
    grid-template-columns: 2fr 3fr;
}

/* Responsive split → stacked vertically on mobile */
@media (max-width: 700px) {
    .auth-split,
    .auth-split-register {
        grid-template-columns: 1fr;
        min-height: auto;
        max-width: 480px;
    }

    .auth-panel-left {
        padding: 1.5rem 1.75rem;
    }

    .auth-features { display: none; }   /* hide feature list on mobile to save space */

    .auth-panel-title { font-size: 1.25rem; margin-bottom: 0.35rem; }
    .auth-panel-sub   { font-size: 0.87rem; margin-bottom: 0; }
    .auth-brand       { margin-bottom: 0.75rem; }
}

/* ===== CENTRED SINGLE-COLUMN LAYOUT (reserved for future use) ===== */
.auth-col {
    margin: 0 auto;
    width: 100%;
}

/* ===== FORM STYLES (shared by login and register) ===== */
.auth-main .form-group,
.auth-panel-right .form-group {
    margin-bottom: 0.7rem;
}

.auth-main .form-label,
.auth-panel-right .form-label {
    font-size: 0.87rem;
    margin-bottom: 0.18rem;
}

.auth-main .form-control,
.auth-panel-right .form-control {
    padding: 0.5rem 0.8rem;
    font-size: 0.92rem;
}

.auth-main .form-help,
.auth-panel-right .form-help {
    font-size: 0.76rem;
    margin-top: 0.1rem;
}

/* Submit button */
.auth-main .btn-block,
.auth-panel-right .btn-block {
    padding: 0.62rem var(--space-xl);
    font-size: 0.95rem;
}

/* Reduced Bootstrap column gutter for register form rows */
.auth-main .row { --bs-gutter-x: 0.75rem; }

/* ===== DIVIDER ("or") ===== */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 0.85rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    position: relative;
    z-index: 1;
    background: #ffffff;
    padding: 0 0.9rem;
    color: var(--text-light);
    font-size: 0.87rem;
}

/* In register the card background is bg-primary rather than pure white */
.auth-main .card-body .auth-divider span {
    background: var(--bg-primary);
}

/* ===== TERMS CHECKBOX (register) ===== */
.auth-terms {
    margin-bottom: 0.75rem;
    font-size: 0.87rem;
}

/* ===== BACK LINK ===== */
.auth-back {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.87rem;
}

/* ===== PANEL SWITCH (login ↔ forgot password) ===== */
.auth-panel-wrapper {
    width: 100%;
}
.auth-panel-wrapper.panel-hidden {
    display: none !important;
}

/* ===== PASSWORD STRENGTH INDICATOR ===== */
.pw-field-wrapper {
    position: relative;
}

/* Info icon next to the label */
.pw-info-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: var(--primary, #6366f1);
    margin-left: 6px;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Requirements popup */
.pw-requirements-popup {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: var(--bg-secondary, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    width: 290px;
    min-width: 290px;
    z-index: 100;
    font-size: 0.82rem;
    white-space: normal;
    word-break: keep-all;
}
.pw-info-trigger:hover .pw-requirements-popup,
.pw-info-trigger:focus .pw-requirements-popup,
.pw-info-trigger.open .pw-requirements-popup {
    display: block;
}
.pw-requirements-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border, #e5e7eb);
}
.pw-requirements-popup ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pw-requirements-popup li {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
    color: var(--text-secondary, #6b7280);
    transition: color 0.2s;
}
.pw-requirements-popup li.req-ok {
    color: #22c55e;
}
.pw-requirements-popup li.req-ok .pw-req-icon::before {
    content: '\f058'; /* fa-check-circle */
}
.pw-requirements-popup li .pw-req-icon {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.pw-requirements-popup li .pw-req-icon::before {
    content: '\f111'; /* fa-circle */
    opacity: 0.4;
}

/* Strength bar beneath the password input */
.pw-strength-bar-wrap {
    height: 4px;
    background: var(--border, #e5e7eb);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.pw-strength-bar {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

/* ===== LOCKOUT COUNTDOWN BADGE ===== */
.lockout-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    width: 100%;
}
