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

:root {
    --bg: #0a0c10;
    --bg-card: #111520;
    --bg-input: #161b27;
    --border: #1e2535;
    --border-hover: #2e3850;
    --text: #e8eaf0;
    --text-muted: #6b7280;
    --text-dim: #9ca3af;
    --signal: #22c55e;
    --signal-dim: #16a34a;
    --danger: #ef4444;
    --amber: #f59e0b;
    --amber-dim: #d97706;
    --primary: #3b82f6;
    --primary-dim: #2563eb;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html, body { min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6; }

a { color: inherit; text-decoration: none; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: all .18s; text-decoration: none; }
.btn-primary { background: var(--signal); color: #000; }
.btn-primary:hover { background: var(--signal-dim); }
.btn-amber { background: var(--amber); color: #000; }
.btn-amber:hover { background: var(--amber-dim); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border-hover); }
.btn-ghost:hover { background: var(--bg-input); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Logo ── */
.logo { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.logo-dot { width: 8px; height: 8px; background: var(--signal); border-radius: 50%; display: inline-block; box-shadow: 0 0 8px var(--signal); }

/* ── Landing ── */
.landing-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; border-bottom: 1px solid var(--border); }
.header-actions { display: flex; gap: 12px; }

.hero { text-align: center; padding: 80px 20px 60px; max-width: 700px; margin: 0 auto; }
.hero h1 { font-family: 'Sora', sans-serif; font-size: clamp(28px, 5vw, 48px); font-weight: 700; line-height: 1.2; margin-bottom: 20px; }
.hero h1 span { color: var(--signal); }
.hero p { color: var(--text-dim); font-size: 17px; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.demo-section { padding: 0 20px 80px; max-width: 700px; margin: 0 auto; }
.demo-box { border: 2px dashed var(--border-hover); border-radius: var(--radius); padding: 60px 40px; text-align: center; position: relative; overflow: hidden; }
.demo-box .lock-overlay { position: absolute; inset: 0; background: rgba(10,12,16,.85); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; border-radius: var(--radius); }
.demo-upload-icon { font-size: 48px; color: var(--signal); margin-bottom: 12px; }
.demo-box h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.demo-box p { color: var(--text-muted); font-size: 14px; }
.lock-icon-big { font-size: 48px; }
.lock-title { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 700; }
.lock-sub { color: var(--text-dim); font-size: 14px; text-align: center; max-width: 260px; }

.plans-section { padding: 60px 20px 80px; max-width: 900px; margin: 0 auto; text-align: center; }
.plans-section h2 { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.plans-section .sub { color: var(--text-muted); margin-bottom: 40px; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.plan-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; text-align: left; transition: border-color .2s; }
.plan-card:hover { border-color: var(--border-hover); }
.plan-card.featured { border-color: var(--signal); }
.plan-name { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 8px; }
.plan-price { font-family: 'Sora', sans-serif; font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.plan-price span { font-size: 15px; font-weight: 400; color: var(--text-muted); }
.plan-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.plan-features li { font-size: 14px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.plan-features li::before { content: '✓'; color: var(--signal); font-weight: 700; }
.badge-popular { background: var(--signal); color: #000; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-left: 8px; }

/* ── Auth Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border-hover); border-radius: var(--radius); padding: 36px 32px; width: 100%; max-width: 420px; }
.modal-box h2 { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.modal-box .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.modal-tabs { display: flex; gap: 0; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.modal-tab { background: none; border: none; color: var(--text-muted); font-size: 14px; font-weight: 600; padding: 0 0 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; }
.modal-tab.active { color: var(--signal); border-bottom-color: var(--signal); }
.modal-tab + .modal-tab { margin-left: 24px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
.form-input { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text); font-size: 14px; font-family: var(--font); outline: none; transition: border-color .15s; }
.form-input:focus { border-color: var(--signal); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 8px; display: none; }
.form-error.show { display: block; }

/* ── App Layout ── */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--bg-card); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-logo { padding: 24px 20px 20px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); padding: 8px 8px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: none; border: none; color: var(--text-dim); font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; width: 100%; transition: all .15s; }
.nav-item:hover { background: var(--bg-input); color: var(--text); }
.nav-item.active { background: rgba(34,197,94,.12); color: var(--signal); }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.sidebar-user strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .usage-info { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-plan { background: rgba(34,197,94,.15); color: var(--signal); }
.badge-free { background: rgba(107,114,128,.15); color: var(--text-muted); }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-bottom: 1px solid var(--border); }
.app-topbar h1 { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 700; }
.page-content { flex: 1; padding: 28px; }

/* ── Upload Area ── */
.upload-area { border: 2px dashed var(--border-hover); border-radius: var(--radius); padding: 48px 32px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; position: relative; }
.upload-area:hover, .upload-area.drag-over { border-color: var(--signal); background: rgba(34,197,94,.04); }
.upload-area.locked { cursor: default; }
.upload-icon { font-size: 40px; color: var(--signal); margin-bottom: 12px; }
.upload-area h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.upload-area p { color: var(--text-muted); font-size: 13px; }
#file-input { display: none; }

.lock-gate { position: absolute; inset: 0; background: rgba(10,12,16,.88); backdrop-filter: blur(5px); border-radius: calc(var(--radius) - 2px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.lock-gate .lock-emoji { font-size: 36px; }
.lock-gate .lock-text { font-weight: 700; font-size: 16px; }
.lock-gate .lock-sub { color: var(--text-muted); font-size: 13px; text-align: center; max-width: 240px; }

/* ── Processing ── */
.processing-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; text-align: center; }
.processing-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.processing-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 24px; }
.progress-fill { height: 100%; background: var(--signal); border-radius: 2px; transition: width .3s; }

.result-box { background: var(--bg-card); border: 1px solid var(--signal); border-radius: var(--radius); padding: 28px; }
.result-preview { display: flex; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.result-img-wrap { flex: 1; min-width: 140px; }
.result-img-wrap p { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; text-align: center; }
.result-img-wrap img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Usage Bar ── */
.usage-bar-wrap { margin-bottom: 28px; }
.usage-bar-header { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.usage-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.usage-bar-fill { height: 100%; background: var(--signal); border-radius: 3px; transition: width .4s; }
.usage-bar-fill.warn { background: var(--amber); }
.usage-bar-fill.danger { background: var(--danger); }

/* ── Upgrade Banner ── */
.upgrade-banner { background: linear-gradient(135deg, rgba(34,197,94,.1), rgba(59,130,246,.08)); border: 1px solid rgba(34,197,94,.3); border-radius: var(--radius); padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.upgrade-banner h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.upgrade-banner p { color: var(--text-muted); font-size: 13px; }

/* ── Checkout ── */
.checkout-layout { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.checkout-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 520px; }
.checkout-box h2 { font-family: 'Sora', sans-serif; font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.checkout-box .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
.plan-option { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; cursor: pointer; transition: border-color .15s; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.plan-option:hover { border-color: var(--border-hover); }
.plan-option.selected { border-color: var(--signal); background: rgba(34,197,94,.06); }
.plan-option-name { font-weight: 600; font-size: 15px; }
.plan-option-desc { font-size: 12px; color: var(--text-muted); }
.plan-option-price { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 18px; white-space: nowrap; }

/* ── Upgrade Modal ── */
.upgrade-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s; }
.upgrade-modal-overlay.show { opacity: 1; pointer-events: all; }
.upgrade-modal { background: var(--bg-card); border: 1px solid var(--border-hover); border-radius: var(--radius); padding: 36px 32px; max-width: 420px; width: 100%; text-align: center; }
.upgrade-modal h2 { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.upgrade-modal p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .landing-header { padding: 16px 20px; }
    .hero { padding: 48px 16px 40px; }
    .demo-section, .plans-section { padding-left: 16px; padding-right: 16px; }
    .page-content { padding: 16px; }
    .sidebar { width: 180px; }
    .result-preview { flex-direction: column; }
}
