/* LexStrato — global styles */

:root {
  --primary: #0f766e;            /* teal */
  --primary-hover: #0d5c55;
  --accent: #f59e0b;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0f172a;
    --surface-2: #111827;
    --surface-3: #1f2937;
    --border: #1f2937;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--surface-2); color: var(--text); font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; font-size: 15px; line-height: 1.5; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* layout */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 80px; }
.nav { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--text); font-weight: 500; font-size: 14px; }

/* typography */
h1 { font-size: 32px; margin: 0 0 12px; letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: 22px; margin: 0 0 10px; letter-spacing: -0.02em; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
p.muted, .muted { color: var(--muted); }

/* hero */
.hero { padding: 60px 0; text-align: center; }
.hero h1 { font-size: 48px; margin-bottom: 20px; }
.hero .lede { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; transition: all .15s ease; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: white; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, .select, textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
.input:focus, .select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

/* upload zone */
.upload {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center; background: var(--surface);
  transition: all .15s ease; cursor: pointer;
}
.upload:hover, .upload.drag { border-color: var(--primary); background: var(--surface-3); }
.upload-filename { font-weight: 600; color: var(--primary); }

/* language chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; user-select: none;
}
.chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.chip.disabled { opacity: 0.4; cursor: not-allowed; }

/* preflight card */
.preflight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin: 12px 0; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.kv-value { font-size: 18px; font-weight: 700; }
.gate-pass { color: var(--ok); font-weight: 600; }
.gate-fail { color: var(--danger); font-weight: 600; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* status badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-err { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* toast */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 14px; }
.toast-error { border-color: var(--danger); color: var(--danger); }
.toast-success { border-color: var(--ok); color: var(--ok); }

/* modal / paywall */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal { position: relative; max-width: 440px; width: 100%; z-index: 1; }

/* progress */
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); transition: width .3s ease; position: relative; }
.progress-bar.busy::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: progress-shimmer 1.2s linear infinite;
}
@keyframes progress-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* spinner */
.spinner {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 8px;
  border: 2px solid var(--surface-3); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* utility */
.row { display: flex; gap: 12px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-8 { gap: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
