﻿/* Modern CSS Reset */
:root {
    --primary: #005BD2;
    --primary-hover: #001f3f;
    --primary-light: #335d8c;
    --text: #cdddff;
    --text-light: #6b7280;
    --bg: #f9fafb;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border: #e5e7eb;
    --error: #ef4444;
    --success: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background with Image Overlay */
.background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2;
    background: linear-gradient(135deg, #030f1a, #1275d547),url('/img/background.jpg');
    /*background: linear-gradient(rgba(0, 46, 91, 0.8), rgba(0, 46, 91, 0.9)), url('/img/background.jpg');*/
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

    /* Add a subtle overlay for better text readability */
    .background::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
/*        background: linear-gradient(135deg, rgba(0, 46, 91, 0.2) 0%, rgba(0, 31, 63, 0.3) 100%);*/
        z-index: -1;
    }

/* Animation for login card */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Container */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

/* Login Card */
.login-card {
    background: #004c8a;
    /*background: rgba(255, 255, 255, 0.9);*/
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    /*border: 1px solid rgba(255, 255, 255, 0.5);*/
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

    .login-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 8px;
        background: linear-gradient(90deg, var(--primary), #8b5cf6);
    }

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo {
    display: block;
    align-items: center;
/*    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);*/
}

    .logo img{
        width:60%;
    }

    .logo i {
        font-size: 1.8rem;
    }

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.login-header p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Form Styles */
.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

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

    .input-group i:not(.toggle-password i) {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-light);
        transition: var(--transition);
        font-size: 1.1rem;
        z-index: 2;
        pointer-events: none;
    }

    .input-group.focused i {
        color: var(--primary);
    }

    .input-group .toggle-password {
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: var(--text-light);
        cursor: pointer;
        padding: 0.25rem;
        border-radius: 50%;
        transition: var(--transition);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        margin: 0;
        outline: none;
    }

        .input-group .toggle-password:hover {
            background: rgba(0, 0, 0, 0.05);
            color: var(--text);
        }

        .input-group .toggle-password:focus {
            box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
        }

        .input-group .toggle-password:hover {
            background: rgba(0, 0, 0, 0.05);
            color: var(--text);
        }

.form-control {
    width: 100%;
    padding: 0.875rem 2.75rem 0.875rem 3rem;
    font-size: 1rem;
    line-height: 1.5;
    color: black;
    /*color: var(--text);*/
    background-color: white;
    background-clip: padding-box;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: var(--transition);
    appearance: none;
    box-shadow: var(--shadow);
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    }

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    cursor: pointer;
    user-select: none;
}

    .remember-me input[type="checkbox"] {
        width: 1rem;
        height: 1rem;
        border-radius: 0.25rem;
        border: 1px solid var(--border);
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
        position: relative;
        transition: var(--transition);
    }

        .remember-me input[type="checkbox"]:checked {
            background-color: var(--primary);
            border-color: var(--primary);
        }

            .remember-me input[type="checkbox"]:checked::after {
                content: '✓';
                position: absolute;
                color: white;
                font-size: 0.75rem;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                line-height: 1;
            }

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

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

/* Login Button */
.login-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(0, 46, 91, 0.3), 0 2px 4px -1px rgba(0, 46, 91, 0.1);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

    .login-button:hover {
        background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(0, 46, 91, 0.3), 0 4px 6px -2px rgba(0, 46, 91, 0.1);
    }

    .login-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: 0.5s;
    }

    .login-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.1);
    }

    .login-button:active {
        transform: translateY(0);
    }

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

    .login-button i {
        font-size: 1.1rem;
        transition: transform 0.3s ease;
    }

    .login-button:hover i {
        transform: translateX(4px);
    }

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--error);
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    animation: fadeIn 0.3s ease;
}

    .error-message i {
        font-size: 1.1rem;
    }

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

    .divider::before,
    .divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid var(--border);
    }

    .divider:not(:empty)::before {
        margin-right: 1.5rem;
    }

    .divider:not(:empty)::after {
        margin-left: 1.5rem;
    }

/* Social Login */
.social-login {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 0.5rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

    .social-button:hover {
        background-color: #f9fafb;
        transform: translateY(-1px);
        box-shadow: var(--shadow);
    }

    .social-button i {
        font-size: 1.1rem;
    }

    .social-button.google {
        color: #db4437;
    }

    .social-button.microsoft {
        color: #0078d4;
    }

    .social-button img {
        width: 18px;
        height: 18px;
        object-fit: contain;
    }

/* Sign Up Link */
.signup-link {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-top: 1.5rem;
}

    .signup-link a {
        color: var(--primary);
        font-weight: 500;
        text-decoration: none;
        transition: var(--transition);
    }

        .signup-link a:hover {
            text-decoration: underline;
            color: var(--primary-hover);
        }

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .social-login {
        grid-template-columns: 1fr;
    }

    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .forgot-password {
        margin-left: 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text: #f3f4f6;
        --text-light: #9ca3af;
        --bg: #111827;
        --card-bg: rgba(31, 41, 55, 0.8);
        --border: #374151;
    }

    .login-card {
        background: rgba(31, 41, 55, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .form-control {
        background-color: #1f2937;
        border-color: #374151;
        color: #f3f4f6;
    }

        .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
        }

    .social-button {
        background-color: #1f2937;
        border-color: #374151;
        color: #f3f4f6;
    }

        .social-button:hover {
            background-color: #1f2937;
        }

    .remember-me input[type="checkbox"] {
        background-color: #1f2937;
        border-color: #4b5563;
    }

        .remember-me input[type="checkbox"]:checked {
            background-color: var(--primary);
            border-color: var(--primary);
        }
}

/* Modern links */
.form-group.text-center a {
    color: #6366f1 !important;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

    .form-group.text-center a::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 0;
        height: 2px;
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        transition: width 0.3s ease;
    }

    .form-group.text-center a:hover::after {
        width: 100%;
    }

    .form-group.text-center a:hover {
        color: #4f46e5 !important;
        transform: translateY(-1px);
    }

/* Enhanced responsive design */
@media (max-width: 1024px) {
    /* Tablet styles */
    .login-wrap {
        max-width: 400px;
        padding: 2.5rem 2rem !important;
    }

    .heading-section {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    /* Mobile landscape and small tablets */
    .login-wrap {
        margin: 1rem;
        padding: 2rem 1.5rem !important;
        border-radius: 16px;
        max-width: 380px;
    }

    body {
        padding: 1rem;
    }

    .heading-section {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    .login-wrap h3 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .form-control {
        padding: 14px 16px 14px 48px !important;
        font-size: 16px;
        border-radius: 10px !important;
    }

    .form-group {
        margin-bottom: 1.8rem;
    }

    .submit {
        padding: 14px 20px !important;
        font-size: 16px;
        border-radius: 10px !important;
    }

    .login-wrap .icon span {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    /* Small mobile phones */
    .login-wrap {
        margin: 0.5rem;
        padding: 1.5rem 1.2rem !important;
        max-width: 100%;
        border-radius: 12px;
    }

    .heading-section {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .login-wrap h3 {
        font-size: 1.4rem;
        margin-bottom: 1.8rem;
    }

    .login-wrap .icon {
        margin-bottom: 1.2rem;
    }

        .login-wrap .icon span {
            font-size: 2.2rem;
        }

    .form-control {
        padding: 12px 14px 12px 44px !important;
        font-size: 16px;
        border-radius: 8px !important;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .submit {
        padding: 12px 18px !important;
        font-size: 16px;
        border-radius: 8px !important;
    }

    .g-recaptcha {
        transform: scale(0.9);
        transform-origin: center;
    }
}

@media (max-width: 360px) {
    /* Very small screens */
    .login-wrap {
        padding: 1.2rem 1rem !important;
    }

    .heading-section {
        font-size: 1.2rem;
    }

    .login-wrap h3 {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }

    .form-control {
        padding: 10px 12px 10px 40px !important;
        font-size: 16px;
    }

    .submit {
        padding: 10px 16px !important;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .login-wrap {
        margin: 0.5rem;
        padding: 1rem !important;
    }

    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Enhanced focus states for accessibility and touch */
.form-control:focus,
.submit:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.form-group.text-center a:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .login-wrap:hover {
        transform: none;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .submit:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    }

    .form-group.text-center a:hover {
        transform: none;
    }

    .login-wrap .icon:hover span {
        transform: none;
    }
}

/* High touch target sizes for mobile */
@media (max-width: 768px) {
    .form-control {
        min-height: 48px; /* Minimum touch target */
    }

    .submit {
        min-height: 48px;
    }

    .form-group.text-center a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 8px 12px;
        margin: -8px -12px;
    }
}

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

    .form-control {
        border: 2px solid #000;
    }
}

/* reCAPTCHA styling */
.g-recaptcha {
    display: flex;
    justify-content: center;
}

/* Modern animation classes */
.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-up {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-bounce {
    animation: bounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-slide-left {
    animation: slideLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-right {
    animation: slideRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-shake {
    animation: shake 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Modern keyframe animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
    }

    40% {
        transform: translateY(-8px) scale(1.05);
    }

    60% {
        transform: translateY(-4px) scale(1.02);
    }
}

@keyframes slideLeft {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideRight {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(3px);
    }
}
