/* ============================================
   HireModeler - Complete Stylesheet
   Headcount Decision Simulator
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #15151f;
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --text-muted: #6b6b7b;
    --accent-primary: #10b981;
    --accent-secondary: #34d399;
    --accent-light: #6ee7b7;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --border-color: #2a2a3a;
    --border-light: #3a3a4a;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition: 0.2s ease;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

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

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    top: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-light);
}

/* ============================================
   Container
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

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

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

.btn-social {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    width: 100%;
}

.btn-social:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading .btn-text { display: none; }
.btn:not(.btn-loading) .btn-spinner { display: none; }

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

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

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-logo span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a:not(.btn) {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-links a:not(.btn):hover {
    color: var(--text-primary);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: 140px 24px 80px;
    background: radial-gradient(ellipse at top, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

@media (max-width: 968px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--accent-secondary);
    margin-bottom: 24px;
}

.hero h1 {
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 540px;
}

@media (max-width: 968px) {
    .hero-subtitle { margin: 0 auto 32px; }
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 968px) {
    .hero-cta { justify-content: center; }
}

.hero-note {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Hero Visual */
.hero-visual {
    position: relative;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-card-header {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.hero-card-content {
    padding: 24px;
}

.preview-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.preview-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.preview-stat {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.preview-stat.highlight {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat-num.pessimistic { color: var(--accent-red); }
.stat-num.optimistic { color: var(--accent-green); }

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

.preview-stat.highlight .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

.preview-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--accent-secondary);
}

/* ============================================
   Sections
   ============================================ */
.section-title {
    text-align: center;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
}

/* Problem Section */
.problem-section {
    padding: 80px 24px;
    background: var(--bg-secondary);
}

.problem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .problem-grid { grid-template-columns: 1fr; }
}

.problem-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
}

.problem-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.problem-card h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.problem-card p {
    color: var(--text-secondary);
    font-style: italic;
}

.problem-reality {
    margin-top: 12px;
    font-style: normal !important;
    color: var(--accent-red) !important;
    font-size: 0.9rem;
}

/* Features Section */
.features-section {
    padding: 80px 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 968px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .features-grid { grid-template-columns: 1fr; }
}

.feature-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.feature-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.feature-card h3 {
    margin-bottom: 8px;
    font-size: 1.125rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* How It Works */
.how-section {
    padding: 80px 24px;
    background: var(--bg-secondary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

@media (max-width: 968px) {
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .steps-grid { grid-template-columns: 1fr; }
}

.step {
    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 auto 16px;
}

.step h3 {
    margin-bottom: 8px;
    font-size: 1.125rem;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Pricing Section */
.pricing-section {
    padding: 80px 24px;
}

.pricing-card {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
}

.pricing-header h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.price .currency {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.price .amount {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price .period {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.price-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: 32px;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.check-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-green);
    flex-shrink: 0;
}

.pricing-guarantee {
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Testimonials */
.testimonials-section {
    padding: 80px 24px;
    background: var(--bg-secondary);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 968px) {
    .testimonials-grid { grid-template-columns: 1fr; }
}

.testimonial {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.testimonial p {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 20px;
}

.testimonial footer {
    display: flex;
    flex-direction: column;
}

.testimonial cite {
    font-style: normal;
}

.testimonial strong {
    color: var(--text-primary);
}

.testimonial span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* CTA Section */
.cta-section {
    padding: 80px 24px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.cta-section h2 {
    margin-bottom: 16px;
}

.cta-section p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1.125rem;
}

/* Footer */
.footer {
    padding: 60px 24px 24px;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 12px;
    font-size: 0.9rem;
}

.footer-links h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

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

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
}

.auth-container {
    display: flex;
    width: 100%;
}

.auth-card {
    flex: 1;
    max-width: 480px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 968px) {
    .auth-card {
        max-width: 100%;
        padding: 32px 24px;
    }
}

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

.auth-logo {
    display: inline-block;
    color: var(--accent-primary);
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 0.85rem;
}

.form-group input {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input.error {
    border-color: var(--accent-red);
}

.password-input {
    position: relative;
}

.password-input input {
    width: 100%;
    padding-right: 48px;
}

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

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

.hint-message {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.error-message {
    font-size: 0.8rem;
    color: var(--accent-red);
    min-height: 1.2em;
}

.form-error {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 0.9rem;
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

/* Checkbox */
.checkbox-group {
    flex-direction: row !important;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Auth Side Panel */
.auth-side {
    flex: 1;
    background: linear-gradient(135deg, var(--accent-primary), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

@media (max-width: 968px) {
    .auth-side { display: none; }
}

.auth-side-content {
    max-width: 400px;
    color: white;
}

.auth-side blockquote {
    font-size: 1.25rem;
    font-style: italic;
    margin-bottom: 24px;
}

.auth-side footer {
    display: flex;
    flex-direction: column;
}

.auth-side strong {
    font-size: 1rem;
}

.auth-side span {
    opacity: 0.8;
    font-size: 0.9rem;
}

.trial-info h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.trial-info ul {
    list-style: none;
    margin-bottom: 32px;
}

.trial-info li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 1rem;
}

.trial-info .check-icon {
    color: white;
}

.price-preview {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    text-align: center;
}

.price-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 700;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard-page {
    background: var(--bg-primary);
}

.dashboard-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.dashboard-nav .nav-container {
    padding: 12px 24px;
}

.nav-user {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--text-primary);
    font-family: var(--font-sans);
}

.user-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: none;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-dropdown a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 4px 0;
}

/* Dashboard Main */
.dashboard-main {
    padding-top: 72px;
    min-height: 100vh;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    height: calc(100vh - 72px);
}

@media (max-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
}

/* Chat Panel */
.chat-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.chat-header h1 {
    font-size: 1.25rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--accent-primary);
    color: white;
}

.message-content {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-width: 85%;
}

.message.user .message-content {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    margin-left: auto;
}

.message-content p {
    margin-bottom: 12px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Chat Input */
.chat-input-form {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-input-container {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    resize: none;
    transition: border-color var(--transition);
}

#userInput:focus {
    outline: none;
    border-color: var(--accent-primary);
}

#userInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.send-btn:hover {
    background: var(--accent-secondary);
}

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

/* Visualization Panel */
.viz-panel {
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-secondary);
}

@media (max-width: 1200px) {
    .viz-panel {
        display: none;
    }
}

.viz-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.viz-card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.viz-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Scenario Stats */
.scenario-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.scenario-stats .stat {
    flex: 1;
    text-align: center;
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.scenario-stats .stat.highlight {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.scenario-stats .stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.scenario-stats .stat.highlight .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

.scenario-stats .stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.scenario-stats .stat-unit {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.scenario-stats .stat.highlight .stat-unit {
    color: rgba(255, 255, 255, 0.7);
}

/* Comparison View */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.comparison-table td {
    font-size: 0.95rem;
}

.comparison-table .better {
    color: var(--accent-green);
}

.comparison-table .worse {
    color: var(--accent-red);
}

/* Risk Meter */
.risk-meter {
    margin-bottom: 16px;
}

.risk-bar {
    height: 10px;
    background: linear-gradient(to right, var(--accent-green), var(--accent-yellow), var(--accent-red));
    border-radius: 5px;
    position: relative;
}

.risk-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 18px;
    background: white;
    border-radius: 2px;
    box-shadow: var(--shadow);
    transition: left 0.5s ease;
}

.risk-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Billing & Subscription Styles
   ============================================ */

.subscription-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 12px;
}

.subscription-badge.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.subscription-badge.trialing {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.subscription-badge.past-due {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.subscription-badge.free {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Upgrade Banner */
.upgrade-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
    padding: 12px 24px;
}

.upgrade-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.upgrade-banner-text {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-primary);
}

.upgrade-banner-text strong {
    color: var(--accent-light);
}

/* Success/Cancel Pages */
.success-page,
.cancel-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.success-card,
.cancel-card {
    max-width: 480px;
    text-align: center;
    padding: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.success-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    margin: 0 auto 24px;
    color: var(--accent-primary);
}

.cancel-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    margin: 0 auto 24px;
    color: var(--accent-red);
}

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

    html {
        scroll-behavior: auto;
    }
}
