.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
    overflow-x: hidden;
}

/* Ambient Background Glows */
.auth-page::before,
.auth-page::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    animation: glowPulse 10s infinite alternate;
}

.auth-page::before {
    background: var(--magenta);
    top: -200px;
    right: -100px;
}

.auth-page::after {
    background: var(--electric-blue);
    bottom: -200px;
    left: -100px;
    animation-delay: -5s;
}

@keyframes glowPulse {
    from { transform: scale(1) translate(0, 0); opacity: 0.1; }
    to { transform: scale(1.2) translate(50px, 50px); opacity: 0.2; }
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: cardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.auth-tab {
    flex: 1;
    padding: var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.4s;
    position: relative;
}

.auth-tab.active {
    color: var(--text-primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--magenta), var(--electric-blue));
}

.auth-content {
    padding: var(--space-xl);
}

.auth-view {
    display: none;
    animation: viewFade 0.4s ease-out forwards;
}

.auth-view.active {
    display: block;
}

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

.auth-view h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.input-wrapper input {
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.password-toggle:hover {
    color: var(--magenta);
    transform: scale(1.1);
}

.eye-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: 0.3s;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-form input,
.auth-form select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: 0.3s;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--electric-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

/* Specific Fix for Date Picker Visibility - Theme Dynamic */
input[type="date"] {
    position: relative !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px !important;
    color-scheme: light;
}

/* Dark Mode Overrides - Only apply if theme is actually dark */
[data-theme="dark"] input[type="date"],
body.dark-mode input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") !important;
    color-scheme: dark !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    width: 40px !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    opacity: 0 !important;
}

.input-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--space-sm);
}

/* Custom Country Dropdown */
.country-selector {
    position: relative;
    width: 100%;
}

.selected-country {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.95rem;
}

.selected-country:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--electric-blue);
}

.country-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 280px;
    max-height: 350px;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    z-index: 100;
    display: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(25px);
    flex-direction: column;
}

.search-box {
    padding: 10px;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--glass-border);
    z-index: 2;
}

.search-box input {
    width: 100%;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
}

.options-list {
    overflow-y: auto;
    flex: 1;
}

.country-options.active {
    display: flex;
    animation: dropdownSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.country-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.country-option:hover {
    background: rgba(255, 0, 255, 0.1);
    color: var(--text-primary);
}

.country-option.selected {
    color: var(--magenta);
    font-weight: 600;
}

.auth-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.forgot-link {
    color: var(--electric-blue);
    text-decoration: none;
    transition: 0.3s;
}

.forgot-link:hover {
    color: var(--magenta);
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5); /* Muted legal text */
    font-size: 0.72rem; /* Smaller for smoother look */
    line-height: 1.5;
    user-select: none;
    margin: 15px 0 var(--space-md) 0;
}

.checkbox-container a {
    color: var(--electric-blue);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-container a:hover {
    text-decoration: underline;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 18px;
    width: 18px;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    position: relative;
    transition: 0.3s;
    margin-top: 2px; /* Align with first line of text */
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--electric-blue);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--electric-blue);
    border-color: var(--electric-blue);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.auth-btn {
    margin-top: var(--space-sm);
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.4s;
}

.btn-primary {
    background: linear-gradient(90deg, var(--magenta), var(--electric-blue));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 243, 255, 0.3);
}

.back-to-signin {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    margin-bottom: var(--space-md);
    transition: 0.3s;
}

.back-to-signin:hover {
    color: var(--text-primary);
    transform: translateX(-5px);
}

/* Password Checklist Styles */
.password-check {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.check-item {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-secondary);
    transition: 0.3s;
}

.check-item.valid {
    background: rgba(0, 255, 157, 0.1);
    border-color: #00ff9d;
    color: #00ff9d;
}

.match-indicator {
    font-size: 0.75rem;
    height: 15px;
    margin-top: 4px;
    transition: 0.3s;
}

.match-indicator.match { color: #00ff9d; }
.match-indicator.no-match { color: #ff3e3e; }

/* Dark Mode Specific Adjustments */
body.dark-mode .auth-form input,
body.dark-mode .auth-form select {
    background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 500px) {
    .auth-card {
        max-width: 100%;
        border-radius: 0;
        height: 100%;
        border: none;
    }
    .auth-container {
        padding: 0;
    }
}

.auth-footer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: var(--space-lg);
}

.auth-footer a {
    color: var(--magenta);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.auth-footer a:hover {
    color: var(--electric-blue);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.active {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #4CAF50;
}

.toast-error {
    border-left: 4px solid #f44336;
}

.toast-info {
    border-left: 4px solid var(--accent-primary);
}

/* OTP Input */
.otp-input-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 30px 0;
}

.otp-digit {
    width: 45px;
    height: 55px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
}

.otp-digit:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(71, 131, 195, 0.3);
    outline: none;
}
