@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css');

/* ======================================
   EducPro Login - Modern Design
   Inspired by Retro Pixel Aesthetic (Subtle)
   ====================================== */

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --border-soft: #f3f4f6;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--text-dark);
}

body {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ======================================
   Login Container
   ====================================== */

.login-container {
    display: flex;
    width: 100%;
    max-width: none;
    height: 100vh;
    min-height: 100vh;
    background: var(--bg-white);
    box-shadow: none;
    overflow: hidden;
    backdrop-filter: none;
}

/* ======================================
   Brand Section (Left)
   ====================================== */

.login-brand-section {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* Subtle retro-inspired pattern overlay */
.login-brand-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 4px);
    pointer-events: none;
}

/* Floating elements for visual interest */
.login-brand-section::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.logo-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.brand-title {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ======================================
   Form Section (Right)
   ====================================== */

.login-form-section {
    flex: 1;
    background: var(--bg-white);
    padding: 50px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.form-container {
    width: 100%;
    max-width: 350px;
}

.form-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-weight: 400;
}

/* ======================================
   Form Groups
   ====================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 14px;
    text-transform: capitalize;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    font-weight: 400;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:focus {
    outline: none;
    background: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-input:focus ~ .input-icon {
    color: var(--primary-color);
}

.a2f-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 1;
}

/* ======================================
   Error Message
   ====================================== */

.error-message {
    background-color: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #dc2626;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ======================================
   Submit Button
   ====================================== */

.submit-button {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ======================================
   Form Options (Remember & Forgot)
   ====================================== */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-dark);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-dark);
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    accent-color: var(--primary-color);
}

.forgot-password {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.2s ease;
}

.forgot-password:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ======================================
   Footer Links
   ====================================== */

.footer-links {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-links p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ======================================
   Modal Styles
   ====================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-white);
    border: 3px solid var(--text-dark);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5), 0 0 0 3px var(--text-dark);
    padding: 40px 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

/* ======================================
   RETRO BOX STYLES (Global Reusable)
   ====================================== */

.retro-box {
    border: 3px solid var(--text-dark);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    background: var(--bg-white);
    transition: all 0.05s;
}

.retro-box:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.5);
}

.retro-box:active,
.retro-box.active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    border-style: inset;
}

.retro-btn {
    border: 3px solid var(--text-dark);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    transition: all 0.05s;
    letter-spacing: 0.5px;
}

.retro-btn:hover {
    filter: brightness(1.1);
    transform: translate(-1px, -1px);
}

.retro-btn:active {
    transform: translate(2px, 2px);
    border-style: inset;
}

.modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
    border-bottom: 2px solid var(--text-dark);
    padding-bottom: 12px;
}

.modal-message {
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
    color: var(--text-muted);
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    border: 2px solid var(--text-dark);
    background: var(--bg-light);
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

.modal-input:focus {
    outline: none;
    background: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    border: 2px solid var(--text-dark);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.05s;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.modal-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.3);
    border-style: inset;
}

.modal-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.modal-btn-primary:hover {
    filter: brightness(1.1);
}

/* ======================================
   Password Reset Modal (NeoRetro Style)
   ====================================== */

#password-reset-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
    backdrop-filter: blur(4px);
}

#password-reset-modal.active {
    display: flex;
}

.reset-modal-box {
    background: var(--bg-white);
    padding: 40px 32px;
    max-width: 420px;
    width: 90%;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border-color);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
}

.reset-modal-box h3 {
    margin: 0 0 8px 0;
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.reset-modal-box p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.reset-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    margin-bottom: 20px;
    box-sizing: border-box;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
    transition: all 0.05s;
}

.reset-modal-input:focus {
    outline: none;
    background: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
}

.reset-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.reset-modal-btn-cancel,
.reset-modal-btn-primary {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    border-radius: 0;
    font-weight: 600;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.05s;
}

.reset-modal-btn-cancel {
    background: var(--bg-light);
    color: var(--text-muted);
}

.reset-modal-btn-cancel:hover {
    transform: translate(-1px, -1px);
}

.reset-modal-btn-cancel:active {
    transform: translate(2px, 2px);
    border-style: inset;
}

.reset-modal-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.reset-modal-btn-primary:hover {
    filter: brightness(1.1);
    transform: translate(-1px, -1px);
}

.reset-modal-btn-primary:active {
    transform: translate(2px, 2px);
    border-style: inset;
}

.reset-modal-btn-success {
    background: var(--success-color);
    color: white;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 0;
    font-weight: 600;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.05s;
}

.reset-modal-btn-success:hover {
    filter: brightness(1.05);
    transform: translate(-1px, -1px);
}

.reset-modal-btn-success:active {
    transform: translate(2px, 2px);
    border-style: inset;
}

/* OTP Input Styling (NeoRetro) */
.otp-input {
    width: 45px !important;
    height: 55px !important;
    font-size: 24px !important;
    text-align: center !important;
    border: 1px solid var(--border-color) !important;
    margin: 0 4px !important;
    font-weight: 600 !important;
    color: var(--text-dark) !important;
    background-color: var(--bg-light) !important;
    transition: all 0.05s !important;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2) !important;
    font-family: 'Inter', sans-serif !important;
}

.otp-input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    background-color: var(--bg-white) !important;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3) !important;
}

#reset-otp-container {
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 20px !important;
}

.modal-btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
}

/* ======================================
   Responsive Design
   ====================================== */

@media (max-width: 900px) {
    .login-container {
        max-height: 100vh;
        height: 100%;
        flex-direction: column;
    }

    .login-brand-section {
        border-right: none;
        min-height: 180px;
        flex: 0 0 auto;
        padding: 30px 20px;
    }

    .brand-title {
        font-size: 28px;
    }

    .logo-wrapper {
        width: 100px;
        height: 100px;
    }

    .logo-icon {
        width: 80px;
        height: 80px;
    }

    .login-form-section {
        flex: 1;
        padding: 40px 25px;
    }
}

@media (max-width: 600px) {
    .login-container {
        width: 95%;
        max-width: 100%;
        border-radius: 12px;
    }

    .form-title {
        font-size: 20px;
    }

    .form-label {
        font-size: 13px;
    }

    .form-input {
        font-size: 13px;
        padding: 10px 14px 10px 36px;
    }

    .submit-button {
        font-size: 13px;
        padding: 10px 14px;
    }

    .brand-title {
        font-size: 24px;
    }

    .logo-wrapper {
        width: 90px;
        height: 90px;
    }

    .logo-icon {
        width: 70px;
        height: 70px;
    }

    .login-form-section {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .login-container {
        border-radius: 8px;
        max-height: 100vh;
    }

    .login-brand-section {
        min-height: 140px;
        padding: 20px 15px;
    }

    .brand-title {
        font-size: 20px;
    }

    .brand-subtitle {
        font-size: 12px;
    }

    .logo-wrapper {
        width: 80px;
        height: 80px;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
    }

    .login-form-section {
        padding: 25px 16px;
    }

    .form-container {
        max-width: 100%;
    }

    .form-title {
        font-size: 18px;
    }

    .form-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .modal-box {
        padding: 30px 20px;
        width: 95%;
    }

    .modal-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ======================================
   Print Styles
   ====================================== */

@media print {
    body {
        background: white;
    }

    .login-container {
        box-shadow: none;
    }
}

/* ======================================
   Accessibility
   ====================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .form-input {
        border-width: 3px;
    }

    .submit-button {
        font-weight: 700;
    }
}

/* Scrollbar styling */
.login-form-section::-webkit-scrollbar {
    width: 8px;
}

.login-form-section::-webkit-scrollbar-track {
    background: transparent;
}

.login-form-section::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.login-form-section::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
