@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@100..125,400..800&display=swap");

:root {
  --ink: #17303a;
  --pet: #1f7a80;
  --pet-deep: #155a5f;
  --clear: #eaf3f3;
  --paper: #ffffff;
  --rule: #c9dcdd;
  --muted: #5b7078;
  --danger: #b3261e;
  --danger-bg: #fbeceb;
  --ok: #2e7d4f;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --font: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--clear);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--pet); }

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

.display {
  font-stretch: 125%;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

/* ------------------------------------------------ buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; font-weight: 600;
  background: var(--pet); color: #fff; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--pet-deep); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { background: var(--clear); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #8f1e18; }
.btn.small { padding: 6px 12px; font-size: 13px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--rule); background: var(--paper);
}
.field input:focus, .field select:focus { border-color: var(--pet); outline: none; box-shadow: 0 0 0 3px rgba(31,122,128,.18); }
.hint { font-size: 13px; color: var(--muted); }

/* show / hide password eye button */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center;
  border: none; background: none; color: var(--muted); cursor: pointer; border-radius: var(--radius-sm);
}
.pw-toggle:hover { color: var(--pet); background: var(--clear); }

.alert {
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px;
  background: var(--danger-bg); color: var(--danger); margin-bottom: 16px;
}
.alert[hidden] { display: none; }

/* ------------------------------------------------ top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand svg { flex: none; }
.brand strong { font-stretch: 125%; font-weight: 750; font-size: 17px; }
.brand span { font-size: 13px; opacity: .7; }
.topbar nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.topbar .who { font-size: 14px; margin-right: 8px; text-align: right; line-height: 1.3; }
.topbar .who small { display: block; opacity: .7; font-size: 12px; }
.topbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.28); }
.topbar .btn.ghost:hover { background: rgba(255,255,255,.08); }

.page { max-width: 1120px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 40px); }

/* ------------------------------------------------ dialog */
dialog {
  border: none; border-radius: var(--radius-lg); padding: 0;
  width: min(520px, calc(100vw - 32px)); color: var(--ink);
  box-shadow: 0 24px 60px rgba(23,48,58,.28);
}
dialog::backdrop { background: rgba(23,48,58,.45); }
dialog form { padding: 24px; }
dialog h2 { margin: 0 0 18px; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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