/* Modern Auth & Onboarding Styles */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #16a34a 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --error-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 30px 60px rgba(0, 0, 0, 0.25);
    --auth-primary: #667eea;
    --auth-primary-dark: #5a67d8;
    --auth-gradient: var(--primary-gradient);
    --auth-border: #d1d5db;
    --auth-white: #ffffff;
    --auth-transition: all 0.3s ease;
    --auth-error: #ef4444;
    --auth-success: #10b981;
    --auth-radius: 12px;
    --auth-text-light: #64748b;
    --auth-text-muted: #9ca3af;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    overflow-x: hidden;
}

/* Base Container Styles */
.signup-container, .onboarding-container, .confirmation-container, .redirect-container, .auth-container {
    min-height: 100vh;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.signup-container::before, .onboarding-container::before, .auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.signup-card, .onboarding-card, .confirmation-card, .redirect-card, .auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-strong);
    max-width: 600px;
    width: 100%;
    padding: 48px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.signup-card::before, .onboarding-card::before, .confirmation-card::before, .redirect-card::before, .auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.step-header, .auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.step-header h1, .auth-header h1 {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 800;
    margin-bottom: 12px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.step-header p, .auth-header p {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 8px;
}

.auth-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 28px;
    font-weight: 800;
    color: var(--auth-primary);
}

.auth-header .logo i {
    font-size: 36px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    gap: 8px;
}

.step {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.step.active {
    background: var(--primary-gradient);
    color: white;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.step.completed {
    background: var(--success-gradient);
    color: white;
    border-color: rgba(22, 163, 74, 0.5);
}

.step::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 24px;
    height: 2px;
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-50%);
}

.step.active::after {
    background: #667eea;
}

.step.completed::after {
    background: #16a34a;
}

/* Form Styles */
.form-section {
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.form-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section h3 i {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.form-group {
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    color: #374151;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Tier Selector */
.tier-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.tier-option {
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--auth-border);
    border-radius: 6px;
    flex-shrink: 0;
    position: relative;
    transition: var(--auth-transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--auth-gradient);
    border-color: var(--auth-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--auth-white);
    font-size: 12px;
    font-weight: 700;
}

.forgot-password {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--auth-transition);
}

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

/* Button Styles */
.auth-form .btn {
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 24px;
    border-radius: var(--auth-radius);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
    color: var(--auth-white);
    transition: var(--auth-transition);
}

.auth-form .btn-primary {
    background: var(--auth-gradient);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.auth-form .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.auth-form .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-form .btn:hover::before {
    left: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 32px;
    position: relative;
    z-index: 1;
}

.auth-footer p {
    color: var(--auth-text-light);
    font-size: 14px;
    font-weight: 500;
}

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

.auth-footer a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* Error Messages */
.error-message {
    color: var(--auth-error);
    font-size: 12px;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--auth-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

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

/* Auth Messages */
.auth-message {
    padding: 16px 20px;
    border-radius: var(--auth-radius);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--auth-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--auth-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auth-message.info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--auth-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Plan Selection */
.plan-selection {
    background: var(--auth-gradient);
    color: var(--auth-white);
    padding: 20px;
    border-radius: var(--auth-radius);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.plan-selection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="30" height="30" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><circle cx="15" cy="15" r="2"/></g></g></svg>') repeat;
    animation: float 20s ease-in-out infinite;
}

.selected-plan-info {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.selected-plan-info i {
    font-size: 28px;
    opacity: 0.9;
}

.selected-plan-info div {
    display: flex;
    flex-direction: column;
}

.selected-plan-info strong {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.selected-plan-info span {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
}

/* Password Input */
.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--auth-transition);
    font-size: 16px;
}

.password-toggle:hover {
    color: var(--auth-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Password Strength */
.password-strength {
    font-size: 12px;
    margin-top: 6px;
    min-height: 16px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 640px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 32px 24px;
        max-width: 100%;
    }
    
    .auth-title {
        font-size: 28px;
    }
    
    .auth-subtitle {
        font-size: 14px;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .plan-selection {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .selected-plan-info {
        justify-content: center;
    }
}
.onboarding-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.onboarding-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-weight: 600;
}

.step.active .step-number {
    background: #6200ea;
    color: white;
}

.step.completed .step-number {
    background: #10b981;
    color: white;
}

.step-line {
    width: 40px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 8px;
}

.step.completed .step-line {
    background: #10b981;
}

.form-section {
    margin-bottom: 30px;
}

.form-section.hidden {
    display: none;
}

.submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: #6200ea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover:not(:disabled) {
    background: #3700b3;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn .loading-spinner {
    display: none;
}

.submit-btn:disabled .loading-spinner {
    display: inline-block;
}

.logo-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.logo-upload:hover {
    border-color: #6200ea;
}

.logo-upload.has-preview {
    border-style: solid;
    border-color: #10b981;
}

#logoPreview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.error-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-alert {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .auth-card,
    .onboarding-card {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .auth-title,
    .onboarding-title {
        font-size: 24px;
    }
    
    .step-line {
        width: 20px;
    }
}
