:root {
  --ink: #071d19;
  --ink-2: #12332b;
  --green: #176b58;
  --green-dark: #0d4f40;
  --lime: #c8f55f;
  --paper: #f4f6f0;
  --surface: #ffffff;
  --muted: #667871;
  --line: #dce4dd;
  --danger: #a63d40;
  --warning: #9a6810;
  --shadow: 0 24px 70px rgba(7, 29, 25, 0.1);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  letter-spacing: -0.4px;
}
.brand strong { font-weight: 780; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--lime);
  background: var(--ink);
  box-shadow: 0 10px 28px rgba(7, 29, 25, 0.15);
}
.brand-mark svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 0.9fr) 1.1fr; }
.auth-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px clamp(36px, 6vw, 88px);
  color: white;
  background: var(--ink);
}
.auth-story::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  right: -260px;
  bottom: -230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 245, 95, 0.32), transparent 68%);
}
.auth-story .brand { position: relative; }
.auth-story .brand-mark { color: var(--ink); background: var(--lime); }
.auth-copy { position: relative; max-width: 540px; margin: 80px 0; }
.auth-copy .eyebrow { color: var(--lime); }
.auth-copy h1 { margin: 18px 0; font-size: clamp(40px, 5vw, 70px); line-height: 1; letter-spacing: -0.055em; }
.auth-copy p { max-width: 500px; color: #b8c9c3; font-size: 17px; line-height: 1.7; }
.auth-points { display: grid; gap: 14px; margin-top: 34px; }
.auth-point { display: flex; align-items: center; gap: 12px; color: #dce8e3; font-size: 14px; }
.auth-point span { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.auth-foot { position: relative; color: #7f9b91; font-size: 12px; }

.auth-main { display: grid; place-items: center; padding: 42px 24px; }
.auth-card { width: min(100%, 470px); }
.auth-card h2 { margin: 0 0 10px; font-size: 34px; letter-spacing: -0.04em; }
.auth-card > p { margin: 0 0 34px; color: var(--muted); line-height: 1.6; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-size: 13px; font-weight: 720; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  padding: 14px 15px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(23, 107, 88, .1); }
.field .verification-code {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.32em;
  font-variant-numeric: tabular-nums;
}
.field-hint { color: var(--muted); font-size: 11px; }
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  color: white;
  background: var(--green);
  font-weight: 750;
  transition: transform .18s, background .18s;
}
.button:hover { background: var(--green-dark); transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-full { width: 100%; }
.button-secondary { color: var(--ink); background: #eef2ec; }
.button-secondary:hover { background: #e3eae3; }
.button-danger { background: var(--danger); }
.auth-switch { margin-top: 24px; color: var(--muted); text-align: center; font-size: 14px; }
.auth-switch a { color: var(--green); font-weight: 750; }
.resend-button {
  width: 100%;
  margin-top: 8px;
  border: 0;
  padding: 10px;
  color: var(--green);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}
.resend-button:disabled { color: var(--muted); cursor: wait; }
.form-message { min-height: 22px; margin: 14px 0 0; color: var(--danger); font-size: 13px; line-height: 1.5; }
.form-message.success { color: var(--green); }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  color: white;
  background: var(--ink);
}
.sidebar .brand { padding: 0 10px; }
.sidebar .brand-mark { color: var(--ink); background: var(--lime); }
.nav { display: grid; gap: 6px; margin-top: 48px; }
.nav a, .logout-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  color: #a9beb7;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
}
.nav a:hover, .nav a.active, .logout-button:hover { color: white; background: rgba(255,255,255,.08); }
.nav a.active { color: var(--lime); }
.sidebar-bottom { margin-top: auto; }
.sidebar-user { margin: 0 10px 14px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user span { margin-top: 4px; color: #79958b; font-size: 11px; }
.logout-button { width: 100%; }

.app-main { min-width: 0; padding: 38px clamp(24px, 5vw, 70px) 70px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-head h1 { margin: 9px 0 0; font-size: clamp(32px, 4vw, 52px); letter-spacing: -.05em; }
.page-head p { max-width: 620px; margin: 10px 0 0; color: var(--muted); line-height: 1.6; }
.status-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 800; background: #e9efea; }
.status-chip.approved, .status-chip.active { color: var(--green-dark); background: #ddf2e8; }
.status-chip.rejected, .status-chip.suspended { color: var(--danger); background: #fae7e6; }
.status-chip.submitted, .status-chip.under_review, .status-chip.more_info_required { color: var(--warning); background: #fff1d6; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 34px; }
.summary-card, .panel, .plan-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(7,29,25,.035);
}
.summary-card { padding: 22px; }
.summary-card span { color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin-top: 9px; font-size: 24px; letter-spacing: -.03em; }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-card { display: flex; flex-direction: column; padding: 24px; }
.plan-card h3 { margin: 4px 0 10px; font-size: 22px; }
.plan-card > p { min-height: 63px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.plan-metric { margin: 22px 0; font-size: 27px; font-weight: 790; letter-spacing: -.04em; }
.plan-metric small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.scope-list { display: grid; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; color: var(--ink-2); font-size: 12px; }
.scope-list li::before { content: "✓"; margin-right: 8px; color: var(--green); font-weight: 900; }
.plan-card .button { margin-top: auto; }

.panel { overflow: hidden; }
.empty-state { padding: 38px 24px; color: var(--muted); text-align: center; font-size: 13px; }
.list-item { display: grid; grid-template-columns: 1.3fr 1fr auto; align-items: center; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item strong { display: block; font-size: 14px; }
.list-item small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.item-actions .button { min-height: 36px; padding-inline: 12px; font-size: 12px; }
.secret-box { margin-top: 18px; border: 1px solid #aad7c4; border-radius: 14px; padding: 18px; background: #edf9f3; }
.secret-box code { display: block; overflow-wrap: anywhere; margin: 10px 0; color: var(--green-dark); font-size: 13px; }
.secret-box p { margin: 0; color: var(--danger); font-size: 12px; font-weight: 700; }

.docs-layout { display: grid; grid-template-columns: 210px minmax(0, 780px); gap: 40px; }
.docs-toc { position: sticky; top: 30px; align-self: start; display: grid; gap: 5px; }
.docs-toc a { padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: 12px; }
.docs-toc a:hover { color: var(--green); background: white; }
.docs-content section { margin-bottom: 42px; scroll-margin-top: 24px; }
.docs-content h2 { margin: 0 0 12px; font-size: 25px; }
.docs-content p, .docs-content li { color: var(--muted); line-height: 1.7; font-size: 14px; }
.code-block { overflow-x: auto; border-radius: 14px; padding: 18px; color: #d9ebe4; background: var(--ink); font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.endpoint { display: inline-flex; gap: 10px; align-items: center; margin: 8px 0; font: 13px ui-monospace, monospace; }
.method { border-radius: 6px; padding: 5px 7px; color: var(--green-dark); background: var(--lime); font-size: 10px; font-weight: 900; }

.loading { opacity: .55; pointer-events: none; }
.mobile-head { display: none; }

@media (max-width: 920px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 340px; padding: 30px 24px; }
  .auth-copy { margin: 55px 0 20px; }
  .auth-copy h1 { font-size: 43px; }
  .auth-points, .auth-foot { display: none; }
  .app-layout { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 16px 20px; flex-direction: row; align-items: center; gap: 20px; }
  .sidebar .brand { padding: 0; }
  .nav { display: flex; overflow-x: auto; margin: 0; }
  .nav a { white-space: nowrap; }
  .sidebar-bottom { margin: 0 0 0 auto; }
  .sidebar-user { display: none; }
  .logout-button { width: 44px; overflow: hidden; white-space: nowrap; }
  .summary-grid, .plans-grid { grid-template-columns: 1fr 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .field-row, .summary-grid, .plans-grid { grid-template-columns: 1fr; }
  .app-main { padding: 28px 18px 55px; }
  .sidebar { overflow-x: auto; }
  .sidebar .brand span:last-child, .logout-button { display: none; }
  .sidebar-bottom { display: none; }
  .page-head { display: block; }
  .list-item { grid-template-columns: 1fr; gap: 12px; }
  .item-actions { justify-content: flex-start; }
  .docs-toc { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
