/* Jarabot look, after jarabot.com: light grey page, white rounded cards, black pill buttons, Inter Tight. */
@font-face {
  font-family: "Inter Tight";
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/inter-tight-latin-ext-3a551638.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Tight";
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/inter-tight-latin-bb14ae8d.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #121212;
  --muted: #565656;
  --border: #e4e4e4;
  --field-border: #bebebe;
  --subtle: #f2f2f2;
  --primary: #121212;
  --primary-text: #ffffff;
  --accent: #f55b01;
  --danger: #c4320a;
  --notice-bg: #eef7ee;
  --notice-text: #1d5a2a;
  --alert-bg: #fdeee8;
  --alert-text: #8a2a08;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0d;
    --card: #1a1a1a;
    --text: #f5f5f5;
    --muted: #a6a6a6;
    --border: #2c2c2c;
    --field-border: #4a4a4a;
    --subtle: #262626;
    --primary: #f5f5f5;
    --primary-text: #121212;
    --accent: #ff7a2e;
    --danger: #ff8a65;
    --notice-bg: #17301c;
    --notice-text: #b9e4c0;
    --alert-bg: #3a1d12;
    --alert-text: #ffc4ad;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; padding: 40px 16px;
  background: var(--bg); color: var(--text);
  font: 16px/1.5 "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Page frame */
.masthead { display: flex; justify-content: center; margin: 0 auto 24px; }
.masthead a { color: var(--text); display: inline-flex; }
.logo { height: 34px; width: auto; display: block; }
.card {
  max-width: 440px; margin: 0 auto; padding: 40px;
  background: var(--card); border-radius: 24px;
}
.card.wide { max-width: 640px; }
@media (max-width: 480px) {
  body { padding: 24px 12px; }
  .card { padding: 28px 20px; border-radius: 20px; }
}

/* Text */
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  margin: 36px 0 8px;
}
p { margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--field-border); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type=email], input[type=password], input[type=text], input[type=url], select, textarea {
  width: 100%; padding: 12px 16px; margin-bottom: 18px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--card); border: 1px solid var(--field-border); border-radius: 12px;
}
select { width: auto; padding: 10px 14px; font-size: 15px; }
textarea { font: 14px/1.5 ui-monospace, monospace; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input.code { font-size: 24px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
fieldset { border: 1px solid var(--border); border-radius: 12px; margin: 0 0 18px; padding: 10px 14px; }
legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: baseline; margin: 6px 0 12px; }

/* Buttons: black pill like jarabot.com; secondary is a light grey pill. */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 12px 24px;
  font: inherit; font-size: 16px; font-weight: 500; text-align: center; text-decoration: none;
  color: var(--primary-text); background: var(--primary); border: 1px solid var(--primary); border-radius: 999px; cursor: pointer;
  transition: opacity .15s, background-color .15s;
}
button:hover, .button:hover { opacity: .85; }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.secondary, .button.secondary-link {
  width: auto; min-height: 36px; padding: 6px 16px; font-size: 14px;
  color: var(--text); background: var(--subtle); border-color: var(--subtle);
}
button.secondary:hover, .button.secondary-link:hover { opacity: 1; background: var(--border); }
button.danger { color: var(--danger); }
button.wide, .button.wide { width: 100%; min-height: 48px; padding: 12px 24px; font-size: 15px; }
.button.inline { width: auto; min-height: 40px; padding: 8px 20px; font-size: 14px; }
form.button_to { margin: 0; }

/* Messages */
.flash { padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.flash-notice { background: var(--notice-bg); color: var(--notice-text); }
.flash-alert { background: var(--alert-bg); color: var(--alert-text); }

/* Layout helpers */
.links { margin-top: 24px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.grow { flex: 1; }
.grow input { margin-bottom: 10px; }
.provider { display: flex; align-items: center; justify-content: center; gap: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.row form { flex-shrink: 0; }
details { margin-bottom: 8px; }
details summary { cursor: pointer; font-size: 14px; margin-bottom: 12px; text-decoration: underline; text-decoration-color: var(--field-border); text-underline-offset: 3px; }
.tag { font-size: 11px; padding: 2px 8px; background: var(--subtle); border-radius: 999px; color: var(--muted); }

/* MFA setup */
.qr { display: flex; justify-content: center; margin: 8px 0 16px; }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 10px; border-radius: 16px; }
.secret { font-family: ui-monospace, monospace; word-break: break-all; font-size: 14px; background: var(--subtle); padding: 8px 12px; border-radius: 10px; }
.codes { columns: 2; font-family: ui-monospace, monospace; font-size: 16px; padding: 16px 16px 16px 36px; margin: 0 0 20px; background: var(--subtle); border-radius: 12px; }

/* Language switch */
.locales { text-align: center; margin-top: 20px; font-size: 13px; }
.locales a { color: var(--muted); margin: 0 6px; text-decoration: none; }
.locales a.current { color: var(--text); font-weight: 600; }

/* Admin */
.card.admin { max-width: 1080px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.admin-nav a { text-decoration: none; font-weight: 500; }
.admin-nav .logo { height: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 16px; }
th, td { text-align: left; padding: 10px 10px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.search { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search input, .search select { margin: 0; flex: 1; }
.search button { width: auto; min-height: 44px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 20px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 640px) { table { display: block; overflow-x: auto; } }
.field-hint { margin-top: -10px; }
