/* Base design system. Theme values come from CSS custom properties on <body> (src/ui/themes.ts).
   Area styles: site.css (public), guest.css, host.css, billing.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.container { width: min(1100px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(640px, 100% - 2rem); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 1000;
  background: var(--text); color: var(--bg); padding: .5rem .75rem; border-radius: 6px;
}
.skip-link:focus { top: .5rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Buttons */
.button, button {
  font: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.1rem;
  border-radius: var(--radius); border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-contrast);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover, button:hover { filter: brightness(1.08); }
.button.secondary, button.secondary { background: transparent; color: var(--accent); }
.button.ghost, button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.button.danger, button.danger { background: #b42318; border-color: #b42318; color: #fff; }
.button.block, button.block { width: 100%; }
button:disabled, .button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; filter: none; }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.hint { color: var(--muted); font-size: .875rem; margin-top: .25rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="datetime-local"], input[type="date"], input[type="search"],
select, textarea {
  font: inherit; width: 100%; min-height: 44px;
  padding: .55rem .7rem; border: 1px solid var(--border); border-radius: calc(var(--radius) * .7);
  background: var(--surface); color: var(--text);
}
input[type="color"] { width: 3.2rem; height: 44px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
textarea { min-height: 6rem; resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .3rem; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.checkbox input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; accent-color: var(--accent); }

/* Surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem;
}
.notice { border-left: 4px solid var(--accent); background: var(--surface); padding: .8rem 1rem; border-radius: 6px; }
.notice.warn { border-left-color: #b54708; }
.notice.error { border-left-color: #b42318; }
.notice.ok { border-left-color: #067647; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; border: 1px solid var(--border); }

/* Site chrome */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.brand__mark { color: var(--accent); }
.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-nav a { color: var(--text); text-decoration: none; padding: .5rem .1rem; }
.site-nav a:hover { text-decoration: underline; }
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.5rem 0; background: var(--surface); }
.footer-nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.message-page { padding: 3rem 0; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }

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

@media print {
  .site-header, .site-footer, .skip-link, .no-print { display: none !important; }
  body { background: #fff; }
}
