*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --navy: #1a1a2e;
  --navy-60: #1a1a2e99;
  --indigo: #4f46e5;
  --indigo-h: #3730b8;
  --emerald: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --border: #e2e0d8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(26, 26, 46, 0.08), 0 4px 16px rgba(26, 26, 46, 0.06);
  --shadow-lg:
    0 4px 6px rgba(26, 26, 46, 0.06), 0 12px 40px rgba(26, 26, 46, 0.12);
}

html {
  font-size: 16px;
}

body {
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--navy);
  min-height: 100vh;
}

/* ── Nav ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
nav a.wordmark {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.01em;
}
nav a.wordmark span {
  color: var(--indigo);
}
.nav-links {
  display: flex;
  gap: 20px;
}
.nav-links a {
  color: var(--navy-60);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--indigo);
}

/* ── Page shell ── */
.page {
  max-width: 840px;
  margin: 0 auto;
  padding: 48px 24px;
}
.page-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ── Typography ── */
h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
}
h3 {
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy-60);
  margin-bottom: 12px;
}
p {
  color: var(--navy-60);
  margin-bottom: 16px;
}
p:last-child {
  margin-bottom: 0;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* ── Form elements ── */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--navy);
}
input[type="text"],
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--bg);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  outline: none;
}
input[type="text"]:focus,
textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: var(--surface);
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.field {
  margin-bottom: 20px;
}
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.field-hint {
  font-size: 0.8rem;
  color: var(--navy-60);
  margin-top: 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
  white-space: nowrap;
  &:disabled {
    opacity: 0.6;
    pointer-events: none;
  }
  @media (max-width: 480px) {
    width: 100%;
    justify-content: center;
  }
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background: var(--indigo-h);
}
.btn-ghost {
  background: transparent;
  color: var(--indigo);
  border-color: var(--indigo);
}
.btn-ghost:hover {
  background: rgba(79, 70, 229, 0.06);
}
.btn-danger {
  --bg-color: var(--red);
  --color: #fff;
  --hover-bg-color: #b91c1c;
  --shadow: 0 1px 2px rgba(220, 38, 38, 0.3);

  background: var(--bg-color);
  color: var(--color);
  box-shadow: var(--shadow);
  &:hover {
    background: var(--hover-bg-color);
  }

  &.outlined {
    --bg-color: transparent;
    --color: var(--red);
    --hover-bg-color: color-mix(in srgb, var(--red), white 80%);
    --shadow: none;
    border-color: var(--red);
  }
}
.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}
.btn-full {
  width: 100%;
  justify-content: center;
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.alert-error {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
}
.alert-success {
  background: #ecfdf5;
  color: var(--emerald);
  border: 1px solid #a7f3d0;
}
.alert-info {
  background: #eef2ff;
  color: var(--indigo);
  border: 1px solid #c7d2fe;
}

/* ── Copy field ── */
.copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.copy-row input {
  flex: 1;
}
.copy-btn {
  cursor: pointer;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy-60);
  font-size: 0.85rem;
  margin: 28px 0;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Spinner ── */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── Misc utils ── */
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mt-32 {
  margin-top: 32px;
}
.gap-8 {
  gap: 8px;
}
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.text-center {
  text-align: center;
}
.text-sm {
  font-size: 0.875rem;
}
.text-muted {
  color: var(--navy-60);
}
.font-mono {
  font-family: "Courier New", monospace;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-indigo {
  background: #eef2ff;
  color: var(--indigo);
}
.badge-emerald {
  background: #ecfdf5;
  color: var(--emerald);
}
.badge-amber {
  background: #fffbeb;
  color: var(--amber);
}
.ml-auto {
  margin-left: auto;
}