/* ============ CSS VARIABLES ============ */
:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #6366f1;
    
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: rgba(99, 102, 241, 0.1);
    
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    --border-color: #334155;
    --border-focus: #818cf8;
    
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --primary-bg: rgba(129, 140, 248, 0.1);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    
    --gradient-primary: linear-gradient(135deg, #4c1d95 0%, #5b21b6 100%);
    --gradient-secondary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-warm: linear-gradient(135deg, #831843 0%, #991b1b 100%);
}

/* ============ RESET & BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============ SIGNUP WRAPPER ============ */
.signup-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem;
}

/* ============ ANIMATED BACKGROUND ============ */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
    opacity: 0.4;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: orbit 30s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--gradient-primary);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--gradient-secondary);
    bottom: -200px;
    right: -200px;
    animation-delay: 7.5s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: var(--gradient-warm);
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    animation-delay: 15s;
}

.orb-4 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    bottom: 20%;
    left: 10%;
    animation-delay: 22.5s;
}

[data-theme="dark"] .gradient-orb {
    opacity: 0.2;
}

@keyframes orbit {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(50px, -50px) scale(1.2) rotate(90deg);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.9) rotate(180deg);
    }
    75% {
        transform: translate(-50px, -30px) scale(1.1) rotate(270deg);
    }
}

/* ============ SIGNUP CONTAINER ============ */
.signup-container {
    width: 100%;
    max-width: 1300px;
    background: var(--bg-primary);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    display: flex;
    overflow: hidden;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    min-height: 700px;
}

/* ============ SIGNUP PANELS ============ */
.signup-panel {
    flex: 1;
    padding: 3rem;
}

/* Left Panel - Form */
.signup-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    max-width: 520px;
}

.form-container {
    width: 100%;
    max-width: 440px;
}

/* Right Panel - Benefits */
.signup-benefits {
    background: var(--gradient-secondary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.signup-benefits::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="dots" width="30" height="30" patternUnits="userSpaceOnUse"><circle cx="15" cy="15" r="1.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.5;
}

.benefits-content {
    position: relative;
    z-index: 1;
}

/* ============ THEME TOGGLE ============ */
.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.theme-icon-light,
.theme-icon-dark {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

[data-theme="light"] .theme-icon-dark {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-icon-light {
    opacity: 0;
    transform: rotate(-180deg);
}

/* ============ FORM HEADER ============ */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-wrapper {
    display: inline-block;
    margin-bottom: 1rem;
}

.logo {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.form-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

/* ============ PROGRESS STEPS ============ */
.signup-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

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

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.progress-step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-step span {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.progress-step.active span {
    color: var(--primary);
}

.progress-line {
    width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.5rem;
    margin-bottom: 1.75rem;
}

/* ============ ALERTS ============ */
#alertContainer {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

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

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

.alert-info {
    background: var(--primary-bg);
    border: 1px solid var(--primary-light);
    color: var(--primary);
}

.alert.fade-out {
    animation: fadeOut 0.3s ease;
}

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

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

/* ============ OAUTH BUTTONS ============ */
.oauth-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.oauth-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.oauth-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.oauth-btn svg {
    width: 20px;
    height: 20px;
}

/* ============ DIVIDER ============ */
.divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--bg-primary);
    padding: 0 1rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

/* ============ FORM GROUPS ============ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.required {
    color: var(--error);
    font-size: 0.875rem;
}

.field-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============ INPUT WRAPPER ============ */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.75rem;
    padding-right: 2.75rem;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.input-wrapper.error input {
    border-color: var(--error);
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-tertiary);
    width: 18px;
    height: 18px;
}

.input-status {
    position: absolute;
    right: 2.75rem;
    display: flex;
    align-items: center;
}

.input-status .spinning {
    animation: spin 1s linear infinite;
}

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

/* ============ PASSWORD TOGGLE ============ */
.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
}

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

.toggle-password .show-icon,
.toggle-password .hide-icon {
    width: 18px;
    height: 18px;
}

.toggle-password .hide-icon {
    display: none;
}

.toggle-password.showing .show-icon {
    display: none;
}

.toggle-password.showing .hide-icon {
    display: block;
}

/* ============ PASSWORD STRENGTH ============ */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-bar.weak {
    background: var(--error);
}

.strength-bar.medium {
    background: var(--warning);
}

.strength-bar.strong {
    background: var(--success);
}

/* ============ PASSWORD REQUIREMENTS ============ */
.password-requirements {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    transition: color 0.3s ease;
}

.requirement.met {
    color: var(--success);
}

.req-icon {
    width: 14px;
    height: 14px;
}

/* ============ ERROR MESSAGES ============ */
.error-message {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--error);
    min-height: 1rem;
}

/* ============ CHECKBOXES ============ */
.form-options {
    margin-bottom: 1rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-right: 0.75rem;
    margin-top: 1px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper a {
    color: var(--primary);
    text-decoration: none;
}

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

/* ============ SUBMIT BUTTON ============ */
.submit-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .btn-loader {
    opacity: 1;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner circle {
    stroke-dasharray: 100;
    stroke-dashoffset: 75;
    transform-origin: center;
}

/* ============ TRIAL BADGE ============ */
.trial-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--primary-bg);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.trial-badge svg {
    width: 16px;
    height: 16px;
}

/* ============ FORM FOOTER ============ */
.form-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.security-note svg {
    width: 14px;
    height: 14px;
}

/* ============ BENEFITS SECTION ============ */
.benefits-header {
    margin-bottom: 2rem;
}

.benefits-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.benefits-header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Benefits List */
.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.benefit-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.benefit-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.benefit-icon svg {
    width: 20px;
    height: 20px;
}

.benefit-text h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.benefit-text p {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Testimonial Card */
.testimonial-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
}

.quote-icon {
    font-size: 3rem;
    opacity: 0.2;
    position: absolute;
    top: 0.5rem;
    left: 1rem;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.author-info strong {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.author-info span {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .signup-container {
        flex-direction: column;
        max-width: 520px;
    }
    
    .signup-benefits {
        padding: 2rem;
        min-height: auto;
    }
    
    .benefits-header h2 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        margin-bottom: 1.5rem;
    }
    
    .benefits-list {
        display: none;
    }
}

@media (max-width: 640px) {
    .signup-wrapper {
        padding: 0;
        align-items: stretch;
    }
    
    .signup-container {
        border-radius: 0;
        min-height: 100vh;
        max-width: 100%;
    }
    
    .signup-benefits {
        display: none;
    }
    
    .signup-form-panel {
        flex: 1;
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    
    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }
    
    .oauth-buttons {
        flex-direction: column;
    }
    
    .progress-line {
        width: 40px;
    }
    
    .gradient-orb {
        filter: blur(120px);
    }
}