/* Shared design tokens and components. */
@font-face { font-family: 'General Sans'; src: url('/fonts/GeneralSans-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('/fonts/GeneralSans-Medium.otf') format('opentype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('/fonts/GeneralSans-Semibold.otf') format('opentype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('/fonts/GeneralSans-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }

:root {
  --navy: #13193b;
  --navy-deep: #0f1428;
  --ink: #13193b;
  --ink-soft: rgba(19, 25, 59, 0.62);
  --ink-faint: rgba(19, 25, 59, 0.12);
  --ink-light: #f5f5f7;
  --paper: #f8f9f9;
  --warm: #fffcf8;
  --brand: #f05722;
  --brand-hi: #ff8a63;
  --danger: #d6344f;
  --font: 'General Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-12: 12px;
  --r-22: 22px;
  --r-pill: 999px;
  --shadow-float: 0 18px 46px rgba(6, 10, 30, 0.16);
  --shadow-pill: 0 4px 18px rgba(0, 0, 0, 0.07);
  --foil: repeating-linear-gradient(110deg, #ff7773, #ffed5f, #a8ff5f, #83fff7, #7894ff, #d875ff, #ff7773 84%);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.eyebrow { font-weight: 600; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.accent { color: var(--brand); }

/* ---- wordmark ---- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.35rem; letter-spacing: -0.02em; text-decoration: none; }
.wordmark svg { width: 30px; height: 30px; display: block; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 9px 20px; border-radius: var(--r-pill); border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; line-height: 1.4; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn--brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--brand:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(240, 87, 34, 0.38); transform: translateY(-1px); }
.btn--glass { background: rgba(255, 255, 255, 0.85); border-color: var(--ink-faint); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-pill); }
.btn--glass:hover:not(:disabled) { border-color: rgba(19, 25, 59, 0.3); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.1); }
.btn--ghost { background: transparent; }
.btn--ghost:hover:not(:disabled) { background: rgba(19, 25, 59, 0.06); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--sm { padding: 6px 14px; font-size: 0.85rem; }
.btn--block { width: 100%; padding: 13px 20px; font-size: 1rem; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* ---- fields ---- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.82rem; font-weight: 500; opacity: 0.8; }
.input {
  width: 100%; padding: 12px 14px; border-radius: var(--r-12);
  border: 1px solid var(--ink-faint); background: #fff; outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(240, 87, 34, 0.16); }
.input[aria-invalid='true'] { border-color: var(--danger) !important; }

/* password box with show/hide */
.pw { position: relative; }
.pw .input { padding-right: 68px; }
.pw__toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border: 0; border-radius: 8px;
  background: none; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; opacity: 0.7;
}
.pw__toggle:hover { opacity: 1; background: rgba(128, 128, 150, 0.16); }
.pw__caps { font-size: 0.78rem; font-weight: 600; color: #b8860b; }

/* ---- dialogs ---- */
dialog.modal {
  border: 1px solid var(--ink-faint); border-radius: var(--r-22); padding: 0;
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: #fff; color: var(--ink); box-shadow: 0 30px 80px rgba(6, 10, 30, 0.35);
}
dialog.modal--wide { width: min(680px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(15, 20, 40, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.modal[open] { animation: modal-in 0.28s var(--ease-spring); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.modal__body { padding: 28px; display: grid; gap: 18px; }
.modal__title { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.modal__text { color: var(--ink-soft); }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.form-error { color: var(--danger); font-size: 0.9rem; font-weight: 500; min-height: 1.35em; }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 1000; transform: translate(-50%, 20px);
  padding: 10px 20px; border-radius: var(--r-pill); background: var(--navy); color: var(--ink-light);
  font-weight: 500; font-size: 0.92rem; box-shadow: var(--shadow-float);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.35s var(--ease-spring);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---- avatar ---- */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; color: #fff; background: var(--navy);
  border: 2px solid #fff; user-select: none;
}

/* ---- popover menu ---- */
.menu {
  position: absolute; z-index: 50; min-width: 190px; padding: 6px;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ink-faint); border-radius: 16px; box-shadow: var(--shadow-float);
  display: grid; gap: 2px; animation: modal-in 0.2s var(--ease-spring);
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none;
  border-radius: 10px; text-align: left; font-weight: 500; font-size: 0.92rem;
}
.menu button:hover { background: rgba(19, 25, 59, 0.06); }
.menu button.is-danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--ink-faint); margin: 4px 6px; }

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