/* ============================================
   LOGIN PAGE - MODERN CENTERED CARD DESIGN
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================
   GLOBAL STYLES
   ============================================ */
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #f2f5f9;
}

/* ============================================
   LAYOUT WRAPPER
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
    padding-top: 36vh;
    gap: 48px;
    position: relative;
    overflow: hidden;
    background: #eef2f7;
}

/* Soft background image layer */
.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('/Image/CLGGT.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    filter: none;
    transform: none;
    opacity: 1;
}

/* Readability overlay */
.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.20);
}


.login-container {
    width: 100%;
    max-width: 420px;
    z-index: 10;
    position: relative;
    margin-top: 0;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   LOGIN CARD
   ============================================ */
.login-card {
    width: 100%;
    border-radius: 18px;
    padding: 32px;
    background: linear-gradient(180deg, rgba(191, 219, 254, 0.92) 0%, rgba(239, 246, 255, 0.94) 55%, rgba(255, 255, 255, 0.92) 100%);
    backdrop-filter: none;
    border: 1px solid rgba(185, 28, 28, 0.22);
    box-shadow:
        0 28px 70px rgba(15, 23, 42, 0.32),
        0 3px 0 rgba(255, 255, 255, 0.60) inset;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    margin-top: 42px;
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
}

/* ============================================
   CARD HEADER
   ============================================ */
.login-header {
    margin-bottom: 24px;
    text-align: center;
    padding-top: 20px;
}

.login-header-accent {
    height: 4px;
    width: 84px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #DC2626 0%, #B91C1C 100%);
}

/* Profile icon (circular) */
.login-profile {
    width: 86px;
    height: 86px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0EA5E9 0%, #2563EB 100%);
    display: grid;
    place-items: center;
    color: #fff;
    position: absolute;
    left: 50%;
    top: -43px;
    transform: translateX(-50%);
    box-shadow: 0 18px 40px rgba(2, 132, 199, 0.30);
    border: 4px solid rgba(255, 255, 255, 0.90);
}

.login-profile i {
    font-size: 34px;
}

.login-college-name {
    font-weight: 700;
    font-size: 16px;
    color: #7F1D1D;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.login-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
    margin: 0 0 8px 0;
}

.login-subtitle {
    font-size: 14px;
    color: #64748B;
    margin: 0;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.login-form .mb-3 {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.login-form .form-control {
    height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    background: rgba(239, 246, 255, 0.95);
    padding: 0 14px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form .form-control:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
    background: rgba(239, 246, 255, 1);
}

/* Input with icon */
.input-icon {
    position: relative;
}

.input-icon .form-control {
    padding-left: 44px;
}

.input-icon .input-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(127, 29, 29, 0.90);
    font-size: 16px;
    pointer-events: none;
}

.login-form .form-control::placeholder {
    color: #94A3B8;
}

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

.password-wrapper .form-control {
    padding-right: 46px;
    padding-left: 44px;
}

.password-wrapper .input-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(127, 29, 29, 0.90);
    font-size: 16px;
    pointer-events: none;
}

/* Accessible toggle button */
.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #64748B;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.password-toggle-btn:hover {
    color: #2563EB;
    background: rgba(37, 99, 235, 0.08);
}

.password-toggle-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.password-toggle-icon {
    font-size: 16px;
}

/* ============================================
   VALIDATION ERRORS
   ============================================ */
.text-danger {
    font-size: 13px;
    color: #DC2626;
    margin-top: 6px;
    display: block;
}

.alert {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-danger {
    background: #FEE2E2;
    border: 1px solid rgba(220, 38, 38, 0.20);
    color: #991B1B;
}

/* ============================================
   BUTTONS
   ============================================ */
.login-form .btn-primary {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563EB 0%, #DC2626 100%);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.login-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.26);
    background: linear-gradient(135deg, #1D4ED8 0%, #B91C1C 100%);
}

.login-form .btn-primary:active {
    transform: translateY(0);
}

.login-form .btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 12px 26px rgba(37, 99, 235, 0.26);
}

/* ============================================
   FORM EXTRAS (Remember me, links)
   ============================================ */
.login-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0;
    font-size: 14px;
}

.login-forgot {
    margin-left: 12px;
    white-space: nowrap;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    border: 2px solid #CBD5E1;
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: #2563EB;
    border-color: #2563EB;
}

.form-check-label {
    color: #475569;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}

.login-link {
    color: #B91C1C;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.login-link:hover {
    color: #991B1B;
    text-decoration: underline;
}

/* ============================================
   FOOTER LINKS
   ============================================ */
.login-footer-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.login-footer-links a {
    color: #64748B;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-footer-links a:hover {
    color: #4F46E5;
    text-decoration: underline;
}

/* ============================================
   PAGE FOOTER
   ============================================ */
.login-footer {
    margin-top: 0;
    margin-bottom: 18px;
    padding: 14px 12px;
    text-align: center;
    color: rgba(15, 23, 42, 0.75);
    text-shadow: none;
    font-size: 14px;
    z-index: 10;
    position: relative;
}

.footer-primary {
    font-weight: 700;
    margin-bottom: 4px;
}

.footer-secondary {
    font-size: 13px;
    opacity: 0.90;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 576px) {
    .login-wrapper {
        padding: 16px;
        padding-top: 36vh;
        gap: 36px;
    }
    
    .login-card {
        padding: 24px;
    }

/* Footer: keep readable on image */
.login-footer {
    background: rgba(255, 255, 255, 0.55);
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    max-width: 640px;
    width: calc(100% - 40px);
    margin-left: auto;
    margin-right: auto;
}
    
    .login-title {
        font-size: 24px;
    }
    
    .login-extras {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 400px) {
    .login-card {
        padding: 20px;
    }
    
    .login-container {
        max-width: 100%;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeIn 0.4s ease-out;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.login-form input:focus,
.login-form button:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .login-card {
        border: 2px solid #000;
    }
    
    .login-form .form-control {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
