/* Base styles */
:root {
    --primary: #2196f3;
    --primary-dark: #1976d2;
    --primary-light: #64b5f6;
    --accent: #ff4081;
    --background: #121212;
    --surface: #1e1e1e;
    --error: #cf6679;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-disabled: rgba(255, 255, 255, 0.5);
    --divider: rgba(255, 255, 255, 0.12);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'DM Sans Bold';
    src: url('../assets/fonts/DMSans24pt-Bold.woff2') format('woff2'),
        url('../assets/fonts/DMSans24pt-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans Medium';
    src: url('../assets/fonts/DMSans24pt-Medium.woff2') format('woff2'),
        url('../assets/fonts/DMSans24pt-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans Regular';
    src: url('../assets/fonts/DMSans18pt-Regular.woff2') format('woff2'),
        url('../assets/fonts/DMSans18pt-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'DM Sans Regular';
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    height: 100vh;
    margin: 0;
}

/* Authentication container */
.auth-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    /* Enhanced, deeper dark background with layered gradients and more contrast */
    /* background: 
        linear-gradient(120deg, #10151c 60%, #18324b 100%),
        radial-gradient(circle at 80% 10%, rgba(67, 232, 191, 0.015) 0%, transparent 60%),
        radial-gradient(circle at 20% 90%, rgba(53, 176, 225, 0) 0%, transparent 60%),
        linear-gradient(100deg, rgba(18,18,18,0.98) 0%, rgba(53,176,225,0.08) 100%); */
    position: relative;
    overflow: hidden;
}

/* More pronounced, soft blurred shapes for depth */
.auth-container::before, .auth-container::after, .auth-container .extra-shape {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.22;
    z-index: 0;
    pointer-events: none;
    animation: floatShape 14s ease-in-out infinite alternate;
}
.auth-container::before {
    width: 420px;
    height: 420px;
    top: 8%;
    left: 58%;
    /* background: linear-gradient(135deg, #43e8bf 0%, #55b2f4 100%); */
    animation-delay: 0s;
}
.auth-container::after {
    width: 320px;
    height: 320px;
    bottom: 2%;
    right: 60%;
    /* background: linear-gradient(135deg, #367399 0%, #121212 100%); */
    animation-delay: 3s;
}
.auth-container .extra-shape {
    width: 260px;
    height: 260px;
    top: 60%;
    left: 10%;
    /* background: linear-gradient(135deg, #18324b 0%, #46bff3cc 100%); */
    opacity: 0.18;
    animation-delay: 6s;
    position: absolute;
}

/* Add the extra shape element in the HTML via pseudo-element */
.auth-container {
    position: relative;
}
.auth-container .extra-shape {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

/* Style the account type dropdown for dark theme */
select#account_type.form-control {
    background-color: #1a2332;
    color: #eaf6fb;
    border: 1px solid rgba(80, 180, 255, 0.18);
    border-radius: 8px;
    box-shadow: none;
    transition: border-color 0.2s;
}
select#account_type.form-control:focus {
    border-color: var(--primary);
    background-color: #22304a;
    color: #fff;
    outline: none;
}
select#account_type.form-control option {
    background: #1a2332;
    color: #eaf6fb;
}

/* Custom dropdown arrow for dark theme */
select#account_type.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2346bff3cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25em;
    padding-right: 2.5em;
}

/* Glassmorphism effect for auth box */
.auth-box, .auth-box-signin {
    width: 100%;
    max-width: 650px;
    background: rgba(30, 40, 60, 0.30);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid rgba(80, 180, 255, 0.10);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 12px 40px 0 rgba(0,0,0,0.35);
}

.auth-box-signin {
    width: 100%;
    max-width: 470px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Brand logo styling */
.brand-logo {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    position: relative;
    display: inline-block;
}

/* .brand-logo i {
    animation: pulse 1s infinite;
} */

/* .brand-logo::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.2;
    animation: ripple 2s infinite;
} */

/* Heading styles */
.auth-box h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
    font-weight: bold;
}

.auth-box p.text-muted {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Form styling */
.form-group {
    margin-bottom: 0.875rem;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 1rem;
}

.input-group {
    margin-bottom: 0.25rem;
}

.input-group .input-group-text {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    color: var(--text-secondary);
}

.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(124, 77, 255, 0.25);
    outline: none;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Password toggle button */
.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.1);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Form text helper */
.form-text {
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

/* Remember me checkbox */
.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    margin: 0.6rem 0;
    font-size: 1rem;
}

/* Terms checkbox */
.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-secondary);
    margin: 0.6rem 0;
    font-size: 0.85rem;
}

.terms-check input[type="checkbox"] {
    margin-top: 0.3rem;
}

.terms-check a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.terms-check a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Submit button */
.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #10b981 100%);
    border: none;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #357abd 0%, #047857 100%);
    transform: translateY(-1px);
    /* box-shadow: 0 4px 12px rgba(77, 145, 255, 0.3); */
}

.btn-primary:active {
    transform: translateY(0);
}

/* Links */
.auth-link {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
}

.auth-link a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-link a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.forgot-password {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary);
}

/* Flash messages */
.flash-message {
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    animation: slideDown 0.3s ease-out;
}

.flash-message.error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.2);
    color: var(--error);
}

.flash-message.success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    color: var(--success);
}

/* Background effects */
.bottom-glow {
    position: fixed;
    bottom: -90px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(77, 219, 255, 0.164) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.2;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 480px) {
    .auth-container {
        padding: 0.8rem;
    }

    .auth-box {
        padding: 1.5rem;
    }

    .brand-logo {
        font-size: 2.25rem;
    }

    .auth-box h2 {
        font-size: 1.5rem;
    }
}

@media (max-height: 700px) {
    .auth-box {
        padding: 1.25rem;
    }

    .brand-logo {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    .auth-box h2 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }
}

/* Loading state for button */
.btn-primary.loading {
    position: relative;
    pointer-events: none;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px 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);
    }
}

/* Input validation states */
.form-control.is-valid {
    border-color: var(--success);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%234CAF50' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: var(--error);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23F44336'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23F44336' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: none;
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-control.is-invalid~.invalid-feedback {
    display: block;
}

/* Custom checkboxes */
.custom-checkbox {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.custom-checkbox:hover input~.checkmark {
    background: rgba(255, 255, 255, 0.1);
}

.custom-checkbox input:checked~.checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.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);
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

/* Light theme variables */
.light-theme {
    --primary: #000000;
    --primary-dark: #333333;
    --primary-light: #666666;
    --accent: #424242;
    --background: #ffffff;
    --surface: #f5f5f5;
    --error: #c62828;
    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.7);
    --text-disabled: rgba(0, 0, 0, 0.5);
    --divider: rgba(0, 0, 0, 0.12);
}

/* Light theme specific styles */
.light-theme body {
    background: var(--background);
    color: var(--text-primary);
}

.light-theme .auth-container {
    background: linear-gradient(145deg, rgba(245, 245, 245, 0.5) 50%);
}

.light-theme .auth-card {
    background: var(--surface);
    border: 1px solid var(--divider);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.light-theme .auth-header {
    border-bottom: 1px solid var(--divider);
}

.light-theme .auth-header h2 {
    color: var(--text-primary);
}

.light-theme .form-group label {
    color: var(--text-secondary);
}

.light-theme .form-control {
    background: #ffffff;
    border: 1px solid var(--divider);
    color: var(--text-primary);
}

.light-theme .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.light-theme .btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
}

.light-theme .btn-primary:hover {
    background: var(--primary-dark);
}

.light-theme .auth-footer {
    border-top: 1px solid var(--divider);
}

.light-theme .auth-footer a {
    color: var(--primary);
}

.light-theme .auth-footer a:hover {
    color: var(--primary-dark);
}

.light-theme .error-message {
    color: var(--error);
    background: rgba(198, 40, 40, 0.1);
}

.light-theme select#account_type.form-control {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #cccccc;
}

.light-theme select#account_type.form-control:focus {
    border-color: #000000;
    background-color: #ffffff;
    color: #000000;
}

.light-theme select#account_type.form-control option {
    background: #ffffff;
    color: #000000;
}

.light-theme select#account_type.form-control {
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4\' stroke=\'%23000000\' stroke-width=\'2\' stroke-linecap=\'round\' stroke-linejoin=\'round\'/%3E%3C/svg%3E");
}

/* --- Two-column glassmorphism card for auth (signin/signup) --- */
.signup-split-card, .signin-split-card {
    width: 100%;
    max-width: 900px;
    min-height: 520px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    display: flex;
    background: rgba(30, 40, 60, 0.30);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    margin: 0 auto;
    position: relative;
}
.signup-left, .signup-right, .signin-left, .signin-right {
    flex: 1 1 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 2.5rem 3rem 2.5rem;
    position: relative;
}
.signup-left, .signin-left {
    color: #fff;
    align-items: flex-start;
}
.signup-left h2, .signin-left h2 {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}
.signup-left p, .signin-left p {
    font-size: 1.1rem;
    opacity: 0.92;
    margin-bottom: 1.5rem;
}
.signup-right, .signin-right {
    align-items: center;
    justify-content: center;
}
.signup-form-box, .signin-form-box {
    width: 100%;
    max-width: 350px;
    background: transparent;
    border-radius: 16px;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    box-shadow: none;
    backdrop-filter: none;
}
.signup-form-box h3, .signin-form-box h3 {
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: #fff;
    text-align: center;
}
/* Blue circles only on left */
.signup-left .blue-circle, .signin-left .blue-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196f3 60%, #1976d2 100%);
    opacity: 0.18;
    z-index: 0;
}
.signup-left .circle1 { width: 180px; height: 180px; left: -60px; top: 40px; }
.signup-left .circle2 { width: 120px; height: 120px; left: 60px; bottom: -40px; }
.signup-left .circle3 { width: 80px; height: 80px; right: -30px; top: 60px; }
.signup-left .circle5 { width: 100px; height: 100px; left: 50%; top: -50px; opacity: 0.10; }
/* Subtle but visible vertical divider */
.signup-divider, .signin-divider {
    width: 4px;
    min-height: 70%;
    background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(33,150,243,0.35) 100%);
    box-shadow: 0 0 16px 2px rgba(33,150,243,0.18), 0 0 0 2px rgba(255,255,255,0.10);
    border-radius: 12px;
    align-self: center;
    margin: 0 1.2rem;
    opacity: 0.95;
}
@media (max-width: 900px) {
    .signup-split-card, .signin-split-card { flex-direction: column; min-height: 0; }
    .signup-left, .signup-right, .signin-left, .signin-right { padding: 2rem 1.2rem; }
    .signup-divider, .signin-divider { display: none; }
}
@media (max-width: 600px) {
    .signup-split-card, .signin-split-card { border-radius: 0; box-shadow: none; }
    .signup-left, .signup-right, .signin-left, .signin-right { padding: 1.2rem 0.5rem; }
}