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

:root {
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-850: #1f1f23;
    --gray-900: #18181b;
    --gray-950: #09090b;
    --red-500: #ef4444;
    --yellow-500: #eab308;
    --blue-500: #3b82f6;
}

body {
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    background: var(--gray-950);
    color: var(--gray-300);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== PASSWORD GATE ==================== */
.password-gate {
    position: fixed;
    inset: 0;
    background: var(--gray-950);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.password-gate.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.password-box {
    text-align: center;
    padding: 48px;
}

.password-box .logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 32px;
    font-weight: 600;
    color: var(--green-500);
    margin-bottom: 8px;
}

.password-box h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.password-box p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 32px;
}

.password-input-group {
    display: flex;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.password-input-group input {
    flex: 1;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    padding: 14px 18px;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: border-color 0.2s;
}

.password-input-group input:focus {
    border-color: var(--green-500);
}

.password-input-group button {
    background: var(--green-500);
    color: var(--gray-950);
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.password-input-group button:hover {
    background: var(--green-400);
}

.password-error {
    color: var(--red-500);
    font-size: 13px;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.password-error.visible {
    opacity: 1;
}

/* ==================== APP LAYOUT ==================== */
.app {
    display: none;
}

.app.visible {
    display: block;
}

/* ==================== HEADER ==================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.logo-mark {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 18px;
    color: var(--green-500);
}

.logo-text {
    font-weight: 600;
    font-size: 16px;
    color: white;
    letter-spacing: -0.02em;
}

nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

nav a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

nav a:hover,
nav a.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

nav a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.beta-badge {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--green-400);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
    margin-left: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==================== PAGES ==================== */
.page {
    display: none;
    padding-top: 64px;
}

.page.active {
    display: block;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--green-500);
    color: var(--gray-950);
}

.btn-primary:hover {
    background: var(--green-400);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ==================== HERO SECTION ==================== */
.hero {
    padding: 100px 32px 80px;
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.hero-content {
    max-width: 540px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--green-500);
    margin-bottom: 24px;
}

.hero h1 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 56px;
    font-weight: 800;
    color: white;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--green-400) 0%, var(--green-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 18px;
    color: var(--gray-400);
    line-height: 1.7;
    margin-bottom: 36px;
}

.hero-ctas {
    display: flex;
    gap: 12px;
}

/* ==================== HERO CARD ==================== */
.hero-visual {
    position: relative;
}

.hero-card {
    background: var(--gray-900);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.hero-card-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

.hero-card-title {
    margin-left: 8px;
    font-size: 13px;
    color: var(--gray-500);
}

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

.mini-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.mini-feature {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--green-400);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.mini-feature.muted {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--gray-500);
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.mini-stat {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.mini-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 600;
    color: var(--green-400);
}

.mini-stat-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ==================== FEATURES SECTION ==================== */
.features-section {
    padding: 80px 32px;
    max-width: 1280px;
    margin: 0 auto;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--green-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.section-title {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 40px;
    font-weight: 800;
    color: white;
    margin-bottom: 48px;
    letter-spacing: -0.02em;
}

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

.feature-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: rgba(34, 197, 94, 0.3);
    transform: translateY(-4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--gray-400);
    line-height: 1.6;
}

/* ==================== FOOTER ==================== */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 40px 32px;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
}

/* ==================== ERROR TOAST ==================== */
.error-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #7f1d1d;
    border: 1px solid var(--red-500);
    color: #fecaca;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1001;
}

.error-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 32px;
}

.modal-overlay.visible {
    display: flex;
}

.modal {
    background: var(--gray-900);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal.wide {
    max-width: 800px;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--gray-400);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    margin-top: 20px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    font-size: 14px;
    color: var(--gray-400);
    line-height: 1.6;
    margin-bottom: 12px;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.modal-body li {
    font-size: 14px;
    color: var(--gray-400);
    line-height: 1.6;
    margin-bottom: 6px;
}

.modal-body code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--green-400);
}

.modal-body .highlight {
    color: var(--green-400);
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Walkthrough Steps */
.walkthrough-step {
    background: var(--gray-850);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--green-500);
    color: var(--gray-950);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--gray-400);
    margin: 0;
}

/* Model Comparison */
.model-comparison {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.model-compare-card {
    background: var(--gray-850);
    border-radius: 12px;
    padding: 20px;
}

.model-compare-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.model-compare-card .tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.model-compare-card .tag.recommended {
    background: rgba(34, 197, 94, 0.2);
    color: var(--green-400);
}

.model-compare-card .tag.stable {
    background: rgba(59, 130, 246, 0.2);
    color: var(--blue-500);
}

.model-compare-card .tag.fast {
    background: rgba(234, 179, 8, 0.2);
    color: var(--yellow-500);
}

.model-compare-card h5 {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    margin-top: 12px;
    margin-bottom: 6px;
}

.model-compare-card ul {
    margin-left: 16px;
    margin-bottom: 0;
}

.model-compare-card li {
    font-size: 12px;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-300);
}

.form-group input,
.form-group select {
    background: var(--gray-850);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 14px;
    color: white;
    font-size: 14px;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--green-500);
}

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

.formula-preview {
    background: var(--gray-850);
    border-radius: 8px;
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--green-400);
}

/* Training Modal */
.training-modal {
    background: var(--gray-900);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 48px 56px;
    text-align: center;
    max-width: 400px;
}

.training-spinner {
    width: 56px;
    height: 56px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--green-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.training-modal h3 {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.training-modal p {
    font-size: 14px;
    color: var(--gray-400);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1100px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .builder-layout {
        grid-template-columns: 1fr;
    }
    
    .builder-sidebar,
    .results-panel {
        display: none;
    }
    
    .model-comparison {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 36px;
    }
    
    nav {
        display: none;
    }
    
    .target-cards,
    .preset-cards,
    .feature-grid {
        grid-template-columns: 1fr;
    }
}
