/* ========================================
   Lead Qualification Assistant
   Client UI - Lead Submission Interface
   ======================================== */

/* CSS Variables - Matching Landing Theme */
:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #18181f;
    --bg-elevated: #1e1e28;
    --bg-hover: #262632;
    --bg-input: #15151d;

    /* Text */
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;

    /* Accent - Teal/Cyan */
    --accent-primary: #14b8a6;
    --accent-secondary: #0d9488;
    --accent-glow: rgba(20, 184, 166, 0.15);
    --accent-border: rgba(20, 184, 166, 0.3);
    --accent-light: rgba(20, 184, 166, 0.08);

    /* Hot - Amber/Orange for warnings */
    --hot-primary: #f59e0b;
    --hot-glow: rgba(245, 158, 11, 0.15);

    /* Success */
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.15);
    --success-border: rgba(34, 197, 94, 0.3);

    /* Error */
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.15);
    --error-border: rgba(239, 68, 68, 0.3);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);
    --border-focus: rgba(20, 184, 166, 0.5);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Typography */
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App Layout */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

.demo-back {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.demo-back:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.demo-back-icon {
    width: 1rem;
    height: 1rem;
}

.header-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-xl);
    max-width: 100%;
}

/* Form Container */
.form-container {
    width: 100%;
    max-width: 580px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Form Header */
.form-header {
    padding: var(--space-xl) var(--space-xl) 0;
    text-align: center;
}

.form-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.form-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    margin: var(--space-xl) var(--space-xl) 0;
}

.progress-fill {
    position: absolute;
    top: 20px;
    left: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width var(--transition-slow);
    width: 0%;
}

.progress-fill[data-progress="33"] { width: 33%; }
.progress-fill[data-progress="66"] { width: 66%; }
.progress-fill[data-progress="100"] { width: 100%; }

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    z-index: 1;
}

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

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

.step.completed .step-number {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--transition-normal);
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--text-secondary);
}

/* Form */
.form {
    padding: var(--space-xl);
}

.form-step {
    display: none;
    animation: fadeIn var(--transition-normal);
}

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

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

/* Form Section */
.form-section {
    margin-bottom: var(--space-xl);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.section-desc {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Labels */
.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.required {
    color: var(--hot-primary);
    margin-left: 2px;
}

/* Inputs */
.input,
.select,
.textarea {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-muted);
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input.error,
.textarea.error,
.select.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-glow);
}

.input.success,
.textarea.success,
.select.success {
    border-color: var(--success);
}

/* Textarea */
.textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.5;
}

/* Select */
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7L10 12L15 7' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    padding-right: var(--space-2xl);
    cursor: pointer;
}

/* Hints */
.hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Char Counter */
.char-counter {
    display: flex;
    justify-content: flex-end;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.char-counter.warning {
    color: var(--hot-primary);
}

/* Validation Message */
.validation-message {
    display: none;
    font-size: 0.8125rem;
    color: var(--error);
    margin-top: var(--space-sm);
    align-items: center;
    gap: var(--space-xs);
}

.validation-message.visible {
    display: flex;
}

.validation-message.success {
    color: var(--success);
}

/* Contact Requirement */
.contact-requirement {
    display: none;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--hot-glow);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--hot-primary);
    margin-top: var(--space-md);
}

.contact-requirement.visible {
    display: flex;
    animation: shake var(--transition-normal);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.icon-warning {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.875rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-icon-left {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-tertiary);
}

.btn-next,
.btn-submit {
    width: 100%;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.form-actions .btn-ghost {
    flex: 0 0 auto;
    min-width: 100px;
}

.form-actions .btn-primary {
    flex: 1;
}

/* Privacy Note */
.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.icon-lock {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

/* Success Container */
.success-container,
.error-container {
    display: none;
    width: 100%;
    max-width: 580px;
    animation: fadeIn var(--transition-slow);
}

.success-content,
.error-content {
    text-align: center;
    padding: var(--space-2xl);
}

.success-icon,
.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-xl);
}

.success-icon svg {
    width: 100%;
    height: 100%;
    color: var(--success);
}

.error-icon svg {
    width: 100%;
    height: 100%;
    color: var(--error);
}

.success-title,
.error-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.success-title {
    color: var(--success);
}

.error-title {
    color: var(--error);
}

.success-desc,
.error-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto var(--space-xl);
}

/* Lead ID Box */
.lead-id-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
}

.lead-id-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lead-id-value {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Next Steps */
.next-steps {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: left;
}

.next-steps-title {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.next-steps-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.next-step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.next-step-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.next-step-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.next-step-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.next-step-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.next-step-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Error Actions */
.error-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* Footer */
.footer {
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-divider {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: var(--space-md) var(--space-lg);
    }

    .main {
        padding: var(--space-lg) var(--space-md);
    }

    .form-container {
        max-width: none;
    }

    .form-header,
    .form {
        padding: var(--space-lg);
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-ghost {
        width: 100%;
    }

    .success-content,
    .error-content {
        padding: var(--space-lg);
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions .btn {
        width: 100%;
    }
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bg-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

/* Focus Visible */
.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Print */
@media print {
    .header,
    .footer,
    .btn {
        display: none;
    }

    .main {
        padding: 0;
    }

    .form-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}