/* Authentication Page - Fresh Design Matching Home Page */

/* Hero section matching home page exactly */
#auth-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 0; /* Remove since body now has padding-top */
    background: var(--light-color);
    isolation: isolate;
}

#auth-hero .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    clip-path: inset(0);
}

#auth-hero .hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Same morphing gradient as home page */
#auth-hero .hero-gradient {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--gradient-mesh);
    animation: morphing 20s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes morphing {
    0%, 100% { transform: rotate(0deg) scale(1); }
    33% { transform: rotate(120deg) scale(1.1); }
    66% { transform: rotate(240deg) scale(0.9); }
}

#auth-hero .hero-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

/* Center the form wrapper */
.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

/* Clean form container with proper contrast */
.auth-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(44, 44, 46, 0.1), 0 8px 16px rgba(44, 44, 46, 0.06);
    border: 1px solid rgba(139, 111, 142, 0.1);
    width: 100%;
    max-width: 480px;
    position: relative;
}


/* Modern toggle design */
.auth-toggle {
    display: flex;
    position: relative;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.auth-toggle-btn {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    font-family: 'Inter', sans-serif;
}

.auth-toggle-btn.active {
    color: #ffffff;
}

.auth-toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--gradient-1);
    border-radius: 8px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 111, 142, 0.3);
}

.auth-toggle-slider.signup {
    transform: translateX(100%);
}

/* Form containers */
.auth-form-container {
    display: none !important;
}

.auth-form-container.active {
    display: block !important;
    animation: fadeInUp 0.5s ease;
}

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

/* Form headers */
.auth-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
}

.auth-subtitle {
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

/* Clean form styling */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

/* Clean input design with good contrast */
.form-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Phone input container with country selector */
.phone-input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.phone-input-wrapper {
    flex: 1;
}

.phone-format-hint {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

/* Additional country selector styles */
.country-search-container {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

.country-search-container input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1a1a1a;
    background: #f8f9fa;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.country-search-container input::placeholder {
    color: #adb5bd;
}

.country-search-container input:focus {
    border-color: var(--primary-color);
    background: #ffffff;
}

.form-input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #f8f9fa;
    font-size: 1rem;
    font-weight: 500;
    color: #1a1a1a;
    transition: all 0.3s ease;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.form-input-wrapper input:focus {
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 111, 142, 0.1);
}

.form-input-wrapper input::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

/* Icons with proper positioning */
.form-input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #6c757d;
    transition: color 0.3s ease;
    z-index: 2;
}

.form-input-wrapper input:focus ~ .form-input-icon {
    color: var(--primary-color);
}

.form-input-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 3;
}

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

.password-toggle svg {
    width: 100%;
    height: 100%;
    stroke-width: 2;
}

.password-toggle .eye-close {
    display: none;
}

.password-toggle.active .eye-open {
    display: none;
}

.password-toggle.active .eye-close {
    display: block;
}

/* Phone input styling */
.phone-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.country-selector {
    position: relative;
    min-width: 110px;
}

.selected-country {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.selected-country:hover {
    border-color: var(--primary-color);
    background: #ffffff;
}

.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.country-code {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.dropdown-arrow {
    width: 14px;
    height: 14px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.country-selector.active .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px;
    max-height: 300px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.country-selector.active .country-dropdown {
    display: block;
    animation: dropdownSlide 0.3s ease;
}

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

.country-search {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

.country-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1a1a1a;
    background: #f8f9fa;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.country-search input::placeholder {
    color: #adb5bd;
}

.country-list {
    max-height: 250px;
    overflow-y: auto;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #1a1a1a;
}

.country-item:hover {
    background: rgba(196, 169, 98, 0.1);
}

.country-name {
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.country-item .flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
}

.country-item .country-code {
    font-size: 0.85rem;
    color: #C4A962;
}

.phone-input {
    flex: 1;
}

.phone-format-hint {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #6c757d;
    font-family: 'Inter', sans-serif;
}

/* Password strength indicator */
.password-strength {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 3px;
    flex: 1;
    background: #e9ecef;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.strength-text {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    min-width: 100px;
    font-family: 'Inter', sans-serif;
}

/* Password strength levels */
.password-strength.weak .strength-bar:nth-child(1) {
    background: #dc3545;
}

.password-strength.fair .strength-bar:nth-child(-n+2) {
    background: #fd7e14;
}

.password-strength.good .strength-bar:nth-child(-n+3) {
    background: #20c997;
}

.password-strength.strong .strength-bar {
    background: #198754;
}

/* Form options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.4;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: color 0.3s ease;
}

.checkbox-wrapper:hover {
    color: #1a1a1a;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    background: #ffffff;
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: var(--gradient-1);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(139, 111, 142, 0.3);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: checkDraw 0.2s ease;
}

@keyframes checkDraw {
    0% { opacity: 0; transform: rotate(45deg) scale(0); }
    100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

.forgot-password-link, .terms-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    font-family: 'Inter', sans-serif;
    background: none;
    border: none;
    cursor: pointer;
}

.forgot-password-link:hover, .terms-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Verification methods */
.verification-method-group {
    margin: 20px 0;
}

.verification-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.verification-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Single option styling */
.verification-options:has(.radio-option:only-child) {
    justify-content: center;
}

/* Fallback for browsers that don't support :has() */
.verification-options .radio-option:only-child {
    margin: 0 auto;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #495057;
    transition: color 0.3s ease;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    padding: 6px 10px;
    border-radius: 6px;
}

.radio-option:hover {
    color: #1a1a1a;
    background: #f8f9fa;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    background: #ffffff;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
    background: var(--gradient-1);
    box-shadow: 0 2px 8px rgba(139, 111, 142, 0.3);
}

.radio-option input[type="radio"]:checked + .radio-custom::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: radioCheck 0.2s ease;
}

@keyframes radioCheck {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.radio-option input[type="radio"]:checked ~ .radio-text {
    color: var(--primary-color);
    font-weight: 600;
}

.radio-text {
    transition: all 0.3s ease;
}

/* OTP input styling */
.otp-input-container {
    position: relative;
}

.otp-input-container input {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 6px;
    text-align: center;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    font-family: 'SF Mono', 'Monaco', monospace;
    color: #1a1a1a;
}

.otp-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 111, 142, 0.1);
}

/* Turnstile wrapper */
.turnstile-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    position: relative;
    z-index: 1;
    width: 100%;
    overflow: hidden;
}

/* Ensure Turnstile renders properly on mobile */
.cf-turnstile {
    max-width: 100%;
    transform-origin: center;
}

/* Mobile responsiveness for Turnstile */
@media (max-width: 768px) {
    .turnstile-wrapper {
        margin: 15px 0;
        padding: 0 10px;
    }
    
    .cf-turnstile {
        transform: scale(0.85);
        transform-origin: center;
    }
}

@media (max-width: 480px) {
    .cf-turnstile {
        transform: scale(0.75);
    }
}

/* Firefox mobile specific fixes */
@-moz-document url-prefix() {
    .turnstile-wrapper {
        isolation: isolate;
        contain: layout;
    }
    
    .cf-turnstile {
        position: relative;
        z-index: 10;
    }
}

/* Submit buttons using website styling */
.auth-form .btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
}

/* Loading states */
.btn-loader {
    display: none;
    width: 18px;
    height: 18px;
}

.btn.loading .btn-text,
.btn.loading .btn-arrow {
    opacity: 0;
}

.btn.loading .btn-loader {
    display: block;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Back buttons */
.back-to-login, .back-to-signup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    font-family: 'Inter', sans-serif;
    border-radius: 6px;
}

.back-to-login:hover, .back-to-signup:hover {
    color: var(--primary-color);
    background: #f8f9fa;
}

.back-to-login svg, .back-to-signup svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    transition: transform 0.3s ease;
}

.back-to-login:hover svg, .back-to-signup:hover svg {
    transform: translateX(-2px);
}

/* OTP options */
.otp-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.resend-otp {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.resend-otp:hover {
    color: var(--primary-dark);
}

/* Responsive design */
@media (max-width: 768px) {
    #auth-hero .hero-content {
        padding: 20px 15px;
    }
    
    .auth-container {
        max-width: 100%;
        margin: 0 15px;
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .phone-input-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .country-selector {
        min-width: auto;
    }
    
    .country-dropdown {
        width: 100%;
    }
    
    .verification-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .otp-options {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 12px;
    }
    
    .otp-input-container input {
        letter-spacing: 4px;
        font-size: 1rem;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 25px 15px;
    }
    
    .form-input-wrapper input,
    .selected-country {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .checkbox-wrapper {
        font-size: 0.85rem;
    }
    
    .verification-method-group {
        margin: 15px 0;
    }
    
    .otp-input-container input {
        padding: 14px;
        letter-spacing: 3px;
        font-size: 0.95rem;
    }
}