/* MailPermit — shared styles */
:root {
  --paper: #eef1f7;
  --surface: #ffffff;
  --ink: #151b33;
  --muted: #5b6582;
  --faint: #8a93ad;
  --line: #d9deea;
  --line-soft: #e8ebf3;
  --brand: #2340d6;
  --brand-ink: #1a30a8;
  --brand-wash: #e7ebfd;
  --stamp: #d99a14;
  --stamp-wash: #fbf1dc;
  --ok: #1c7f55;
  --ok-wash: #e2f3ea;
  --danger: #b8332e;
  --danger-wash: #f8e4e3;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --display: "Familjen Grotesk", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(21, 27, 51, 0.06), 0 8px 24px -12px rgba(21, 27, 51, 0.18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* Brand mark */
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark img, .mark svg { width: 28px; height: 28px; flex: none; }
.mark b { font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--faint); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-soft); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.icon-btn { width: 40px; padding: 0; }

/* Fields */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input {
  width: 100%; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface);
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.suffix-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); overflow: hidden; }
.suffix-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.suffix-input input { flex: 1; min-width: 0; border: 0; padding: 0 12px; min-height: 42px; background: transparent; }
.suffix-input input:focus { outline: none; }
.suffix-input em { font-style: normal; display: flex; align-items: center; padding: 0 12px; color: var(--muted); background: var(--line-soft); border-left: 1px solid var(--line); white-space: nowrap; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.active { color: var(--ok); background: var(--ok-wash); }
.pill.expired { color: #8a6107; background: var(--stamp-wash); }
.pill.revoked { color: var(--danger); background: var(--danger-wash); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-m);
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Notice blocks */
.notice { padding: 12px 14px; border-radius: var(--radius-m); background: var(--danger-wash); color: var(--danger); font-size: 14px; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
