@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');

/* ============================================
   CSS Variables / Theme
   ============================================ */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #a3bffa;
    --secondary-color: #764ba2;
    --accent-color: #48bb78;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --border-color: #e2e8f0;
    --error-color: #e53e3e;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Login Container
   ============================================ */
.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================
   Left Side - Form Section
   ============================================ */
.login-form-section {
    flex: 0 0 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 40px;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-xl);
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Logo Section
   ============================================ */
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-lg);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-lg);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 30px -5px rgba(102, 126, 234, 0.4);
    }
}

.logo-icon i {
    font-size: 32px;
    color: white;
}

.login-logo h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.login-logo .tagline {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   Welcome Text
   ============================================ */
.welcome-text {
    text-align: center;
    margin-bottom: 32px;
}

.welcome-text h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-text p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   Form Styles
   ============================================ */
.login-form {
    width: 100%;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.floating-label {
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-light);
    font-size: 16px;
    z-index: 1;
    transition: var(--transition-normal);
}

.login-form .form-control {
    width: 100%;
    height: 56px;
    padding: 16px 48px 16px 48px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    transition: var(--transition-normal);
    outline: none;
}

.login-form .form-control:hover {
    background: var(--bg-tertiary);
}

.login-form .form-control:focus {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.login-form .form-control:focus ~ .input-icon,
.login-form .form-control:not(:placeholder-shown) ~ .input-icon {
    color: var(--primary-color);
}

/* Floating Label */
.floating-label label {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-light);
    pointer-events: none;
    transition: var(--transition-normal);
    background: transparent;
    padding: 0 4px;
}

.login-form .form-control:focus ~ label,
.login-form .form-control:not(:placeholder-shown) ~ label {
    top: 0;
    left: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--bg-primary);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* Validation Error */
.validation-error {
    display: block;
    font-size: 12px;
    color: var(--error-color);
    margin-top: 6px;
    padding-left: 4px;
}

/* ============================================
   Form Options (Remember Me & Forgot Password)
   ============================================ */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Custom Checkbox */
.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    padding-left: 28px;
}

.remember-me input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.remember-me .checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition-fast);
}

.remember-me:hover .checkmark {
    border-color: var(--primary-color);
}

.remember-me input:checked ~ .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me .checkmark:after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-me input:checked ~ .checkmark:after {
    display: block;
}

.forgot-link {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   Login Button
   ============================================ */
.btn-login {
    width: 100%;
    height: 56px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-login::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;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login .btn-icon {
    transition: transform var(--transition-fast);
}

.btn-login:hover .btn-icon {
    transform: translateX(4px);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   Divider
   ============================================ */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 16px;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

/* ============================================
   Additional Links
   ============================================ */
.additional-links {
    text-align: center;
}

.additional-links p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.link-primary {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.link-primary:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.link-secondary {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition-fast);
}

.link-secondary:hover {
    color: var(--primary-color);
}

/* ============================================
   Login Footer
   ============================================ */
.login-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-light);
}

/* ============================================
   Right Side - Hero Section
   ============================================ */
.login-hero-section {
    flex: 1;
    background: var(--gradient-primary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px;
    max-width: 500px;
}

.hero-icon {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero-icon i {
    font-size: 48px;
    color: white;
}

.hero-content h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.hero-content > p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.7;
}

/* Feature List */
.feature-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    transition: var(--transition-normal);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 18px;
    color: white;
}

.feature-item span {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

/* ============================================
   Floating Shapes
   ============================================ */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation: morph 8s ease-in-out infinite;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: 10%;
    left: -50px;
    animation: morph 6s ease-in-out infinite reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    right: 10%;
    animation: morph 7s ease-in-out infinite 1s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    right: 30%;
    animation: morph 5s ease-in-out infinite 0.5s;
}

@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg);
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: rotate(180deg);
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .login-form-section {
        flex: 0 0 450px;
    }

    .hero-content h2 {
        font-size: 28px;
    }

    .feature-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }

    .login-form-section {
        flex: none;
        min-height: auto;
        padding: 40px 24px;
    }

    .login-hero-section {
        display: none;
    }

    .login-form-wrapper {
        max-width: 400px;
    }
}

@media (max-width: 576px) {
    .login-form-section {
        padding: 24px 16px;
    }

    .login-logo h1 {
        font-size: 24px;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
    }

    .logo-icon i {
        font-size: 28px;
    }

    .welcome-text h2 {
        font-size: 20px;
    }

    .login-form .form-control {
        height: 52px;
        font-size: 14px;
    }

    .btn-login {
        height: 52px;
        font-size: 15px;
    }

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ============================================
   Animation Helpers
   ============================================ */
.animate-in {
    animation: slideUp 0.6s ease forwards;
}

/* ============================================
   Loading State
   ============================================ */
.btn-login.loading {
    pointer-events: none;
}

.btn-login.loading .btn-text {
    opacity: 0;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Toast/Alert Customization
   ============================================ */
.swal2-popup {
    border-radius: var(--border-radius-lg) !important;
    font-family: 'Inter', sans-serif !important;
}

.swal2-title {
    font-size: 18px !important;
    font-weight: 600 !important;
}

/* ============================================
   Legacy Style Overrides
   ============================================ */
#auth-form,
#auth-logo,
#form-section,
#background-section {
    all: unset;
}

.mt-2 {
    margin-top: 0.5rem;
}

.me-1 {
    margin-right: 0.25rem;
}
