/* Signature Manager – shared light-green theme */
:root {
  --bg: #f3faf5;
  --bg-glow-1: #d6f5df;
  --bg-glow-2: #e6f9d9;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --border: #dcefe1;
  --border-strong: #c3e3cb;
  --text: #0f2a1b;
  --muted: #5b7566;
  --brand: #22c55e;
  --brand-600: #16a34a;
  --brand-700: #15803d;
  --brand-50: #ecfdf3;
  --brand-100: #d1fadf;
  --danger: #dc2626;
  --danger-50: #fef2f2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 42, 27, .04), 0 8px 24px -8px rgba(22, 101, 52, .12);
  --shadow-lg: 0 24px 48px -16px rgba(22, 101, 52, .25);
  --ring: 0 0 0 4px rgba(34, 197, 94, .18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 0% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-700); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 28px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--brand-50); color: var(--brand-700); padding: 2px 6px; border-radius: 6px; }
[hidden] { display: none !important; }

/* Brand mark */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4ade80, #16a34a);
  box-shadow: 0 6px 16px -6px rgba(22, 163, 74, .6), inset 0 1px 0 rgba(255,255,255,.35);
}
.logo svg { width: 18px; height: 18px; }

/* Cards */
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.icon-badge {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100);
}
.icon-badge svg { width: 18px; height: 18px; }
.title-row { display: flex; gap: 12px; align-items: center; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #9bb3a4; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b7566' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { font-family: var(--mono); font-size: 13px; line-height: 1.6; resize: vertical; min-height: 180px; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .08s, box-shadow .15s, background .15s, border-color .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #34d36b, #16a34a);
  border-color: #15913f;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 16px -6px rgba(22, 163, 74, .55);
}
.btn-primary:hover { background: linear-gradient(180deg, #2bc962, #15913f); }
.btn-ghost { background: var(--surface-solid); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; padding: 6px 10px; }
.btn-danger:hover { background: var(--danger-50); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* Chips & pills */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 12px;
  padding: 4px 9px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100);
  cursor: pointer; transition: background .15s, transform .08s;
}
.chip:hover { background: var(--brand-100); }
.chip:active { transform: scale(.97); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-solid); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #f7fcf8; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f7fcf8; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 700; color: var(--brand-700);
  background: linear-gradient(135deg, var(--brand-100), #e9fbe0);
  border: 1px solid var(--brand-100);
}
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 600; }
.person small { display: block; color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }

/* Toasts */
#toasts { position: fixed; z-index: 50; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--text); color: #fff; font-size: 14px; font-weight: 500;
  padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease-out;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex: none; }
.toast.error::before { background: #f87171; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.fade-in { animation: fade-in .35s ease-out both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* Document pages (help, privacy, terms) */
.doc-top { max-width: 760px; margin: 0 auto; padding: 24px 16px 0; display: flex; justify-content: space-between; align-items: center; }
.doc { max-width: 760px; margin: 20px auto 48px; padding: 0 16px; }
.doc .card { padding: 36px 40px; }
@media (max-width: 600px) { .doc .card { padding: 24px 20px; } }
.doc h1 { font-size: 32px; margin-bottom: .35em; }
.doc h2 { margin-top: 1.8em; padding-top: 1.2em; border-top: 1px solid var(--border); }
.doc h2:first-of-type { border-top: 0; padding-top: 0; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1em; }
.doc li { margin-bottom: .5em; }
.doc li::marker { color: var(--brand-600); font-weight: 700; }
.doc-foot { text-align: center; color: var(--muted); font-size: 13px; }
.doc-foot a { color: var(--muted); }
