/* Modern Authentication Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #FFFFFF;
    overflow-x: hidden;
}

/* Background Images */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

.bg-image-1 {
    animation: slideBackground1 20s ease-in-out infinite;
}

.bg-image-2 {
    animation: slideBackground2 20s ease-in-out infinite reverse;
}

@keyframes slideBackground1 {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.05; transform: scale(1.02); }
}

@keyframes slideBackground2 {
    0%, 100% { opacity: 0.05; transform: scale(1.02); }
    50% { opacity: 0.1; transform: scale(1); }
}

/* Alert Messages */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(46, 93, 80, 0.15);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid #2E5D50;
    font-family: inherit;
}

.alert-success { 
    border-left-color: #2E5D50; 
    background: rgba(46, 93, 80, 0.02);
}
.alert-error { 
    border-left-color: #dc3545; 
    background: rgba(220, 53, 69, 0.02);
}
.alert-warning { 
    border-left-color: #ffc107; 
    background: rgba(255, 193, 7, 0.02);
}

.alert-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.alert-content i {
    font-size: 18px;
    color: #2E5D50;
}

.alert-success .alert-content i { color: #2E5D50; }
.alert-error .alert-content i { color: #dc3545; }
.alert-warning .alert-content i { color: #ffc107; }

.alert-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.alert-close:hover {
    background: #f0f0f0;
    color: #666;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Main Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #FFFFFF;
}

.auth-card {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(46, 93, 80, 0.1);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(46, 93, 80, 0.08);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2E5D50, #3B7263);
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #2E5D50, #3B7263);
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(46, 93, 80, 0.3);
}

.auth-logo i {
    font-size: 28px;
    color: white;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

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

.step-info {
    text-align: center;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(46, 93, 80, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(46, 93, 80, 0.1);
}

.step-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

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

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 18px;
    color: #999;
    z-index: 2;
    transition: color 0.2s ease;
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 400;
    background: #FFFFFF;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: #2E5D50;
    box-shadow: 0 0 0 3px rgba(46, 93, 80, 0.1);
}

.form-input:focus + .input-icon,
.form-input:not(:placeholder-shown) + .input-icon {
    color: #2E5D50;
}

.form-input.code-input {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: #2E5D50;
    background: rgba(46, 93, 80, 0.05);
}

/* Buttons */
.auth-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.auth-btn.primary {
    background: linear-gradient(135deg, #2E5D50, #3B7263);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(46, 93, 80, 0.3);
    font-family: inherit;
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 93, 80, 0.4);
    background: linear-gradient(135deg, #3B7263, #4A8370);
}

.auth-btn.secondary {
    background: rgba(46, 93, 80, 0.05);
    color: #2E5D50;
    border: 2px solid rgba(46, 93, 80, 0.2);
    font-family: inherit;
}

.auth-btn.secondary:hover {
    background: rgba(46, 93, 80, 0.1);
    border-color: rgba(46, 93, 80, 0.3);
}

.btn-text {
    font-weight: 600;
}

.btn-icon {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.auth-btn:hover .btn-icon {
    transform: translateX(2px);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.checkbox {
    width: 16px;
    height: 16px;
    accent-color: #2E5D50;
}

.forgot-link {
    color: #2E5D50;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #3B7263;
    text-decoration: underline;
}

/* Social Login */
.social-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.social-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.divider-text {
    background: #FFFFFF;
    padding: 0 16px;
    color: #999;
    font-size: 14px;
}

.social-buttons {
    display: flex;
    gap: 12px;
}

.social-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: #FFFFFF;
    color: #666;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    opacity: 0.6;
    font-family: inherit;
}

.social-btn i {
    font-size: 18px;
}

.coming-soon {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ffc107;
    color: #856404;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}

/* Resend Section */
.resend-section {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.resend-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

/* Password Requirements */
.password-requirements {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(46, 93, 80, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(46, 93, 80, 0.1);
}

.requirement-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.requirement-list {
    list-style: none;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.requirement-icon {
    font-size: 12px;
    color: #2E5D50;
}

/* Navigation */
.form-navigation {
    margin-top: 20px;
}

.nav-btn {
    background: none;
    border: none;
    color: #2E5D50;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.2s ease;
    font-family: inherit;
}

.nav-btn:hover {
    color: #3B7263;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.auth-footer-text {
    font-size: 14px;
    color: #666;
}

.auth-link {
    color: #2E5D50;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #3B7263;
    text-decoration: underline;
}

/* Back to Shopping Link */
.back-to-shopping {
    text-align: center;
    margin-top: 24px;
    margin-bottom: 16px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.back-to-shopping .nav-btn {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid #e9ecef;
}

.back-to-shopping .nav-btn:hover {
    color: #2E5D50;
    background: #f8f9fa;
    border-color: #dee2e6;
    text-decoration: none;
}

.back-to-shopping .nav-btn i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.back-to-shopping .nav-btn:hover i {
    transform: translateX(-2px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2E5D50, #3B7263);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 1s linear infinite;
}

.loading-spinner i {
    font-size: 24px;
    color: #FFFFFF;
    animation: spin 1s linear infinite reverse;
}

.loading-text {
    font-size: 16px;
    color: #666;
    font-weight: 500;
    font-family: inherit;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px;
        border-radius: 16px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .form-input {
        padding: 14px 14px 14px 44px;
    }
    
    .auth-btn {
        padding: 14px 20px;
    }
    
    .alert {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 20px;
    }
    
    .form-input.code-input {
        font-size: 20px;
        letter-spacing: 2px;
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .back-to-shopping {
        margin-top: 20px;
        margin-bottom: 12px;
        padding-top: 16px;
    }
    
    .back-to-shopping .nav-btn {
        font-size: 13px;
        padding: 8px 12px;
        gap: 6px;
    }
}

/* Animation for form transitions */
.form-step-enter {
    animation: slideInUp 0.3s ease;
}

.form-step-exit {
    animation: slideOutDown 0.3s ease;
}

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

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

/* Focus states for accessibility */
.auth-btn:focus,
.form-input:focus,
.password-toggle:focus,
.nav-btn:focus {
    outline: 2px solid #2E5D50;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid #000;
    }
    
    .form-input {
        border-color: #000;
    }
    
    .auth-btn.primary {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PROGRESS INDICATOR ===== */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 2rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    border: 2px solid transparent;
}

.step-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
    transition: color 0.3s ease;
}

.progress-step.active .step-number {
    background: #2E5D50;
    color: white;
    border-color: #2E5D50;
    transform: scale(1.1);
}

.progress-step.active .step-label {
    color: #2E5D50;
    font-weight: 600;
}

.progress-step.completed .step-number {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.progress-step.completed .step-label {
    color: #28a745;
}

.progress-step.completed .step-number::after {
    content: "✓";
    font-size: 16px;
    font-weight: bold;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: #e9ecef;
    margin: 0 1rem;
    position: relative;
    top: -20px;
    transition: background-color 0.3s ease;
}

.progress-line.completed {
    background: #28a745;
}

/* ===== STEP NAVIGATION ===== */
.step-navigation {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.nav-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-info {
    text-align: center;
}

.step-counter {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    margin: 0;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-btn:hover {
    background: #f8f9fa;
    color: #2E5D50;
    transform: translateX(-2px);
}

.nav-btn i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.nav-btn:hover i {
    transform: translateX(-2px);
}

/* ===== ENHANCED STEP CONTAINERS ===== */
.step-container {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.step-container.active {
    display: block;
}

.step-container.exiting {
    animation: fadeOutDown 0.3s ease;
}

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

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

/* ===== EMAIL DISPLAY ENHANCEMENT ===== */
.email-display {
    color: #2E5D50;
    font-weight: 600;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
}

/* ===== FORM ACTIONS ENHANCEMENT ===== */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.auth-btn.secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.auth-btn.secondary:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

/* ===== RESPONSIVE ENHANCEMENTS ===== */
@media (max-width: 768px) {
    .progress-indicator {
        padding: 0 1rem;
        margin-bottom: 1.5rem;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 13px;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .progress-line {
        margin: 0 0.5rem;
    }
    
    .nav-actions {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-btn {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .progress-indicator {
        transform: scale(0.9);
        margin-bottom: 1rem;
    }
    
    .form-actions {
        gap: 0.5rem;
    }
    
    .auth-btn {
        padding: 0.75rem 1rem;
        font-size: 14px;
    }
}

/* ===== INFO ALERT STYLES ===== */
.alert-info {
    border-left-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.02);
}

.alert-info .alert-content i {
    color: #0ea5e9;
}

.alert-info .auth-link {
    color: #0ea5e9;
    font-weight: 600;
    text-decoration: underline;
}

.alert-info .auth-link:hover {
    color: #0284c7;
    text-decoration: none;
}

/* ===== SOCIAL BUTTON ENHANCEMENTS ===== */
.social-btn {
    position: relative;
    overflow: visible;
}

.social-btn .coming-soon {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
    white-space: nowrap;
}

.social-btn:hover .coming-soon {
    background: #ff5252;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Enhanced social button styling */
.social-btn.google-btn {
    background: #ffffff;
    border: 1px solid #dadce0;
    color: #3c4043;
    transition: all 0.2s ease;
}

.social-btn.google-btn:hover {
    background: #f8f9fa;
    border-color: #c1c7cd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.social-btn.google-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.social-btn.google-btn:disabled:hover {
    background: #ffffff;
    border-color: #dadce0;
    box-shadow: none;
    transform: none;
}

/* Pulse animation for coming soon badge */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ===== ALERT POSITIONING & TRANSITIONS ===== */
.alert {
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.alert:not(:last-child) {
    margin-bottom: 0.5rem;
}

/* Ensure alerts stack properly */
#dynamic-alert {
    z-index: 1001;
}

#registration-hint {
    z-index: 1000;
    margin-top: 0.5rem;
}

/* Smooth fade transitions */
.alert {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Animation for alert removal */
.alert.removing {
    opacity: 0;
    transform: translateY(-10px);
}
