/* ===================================
   Authentication Pages - Modern Design
   =================================== */

/* Main Section */
.auth-section {
    min-height: calc(100vh - 67px);
    background: #f9fafb;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.auth-section .container {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Abstract Organic Shape 1 - Top Right */
.auth-section::before {
    content: '';
    position: absolute;
    top: -15%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    filter: blur(40px);
    pointer-events: none;
    animation: morph 20s ease-in-out infinite;
    z-index: 0;
}

/* Abstract Organic Shape 2 - Bottom Left */
.auth-section::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -15%;
    width: 500px;
    height: 500px;
    background: linear-gradient(225deg, rgba(99, 102, 241, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
    border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
    filter: blur(50px);
    pointer-events: none;
    animation: morph 15s ease-in-out infinite reverse;
    z-index: 0;
}

/* Abstract Organic Shape 3 - Center */
.auth-section .container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.03) 0%, transparent 70%);
    border-radius: 47% 53% 42% 58% / 55% 61% 39% 45%;
    filter: blur(60px);
    pointer-events: none;
    animation: morphSlow 25s ease-in-out infinite;
    z-index: 0;
}

/* Organic Shape 4 - Top Left */
.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -8%;
    width: 400px;
    height: 400px;
    background: linear-gradient(180deg, rgba(147, 51, 234, 0.04) 0%, rgba(99, 102, 241, 0.02) 100%);
    border-radius: 70% 30% 50% 50% / 60% 60% 40% 40%;
    filter: blur(35px);
    pointer-events: none;
    animation: float 18s ease-in-out infinite;
    z-index: 0;
}

/* Organic Shape 5 - Bottom Right */
.auth-wrapper::after {
    content: '';
    position: absolute;
    bottom: -12%;
    right: -10%;
    width: 450px;
    height: 450px;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-radius: 55% 45% 70% 30% / 48% 65% 35% 52%;
    filter: blur(45px);
    pointer-events: none;
    animation: float 22s ease-in-out infinite reverse;
    z-index: 0;
}

/* Animations */
@keyframes morph {
    0%, 100% {
        border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 48% 52% 68% 32% / 42% 61% 39% 58%;
        transform: rotate(90deg) scale(1.05);
    }
    50% {
        border-radius: 40% 60% 42% 58% / 65% 38% 62% 35%;
        transform: rotate(180deg) scale(0.95);
    }
    75% {
        border-radius: 58% 42% 55% 45% / 48% 70% 30% 52%;
        transform: rotate(270deg) scale(1.02);
    }
}

@keyframes morphSlow {
    0%, 100% {
        border-radius: 47% 53% 42% 58% / 55% 61% 39% 45%;
        transform: translate(-50%, -50%) rotate(0deg);
    }
    33% {
        border-radius: 42% 58% 65% 35% / 48% 52% 48% 52%;
        transform: translate(-50%, -50%) rotate(120deg);
    }
    66% {
        border-radius: 60% 40% 45% 55% / 62% 38% 62% 38%;
        transform: translate(-50%, -50%) rotate(240deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(20px, -20px) scale(1.03);
    }
    66% {
        transform: translate(-15px, 15px) scale(0.98);
    }
}

/* Wrapper - Two Column Layout */
.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
    width: 100%;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.04);
    min-height: 650px;
    position: relative;
    z-index: 1;
}

/* ===================================
   Left Side - Welcome Section
   =================================== */

.auth-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.auth-welcome-content {
    max-width: 100%;
}

/* Brand Logo */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.auth-brand-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #667eea;
}

.auth-brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Welcome Title & Description */
.auth-welcome-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 1rem 0;
    color: white;
    line-height: 1.2;
}

.auth-welcome-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 2.5rem 0;
}

/* Features List */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.auth-feature-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-icon i {
    font-size: 1.25rem;
    color: white;
}

.auth-feature-text h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.auth-feature-text p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ===================================
   Right Side - Form Section
   =================================== */

.auth-form-container {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

/* Form Card */
.auth-form-card {
    width: 100%;
}

/* Form Header */
.auth-form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.auth-form-subtitle {
    font-size: 0.9375rem;
    color: #64748b;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0;
}

/* Input Group */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9375rem;
    color: #1e293b;
    background: white;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: #cbd5e1;
}

.form-input.is-invalid {
    border-color: #ef4444;
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 1;
}

.password-toggle:hover {
    color: #6366f1;
}

.password-toggle i {
    font-size: 1.125rem;
}

/* Form Error */
.form-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #ef4444;
}

/* Form Options (Remember & Forgot) */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #6366f1;
}

.checkbox-text {
    user-select: none;
}

.forgot-link {
    font-size: 0.875rem;
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 1rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.auth-submit-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
    padding: 0 1rem;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Social Login Buttons */
.social-login-buttons {
    display: flex;
    gap: 0.75rem;
}

.social-login-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #475569;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.social-login-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.social-login-btn i {
    font-size: 1.125rem;
}

.social-login-btn.google {
    color: #dc4e41;
}

.social-login-btn.google:hover {
    border-color: #dc4e41;
    background: #fef2f2;
}

.social-login-btn.facebook {
    color: #1877f2;
}

.social-login-btn.facebook:hover {
    border-color: #1877f2;
    background: #eff6ff;
}

/* Auth Switch (Register/Login Link) */
.auth-switch {
    text-align: center;
}

.auth-switch p {
    font-size: 0.875rem;
    color: #64748b;
}

.auth-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f1f5f9;
    color: #6366f1;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.auth-switch-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

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

@media (max-width: 968px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .auth-welcome {
        display: none;
    }

    .auth-form-container {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 768px) {
    .auth-section {
        min-height: calc(100vh - 61px);
    }
}

@media (max-width: 640px) {
    .auth-section {
        padding: 1rem 0;
        min-height: calc(100vh - 61px);
    }

    .auth-form-container {
        padding: 2rem 1.5rem;
    }

    .auth-form-title {
        font-size: 1.5rem;
    }

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

    /* Collapse form-row grid on mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ===================================
   Register Page - Form Row Grid
   =================================== */

/* Two-column form row for register page */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* Terms & Conditions Box */
.terms-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 12px;
    padding: 1rem;
}

.terms-box .checkbox-label {
    align-items: flex-start;
}

.terms-box .checkbox-text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #475569;
}

.terms-link {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.terms-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* ===================================
   Additional Utilities
   =================================== */

/* Loading State for Submit Button */
.auth-submit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.auth-submit-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
}

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

/* Success Message */
.auth-success-message {
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 12px;
    color: #166534;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Error Message */
.auth-error-message {
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===================================
   MODAL DIALOGS
   =================================== */

/* Prevent scroll when modal is open */
html.modal-open {
    overflow: hidden;
}

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

/* Modal Content Container */
.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Modal Header */
.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #0f172a;
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.modal-body ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: #475569;
    line-height: 1.7;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

/* Modal Footer */
.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-cancel {
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

/* Cloudflare Turnstile */
.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}
