/* =============================================================
   Login.css — SRBSGC Centralized Portal Login Page Styles
   Section order mirrors Login.php layout:
     1.  Page Layout & Background
     2.  Decorative Background Shapes
     3.  Login Container (split card)
     4.  Left Panel — Branding
     5.  Right Panel — Form Shell
     6.  Form Header (icon, title, subtitle)
     7.  Server-Side Error Alert
     8.  Input Fields
     9.  Login Button
     10. Divider & Help Text
     11. Login Footer
     12. Responsive Design
   ============================================================= */


/* =============================================================
   1. PAGE LAYOUT & BACKGROUND
   ============================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0c2e3f 0%, var(--charcoal) 50%, var(--primary-teal-dark) 100%);
    position: relative;
    overflow: hidden;
    padding: 1rem;
}


/* =============================================================
   2. DECORATIVE BACKGROUND SHAPES
   Three softly animated circles add depth to the background.
   ============================================================= */

.bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
}

/* Top-right: gold glow */
.bg-circle-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-gold);
    top: -200px;
    right: -150px;
    animation: floatCircle 20s ease-in-out infinite;
}

/* Bottom-left: teal glow */
.bg-circle-2 {
    width: 500px;
    height: 500px;
    background: var(--primary-teal);
    bottom: -180px;
    left: -120px;
    animation: floatCircle 25s ease-in-out infinite reverse;
}

/* Center: maroon glow */
.bg-circle-3 {
    width: 350px;
    height: 350px;
    background: var(--secondary-maroon);
    top: 50%;
    left: 50%;
    animation: floatCircleCenter 18s ease-in-out infinite;
}

@keyframes floatCircle {
    0%,  100% { transform: translate(0, 0) scale(1); }
    25%        { transform: translate(30px, -20px) scale(1.05); }
    50%        { transform: translate(-20px, 30px) scale(0.95); }
    75%        { transform: translate(10px, 15px) scale(1.02); }
}

@keyframes floatCircleCenter {
    0%,  100% { transform: translate(-50%, -50%) scale(1); }
    25%        { transform: translate(-45%, -55%) scale(1.05); }
    50%        { transform: translate(-55%, -45%) scale(0.95); }
    75%        { transform: translate(-48%, -52%) scale(1.02); }
}


/* =============================================================
   3. LOGIN CONTAINER (Split Card)
   ============================================================= */

.login-container {
    display: flex;
    width: 100%;
    max-width: 880px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
}


/* =============================================================
   4. LEFT PANEL — BRANDING & WELCOME
   ============================================================= */

.login-branding {
    flex: 0 0 42%;
    background: linear-gradient(160deg, var(--primary-teal) 0%, var(--primary-teal-dark) 60%, #033d40 100%);
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

/* Subtle overlay pattern on the branding panel */
.login-branding::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(232, 165, 32, 0.12) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(139, 26, 50, 0.08)  0%, transparent 50%);
    pointer-events: none;
}

/* College logo */
.branding-logo {
    position: relative;
    z-index: 1;
    margin-bottom: 1.25rem;
}

.branding-logo img {
    width: 56px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition-normal);
}

.branding-logo img:hover {
    transform: scale(1.05) rotate(-2deg);
}

/* Welcome text */
.branding-text {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
}

.branding-title {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 0.4rem;
    letter-spacing: -0.5px;
}

.branding-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    font-weight: 400;
}

/* Quick info badges */
.branding-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.feature-item:hover {
    color: var(--accent-gold);
    transform: translateX(4px);
}

.feature-item i {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--accent-gold);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.feature-item:hover i {
    background: rgba(232, 165, 32, 0.2);
    transform: scale(1.1);
}


/* =============================================================
   5. RIGHT PANEL — FORM SHELL
   ============================================================= */

.active-session-warning {
    background: var(--off-white);
    border: 2px solid var(--accent-gold);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 1rem;
}
.warning-icon {
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 1rem;
}
.warning-title {
    color: var(--charcoal);
    margin-bottom: 1rem;
}
.warning-text {
    color: var(--gray);
    margin-bottom: 1.5rem;
}
.warning-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-direction: column;
}
.force-logout-btn {
    background: var(--secondary-maroon) !important;
    text-decoration: none;
    text-align: center;
    display: block;
}

.login-form-panel {
    flex: 1;
    padding: 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
    position: relative;
}


/* =============================================================
   6. FORM HEADER (icon, title, subtitle)
   ============================================================= */

.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.875rem;
    background: linear-gradient(135deg, var(--secondary-maroon) 0%, var(--secondary-maroon-dark) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
    box-shadow: 0 6px 18px rgba(139, 26, 50, 0.3);
    transition: transform var(--transition-bounce);
}

.form-icon:hover {
    transform: scale(1.1) rotate(-5deg);
}

.form-title {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
}

.form-subtitle {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 400;
}


/* =============================================================
   7. SERVER-SIDE ERROR ALERT
   Shown when ?error= param is set (e.g. invalid, timeout, security).
   Injected by Login.php above the form; fades in on appearance.
   ============================================================= */

.server-error-alert {
    background: #fee2e2;
    color: #b91c1c;
    border-left: 4px solid #ef4444;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: fadeInAlert 0.3s ease-out;
}

@keyframes fadeInAlert {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* =============================================================
   8. INPUT FIELDS
   ============================================================= */

.input-group {
    margin-bottom: 1.125rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.375rem;
}

.input-label i {
    color: var(--secondary-maroon);
    font-size: 0.8rem;
}

.input-wrapper {
    position: relative;
}

.input-field {
    width: 100%;
    padding: 0.7rem 0.875rem;
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    color: var(--charcoal);
    background: var(--off-white);
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    outline: none;
    transition: all var(--transition-fast);
}

.input-field::placeholder {
    color: var(--gray);
    font-weight: 400;
}

.input-field:focus {
    border-color: var(--secondary-maroon);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(139, 26, 50, 0.1);
}

/* Animated underline on focus */
.input-focus-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-secondary);
    border-radius: 0 0 10px 10px;
    transition: all var(--transition-normal);
}

.input-field:focus ~ .input-focus-line {
    width: 100%;
    left: 0;
}

/* Error state for invalid input */
.input-group.error .input-field {
    border-color: #c0392b;
    background: #fef2f2;
}

.input-group.error .input-field:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

/* Per-field inline error message */
.input-error {
    display: block;
    font-size: 0.73rem;
    color: #c0392b;
    margin-top: 0.25rem;
    min-height: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
}

.input-group.error .input-error {
    opacity: 1;
    transform: translateY(0);
}


/* =============================================================
   9. LOGIN BUTTON
   ============================================================= */

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--secondary-maroon) 0%, var(--secondary-maroon-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    position: relative;
    overflow: hidden;
    margin-top: 0.25rem;
    box-shadow: 0 5px 16px rgba(139, 26, 50, 0.35);
    transition: all var(--transition-normal);
}

/* Shimmer sweep on hover */
.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.login-btn:hover::before { left: 100%; }

.login-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(139, 26, 50, 0.45); }
.login-btn:active { transform: translateY(0);    box-shadow: 0 3px 12px rgba(139, 26, 50, 0.3); }

/* Arrow icon slides right on hover */
.btn-arrow { transition: transform var(--transition-fast); }
.login-btn:hover .btn-arrow { transform: translateX(4px); }

/* Loading state — shown while JS submits the hidden form */
.btn-loader {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.login-btn.loading .btn-text   { opacity: 0; }
.login-btn.loading .btn-arrow  { display: none; }
.login-btn.loading .btn-loader { display: block; }


/* =============================================================
   10. DIVIDER & HELP TEXT
   ============================================================= */

.form-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--light-gray);
}

.form-divider span {
    padding: 0 0.75rem;
    font-size: 0.7rem;
    color: var(--gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-help { text-align: center; }

.form-help p {
    font-size: 0.78rem;
    color: var(--gray);
    line-height: 1.5;
}


/* =============================================================
   11. LOGIN FOOTER
   ============================================================= */

.login-footer {
    position: relative;
    z-index: 1;
    margin-top: 1.25rem;
    text-align: center;
}

.login-footer p {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
    letter-spacing: 0.3px;
}


/* =============================================================
   12. RESPONSIVE DESIGN
   ============================================================= */

/* Tablet: stack branding above form */
@media (max-width: 900px) {

    .login-container {
        flex-direction: column;
        max-width: 420px;
    }

    .login-branding {
        padding: 1.75rem 1.5rem 1.25rem;
        align-items: center;
        text-align: center;
    }

    .branding-logo img { width: 48px; }
    .branding-title    { font-size: 1.25rem; }
    .branding-text     { margin-bottom: 1rem; }

    .branding-features {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .feature-item     { font-size: 0.75rem; }
    .login-form-panel { padding: 1.75rem 1.5rem; }
}

/* Mobile */
@media (max-width: 600px) {

    .login-page       { padding: 0.75rem; }
    .login-container  { border-radius: 16px; }
    .login-branding   { padding: 1.5rem 1.25rem 1rem; }

    .branding-logo img  { width: 44px; }
    .branding-title     { font-size: 1.15rem; }
    .branding-subtitle  { font-size: 0.8rem; }

    .feature-item i {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    .login-form-panel { padding: 1.5rem 1.25rem; }

    .form-icon {
        width: 42px;
        height: 42px;
        font-size: 1rem;
        margin-bottom: 0.625rem;
    }

    .form-title  { font-size: 1.2rem; }
    .login-btn   { padding: 0.7rem; }
}

/* Very small screens */
@media (max-width: 380px) {

    .branding-features {
        flex-direction: column;
        align-items: center;
    }

    .login-branding   { padding: 1.25rem 1rem 0.875rem; }
    .login-form-panel { padding: 1.25rem 1rem; }
}
