/* Login Page Styles */
:root {
    --primary-color: #5B3EBF;
    --primary-light: #7C66D4;
    --primary-dark: #4A32A3;
    --accent-color: #6FEBD4;
    --accent-hover: #5CD4BE;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --border-radius: 16px;
    --box-shadow: 0 8px 30px rgba(91, 62, 191, 0.1);
}

body {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    padding: 1rem;
    margin: 0;
}

.container {
    width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
}

.login-container {
    background: var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    overflow: hidden;
    color: var(--white);
    animation: fadeInScale 0.6s ease-out forwards;
    opacity: 0;
}

.login-left {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--primary-dark);
    animation: slideInFromLeft 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.login-left h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--white);
}

.login-left h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.login-right {
    flex: 1;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: slideInFromRight 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.login-header {
    /* margin-bottom: 2.5rem; */
}

.login-header h1 {
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 0.5rem;
    font-weight: 600;
    animation: fadeInUp 0.6s ease-out 0.4s forwards;
    opacity: 0;
}

.login-header p {
    animation: fadeInUp 0.6s ease-out 0.5s forwards;
    opacity: 0;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--white);
    transition: all 0.2s ease-in-out;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-control:focus {
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(111, 235, 212, 0.15);
    outline: none;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    background-color: transparent;
    cursor: pointer;
    position: relative;
}

.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.form-check-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    user-select: none;
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--white);
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--accent-color);
    color: var(--primary-dark);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 235, 212, 0.2);
}

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

.btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
}

.forgot-password {
    display: block;
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--accent-color);
}

.register-link {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.6s ease-out 0.9s forwards;
    opacity: 0;
}

.register-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo img {
    height: 48px;
    width: auto;
    animation: fadeInScale 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    animation: slideInFromRight 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 0;
        background: var(--primary-color);
    }

    .container {
        padding: 0;
    }

    .login-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        flex-direction: column;
        animation: mobileSlideUp 0.5s ease-out forwards;
        opacity: 0;
    }

    .login-left {
        display: none; /* Hide the left section on mobile */
    }

    .login-right {
        flex: 1;
        padding: 2rem;
        min-height: 100%;
        display: flex;
        flex-direction: column;
        /* animation: fadeInUp 0.5s ease-out 0.1s forwards; */
        opacity: 0;
    }

    .login-header {
        /* margin-bottom: 2rem; */
    }

    .login-header h1 {
        font-size: 1.75rem;
        animation: mobileSlideUp 0.5s ease-out 0.2s forwards;
        opacity: 0;
    }

    .login-header p {
        animation: mobileSlideUp 0.5s ease-out 0.3s forwards;
        opacity: 0;
    }

    .form-control {
        padding: 0.875rem;
    }

    .btn-primary {
        padding: 0.875rem;
        margin-top: auto;
    }

    .register-link {
        margin-top: 1.5rem;
    }
}

/* Error message styling */
.error-message {
    background-color: rgba(255, 71, 87, 0.15);
    color: #FF4757;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-top: 0.5rem;
    font-size: 0.875rem;
    display: none;
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.error-message.show {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: calc(100% - 3rem);
    width: 420px;
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    animation: mobileToastSlideUp 0.3s ease-out;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.toast-content {
    flex-grow: 1;
    padding-right: 2rem;
    min-width: 0; /* Prevents text from overflowing */
}

.toast-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-message {
    font-size: 0.875rem;
    color: inherit;
    opacity: 0.9;
    line-height: 1.4;
    word-wrap: break-word;
}

.toast-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.5rem;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast Variants */
.toast-success {
    background-color: rgba(231, 249, 240, 0.95);
    color: #0C622E;
    border: 1px solid rgba(209, 243, 228, 0.4);
}

.toast-info {
    background-color: rgba(231, 243, 251, 0.95);
    color: #0C4A6E;
    border: 1px solid rgba(209, 233, 247, 0.4);
}

.toast-warning {
    background-color: rgba(254, 244, 230, 0.95);
    color: #9A3412;
    border: 1px solid rgba(252, 236, 209, 0.4);
}

.toast-error {
    background-color: rgba(254, 231, 231, 0.95);
    color: #991B1B;
    border: 1px solid rgba(252, 209, 209, 0.4);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%) translateY(0);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%) translateY(0);
    }
}

/* Mobile Responsiveness for Toasts */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        width: auto;
        max-width: none;
    }

    .toast {
        padding: 1rem;
        gap: 0.75rem;
    }

    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 1.125rem;
    }

    .toast-content {
        padding-right: 1.75rem;
    }

    .toast-title {
        font-size: 0.9375rem;
    }

    .toast-message {
        font-size: 0.8125rem;
    }

    .toast-close {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.375rem;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes slideOut {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(100%);
        }
    }
}

/* Update the loading state styles */
.btn-primary.loading {
    position: relative;
    background: var(--accent-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--primary-dark);
    pointer-events: none;
}

.btn-primary.loading::before {
    content: '';
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--primary-dark);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* Page Load Animations */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.92);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(100px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Apply animations to elements */
.login-header p {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.google-btn {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.divider {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

#loginForm {
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

/* Logo animation */
.logo img {
    animation: fadeInScale 0.8s ease-out 0.3s both;
}

.logo-text {
    animation: slideInFromRight 0.8s ease-out 0.4s both;
}

/* Mobile animations */
@media (max-width: 768px) {
    @keyframes mobileSlideUp {
        0% {
            opacity: 0;
            transform: translateY(30px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes mobileFadeIn {
        0% {
            opacity: 0;
        }
        100% {
            opacity: 1;
        }
    }

    .login-container {
        animation: mobileSlideUp 0.5s ease-out forwards;
        opacity: 0;
    }

    .login-right {
        animation: fadeInUp 0.5s ease-out 0.1s forwards;
        opacity: 0;
    }

    .login-header h1 {
        animation: mobileSlideUp 0.5s ease-out 0.2s forwards;
        opacity: 0;
    }

    .login-header p {
        animation: mobileSlideUp 0.5s ease-out 0.3s forwards;
        opacity: 0;
    }

    .google-btn {
        animation: mobileSlideUp 0.5s ease-out 0.4s forwards !important;
        opacity: 0;
    }

    .divider {
        animation: mobileSlideUp 0.5s ease-out 0.5s forwards;
        opacity: 0;
    }

    #loginForm {
        animation: mobileSlideUp 0.5s ease-out 0.6s forwards;
        opacity: 0;
    }

    .register-link {
        animation: mobileSlideUp 0.5s ease-out 0.7s forwards;
        opacity: 0;
    }

    /* Mobile Toast animations */
    .toast {
        animation: mobileToastSlideUp 0.3s ease-out;
    }

    @keyframes mobileToastSlideUp {
        0% {
            opacity: 0;
            transform: translateY(100%);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes mobileToastSlideOut {
        0% {
            opacity: 1;
            transform: translateY(0);
        }
        100% {
            opacity: 0;
            transform: translateY(100%);
        }
    }
}

/* Add smooth touch interactions for mobile */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:active {
        transform: translateY(1px);
        transition: transform 0.1s;
    }

    .google-btn:active {
        transform: translateY(1px);
        transition: transform 0.1s;
    }

    .form-control {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Reduce animations if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Ensure animations work with reduced motion preferences */
@media (prefers-reduced-motion: no-preference) {
    .animated {
        animation-duration: 0.6s;
        animation-fill-mode: both;
    }
}

/* Desktop Animations */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.92);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(100px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Apply enhanced desktop animations */
@media (min-width: 769px) {
    .login-container {
        animation: fadeInScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        opacity: 0;
        transform-origin: center;
    }

    .login-left {
        animation: slideInFromLeft 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
        opacity: 0;
        transform-origin: left center;
    }

    .login-right {
        animation: slideInFromRight 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
        opacity: 0;
        transform-origin: right center;
    }

    .logo img {
        animation: fadeInScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
        opacity: 0;
    }

    .logo-text {
        animation: slideInFromRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards;
        opacity: 0;
    }

    .login-header h1 {
        animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s forwards;
        opacity: 0;
    }

    .login-header p {
        animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s forwards;
        opacity: 0;
    }

    .google-btn {
        animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s forwards !important;
        opacity: 0;
    }

    .divider {
        animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s forwards;
        opacity: 0;
    }

    #loginForm {
        animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1s forwards;
        opacity: 0;
    }

    .register-link {
        animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.1s forwards;
        opacity: 0;
    }

    /* Enhanced hover effects for desktop */
    .btn-primary:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 8px 20px rgba(111, 235, 212, 0.3);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .google-btn:hover {
        transform: translateY(-2px) scale(1.01);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .form-control:focus {
        transform: translateY(-2px);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}