/* ═══════════════════════════════════════════════════════════════════
   Ordobase — design system
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --bg:            #f5f4f0;
  --bg-alt:        #eeecea;
  --ink:           #141412;
  --ink-2:         #3a3832;
  --muted:         #787368;
  --line:          #dddad4;
  --card:          #ffffff;
  --brand:         #1f7a57;
  --brand-dark:    #155240;
  --brand-light:   #e8f4ef;
  --accent:        #c48a2f;
  --accent-light:  #f8f0de;
  --danger:        #b52929;

  /* Geometry */
  --radius:        12px;
  --radius-lg:     18px;
  --radius-sm:     8px;
  --shadow:        0 2px 8px rgba(20,20,18,0.06), 0 8px 24px rgba(20,20,18,0.06);
  --shadow-lg:     0 4px 16px rgba(20,20,18,0.08), 0 16px 48px rgba(20,20,18,0.10);

  /* Type */
  --font-sans:     "Inter", "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono:     "IBM Plex Mono", "Fira Code", "Cascadia Code", monospace;
}

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.01em; margin-bottom: 0.5rem; }
h3 { font-size: 1.05rem; font-weight: 600; }

p { color: var(--ink-2); }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.875em; background: var(--bg-alt); padding: 1px 5px; border-radius: 4px; }

/* ── Layout shell ─────────────────────────────────────────────────── */
.site-shell {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Header ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  background: rgba(245,244,240,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 30%, var(--accent));
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: var(--bg-alt); text-decoration: none; color: var(--ink); }

.inline-form { display: inline; }
.link-button {
  background: none; border: 0;
  color: var(--ink-2); cursor: pointer;
  padding: 6px 10px;
  font: inherit; font-size: 0.9rem; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.link-button:hover { background: var(--bg-alt); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.button:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.button:active { transform: scale(0.97); }

/* Nav register button — uses outline style for better contrast in header */
.button-nav {
  background: transparent;
  color: var(--brand-dark);
  border: 1.5px solid var(--brand);
  padding: 6px 16px;
  font-size: 0.9rem;
}
.button-nav:hover { background: var(--brand-light); color: var(--brand-dark); }

.button-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--line);
}
.button-ghost:hover { background: var(--bg-alt); }

.button-outline {
  background: transparent;
  color: var(--brand-dark);
  border: 1.5px solid var(--brand);
}
.button-outline:hover { background: var(--brand-light); }

.button-danger { background: var(--danger); }
.button-danger:hover { background: #8f1f1f; }

.button-lg { padding: 13px 26px; font-size: 1rem; }
.button-sm { padding: 5px 12px; font-size: 0.82rem; }
.button-block { width: 100%; }

/* ── Mobile nav toggle ────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 0;
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink-2);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Flash messages ───────────────────────────────────────────────── */
.flash {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 0.9rem;
}
.flash-success { background: #d9f0e7; color: #0f3d27; border-left: 3px solid var(--brand); }
.flash-error   { background: #fde6e6; color: #7d1f1f; border-left: 3px solid var(--danger); }

/* ── Section utility ──────────────────────────────────────────────── */
.section { margin: 72px 0; }
.section-header { margin-bottom: 36px; }
.section-header h2 { margin-bottom: 8px; }
.section-intro { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.section-muted { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }

/* ═══ HERO ═══════════════════════════════════════════════════════════ */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin: 48px 0 72px;
}

.hero-text { max-width: 580px; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  margin-bottom: 16px;
}

.hero-text h1 { margin-bottom: 16px; }
.lead {
  font-size: 1.1rem;
  color: var(--ink-2);
  line-height: 1.65;
  max-width: 52ch;
  margin-bottom: 24px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-dark);
  background: var(--brand-light);
  border: 1px solid #c2ddd5;
  border-radius: 999px;
  padding: 4px 12px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.hero-note {
  font-size: 0.85rem;
  color: var(--muted);
}
.hero-note a { color: var(--muted); text-decoration: underline; }

/* ── App mockup ───────────────────────────────────────────────────── */
.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-mockup {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  background: #1e1e1c;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.06);
  overflow: hidden;
  font-size: 0.75rem;
}

.mockup-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #2a2a28;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mockup-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
}
.mockup-title {
  margin-left: auto;
  color: rgba(255,255,255,0.3);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.mockup-body {
  display: grid;
  grid-template-columns: 140px 1fr;
  height: 260px;
}

.mockup-sidebar {
  padding: 10px 6px;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mockup-item {
  padding: 5px 8px;
  border-radius: 6px;
  color: rgba(255,255,255,0.45);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.mockup-item-active {
  background: rgba(31,122,87,0.25);
  color: #7de0b5;
}
.mockup-indent { padding-left: 20px; font-size: 0.7rem; }
.mockup-group { margin-top: 4px; }
.mockup-badge {
  font-size: 0.65rem;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 1px 5px;
  font-weight: 700;
}

.mockup-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mockup-doc-title { color: rgba(255,255,255,0.85); font-weight: 600; font-size: 0.85rem; }
.mockup-doc-meta  { color: rgba(255,255,255,0.25); font-size: 0.7rem; }
.mockup-doc-body  { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }

.mockup-line {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
}
.mockup-line-h2    { height: 12px; width: 55%; background: rgba(255,255,255,0.18); }
.mockup-line       { width: 100%; }
.mockup-line-short { width: 40%; }
.mockup-line-medium { width: 70%; }

/* ═══ FEATURES ═══════════════════════════════════════════════════════ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.feature-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.feature-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}
.feature-card h3 { margin-bottom: 0; }
.feature-card p  { font-size: 0.92rem; color: var(--muted); line-height: 1.55; }

/* ═══ EXTENSIONS ═════════════════════════════════════════════════════ */
.extensions-section { background: var(--bg-alt); border-radius: var(--radius-lg); padding: 48px 40px; }
.extensions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.ext-card {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.ext-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.ext-body h3 { font-size: 0.95rem; margin-bottom: 4px; }
.ext-body p  { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

/* ═══ PRICING ════════════════════════════════════════════════════════ */
.pricing-section { }

/* Toggle */
.billing-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 36px;
}
.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 7px 18px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.toggle-btn-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20,20,18,0.1);
}
.savings-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-light);
  color: #7a5200;
  border-radius: 999px;
  padding: 2px 7px;
}

/* Cards */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

.price-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.price-card-highlight {
  border-color: var(--brand);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(31,122,87,0.12);
}

.price-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}

.price-header h3 { font-size: 1.15rem; margin-bottom: 4px; }
.price-description { font-size: 0.88rem; color: var(--muted); }

.price-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
}
.price-number {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.price-period {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
}

.price-billing-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -10px;
}

.price-features {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.price-features li {
  font-size: 0.88rem;
  color: var(--ink-2);
  padding-left: 20px;
  position: relative;
}
.price-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

.price-card form { margin-top: auto; }

/* ═══ FAQ ════════════════════════════════════════════════════════════ */
.faq-section { max-width: 760px; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.faq-item:last-child { border-bottom: 0; }

.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq-item[open] summary { background: var(--bg-alt); }
.faq-item[open] summary::after { content: '−'; }

.faq-item p {
  padding: 0 20px 16px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ═══ FORMS & INPUTS ════════════════════════════════════════════════ */
.form-grid { display: grid; gap: 14px; }
.form-grid.compact { max-width: 640px; }
.form-grid h2 { margin-top: 8px; }

label {
  display: grid;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}

input, select, textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31,122,87,0.15);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] { width: auto; }

/* ═══ CARDS & TABLES ════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.table-wrap { overflow-x: auto; padding: 0; }
.card.table-wrap { padding: 0; }

table { width: 100%; border-collapse: collapse; }
th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 16px;
  font-size: 0.88rem;
}
th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  background: var(--bg-alt);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafafa; }

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.table-actions form { margin: 0; }

/* ═══ STATUS BADGES ═════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-active   { background: #d9f0e7; color: #0f3d27; }
.status-trialing { background: #e8f0fd; color: #1a3a7a; }
.status-revoked, .status-canceled { background: #fde6e6; color: #7d1f1f; }
.status-past_due { background: #fef3d9; color: #7a4f00; }

/* ═══ AUTH PAGES ════════════════════════════════════════════════════ */
.auth-wrap { max-width: 480px; }

/* ═══ ACCOUNT ═══════════════════════════════════════════════════════ */
.account-section { max-width: 900px; }
.account-section h2 { margin-top: 40px; margin-bottom: 12px; font-size: 1.2rem; }

.account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.account-header h1 { font-size: 1.8rem; margin-bottom: 4px; }
.account-email { color: var(--muted); font-size: 0.9rem; }

.account-empty-state {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.download-card { display: flex; flex-direction: column; gap: 12px; }
.download-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

/* ═══ ADMIN TABS ════════════════════════════════════════════════════ */
.admin-shell { max-width: 1080px; }
.admin-header { margin-bottom: 24px; }
.admin-header h1 { font-size: 1.7rem; }

.admin-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 32px;
}

.admin-tab {
  display: inline-block;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent;
  border-bottom: 0;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
  margin-bottom: -2px;
}
.admin-tab:hover { color: var(--ink); text-decoration: none; background: var(--bg-alt); }
.admin-tab.admin-tab-active {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line);
  border-bottom-color: var(--card);
}

.admin-panel { display: none; }
.admin-panel.admin-panel-active { display: block; }

.admin-panel h2 { margin-top: 32px; margin-bottom: 14px; font-size: 1.15rem; }
.admin-panel h2:first-child { margin-top: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.stat-card { text-align: center; padding: 20px; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 4px; }
.stat-card h3 { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.two-col-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 8px;
}

/* ═══ TERMS ══════════════════════════════════════════════════════════ */
.terms-wrap {
  max-width: 720px;
}
.terms-wrap h1 { margin-bottom: 8px; }
.terms-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 36px;
}
.terms-wrap h2 {
  font-size: 1.05rem;
  margin-top: 28px;
  margin-bottom: 6px;
}
.terms-wrap p {
  font-size: 0.92rem;
  color: var(--ink-2);
  line-height: 1.65;
}

/* ═══ FOOTER ════════════════════════════════════════════════════════ */
.site-footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-links { display: inline-flex; gap: 16px; }

/* ═══ ACTION ROW ════════════════════════════════════════════════════ */
.action-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* ═══ RESPONSIVE ════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .extensions-section { padding: 32px 20px; }
  .two-col-forms { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: rgba(245,244,240,0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 16px;
    z-index: 99;
  }
  .site-nav.nav-open { display: flex; }

  .site-nav a,
  .link-button {
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
  }
  .button-nav {
    text-align: center;
    margin-top: 4px;
  }
  .lang-switcher { padding: 6px 12px; }
  .site-header { position: relative; }
}

@media (max-width: 640px) {
  .site-header { padding: 12px 0; }
  .pricing-grid { grid-template-columns: 1fr; }
  .faq-section { max-width: 100%; }
  .account-header { flex-direction: column; align-items: flex-start; }
}
