/* The account pages on the Hayetek web kit (`b1df7375`, W3 Part 3): the kit's tokens, base, controls
   and shell come from `static/kit/` (a snapshot, see `static/kit/SNAPSHOT.md`); this file holds only
   what the pages add: the page column, the tabs, the cards, the forms. Every colour and size is a
   `--hk-*` token; logical properties only, so `dir="rtl"` mirrors the page (`8dec70ca`). Light is
   the home mode, dark follows the OS (the kit's rule). */

/* ---------- the page column ---------- */
.page {
  padding-block: var(--hk-space-xl) var(--hk-kit-band);
}

.page > * {
  max-inline-size: var(--hk-kit-measure);
}

/* ---------- the person's name in the shell ---------- */
.hk-who > summary { color: var(--hk-color-text); font-weight: var(--hk-font-weight-semibold); }
.hk-who form { display: contents; }
.hk-who__out {
  display: flex;
  align-items: center;
  inline-size: 100%;
  min-block-size: var(--hk-size-touch-target);
  padding-inline: var(--hk-space-sm);
  border: 0;
  border-radius: var(--hk-radius-sm);
  background: none;
  color: var(--hk-color-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.hk-who__out:hover { background: var(--hk-color-surface-raised); }
.hk-sheet .hk-who__out { padding-inline: 0; min-block-size: var(--hk-space-xxl); font-size: var(--hk-font-size-title-sm); }
.hk-sheet .hk-who__out:hover { background: none; color: var(--hk-color-primary-text); }
.hk-sheet__who { color: var(--hk-color-text-muted); font-size: var(--hk-font-size-caption); }

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hk-space-xxs) var(--hk-space-xs);
  margin-block-end: var(--hk-space-md);
  border-block-end: var(--hk-size-line) solid var(--hk-color-surface-raised);
}

.tabs a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--hk-size-touch-target);
  padding-inline: var(--hk-space-sm);
  border-block-end: var(--hk-size-focus-ring) solid transparent;
  color: var(--hk-color-text-muted);
  text-decoration: none;
}

.tabs a:hover { color: var(--hk-color-text); }
.tabs a[aria-current] { border-color: var(--hk-color-primary); color: var(--hk-color-text); font-weight: var(--hk-font-weight-semibold); }

/* ---------- cards ---------- */
.card {
  margin-block: var(--hk-space-md);
  padding: var(--hk-space-lg);
  border: var(--hk-size-line) solid var(--hk-color-surface-raised);
  border-radius: var(--hk-component-card-radius);
  background: var(--hk-component-card-bg);
}

.card.narrow { max-inline-size: 32rem; margin-inline: auto; }
.card.warning { border-color: var(--hk-color-warning); }
.card h1 { font-size: var(--hk-font-size-headline); margin-block-end: var(--hk-space-sm); }
.card h2 { font-size: var(--hk-font-size-title-md); margin-block-end: var(--hk-space-sm); }
.card p { margin-block-end: var(--hk-space-sm); }
.small { color: var(--hk-color-text-muted); font-size: var(--hk-font-size-caption); }
.address { font-weight: var(--hk-font-weight-semibold); }
.or { text-align: center; color: var(--hk-color-text-muted); }
.switch { margin-block-start: var(--hk-space-md); }

/* ---------- forms: the kit's inputs and buttons, by element ---------- */
label, legend { display: block; margin-block-end: var(--hk-space-xs); font-weight: var(--hk-font-weight-semibold); }
fieldset { border: 0; padding: 0; margin: 0; }

input, select {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: var(--hk-component-input-min-height);
  padding-inline: calc(var(--hk-space-md) - 2px);
  border: var(--hk-size-line) solid var(--hk-component-input-border);
  border-radius: var(--hk-component-input-radius);
  background: var(--hk-component-input-bg);
  color: var(--hk-color-text);
  font: inherit;
}

input::placeholder { color: var(--hk-color-text-muted); opacity: 1; }
input[type="email"], input[type="text"], input[type="tel"] { max-inline-size: 28rem; }
input[type="date"] { max-inline-size: 16rem; }
input.invalid, input[aria-invalid="true"] { border-color: var(--hk-color-error); }

.choices { display: flex; flex-wrap: wrap; gap: var(--hk-space-xs) var(--hk-space-lg); }
.choices label, label.check { display: flex; align-items: center; gap: var(--hk-space-xs); font-weight: var(--hk-font-weight-regular); }
label.check { align-items: flex-start; }
.choices input, label.check input { inline-size: auto; min-block-size: 0; margin: 0; margin-block-start: var(--hk-space-xxs); }

button, .button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hk-space-xs);
  min-block-size: var(--hk-component-button-min-height);
  margin-block: var(--hk-space-xs);
  padding-inline: calc(var(--hk-space-lg) - 2px);
  border: var(--hk-size-line) solid var(--hk-component-button-primary-bg);
  border-radius: var(--hk-component-button-radius);
  background: var(--hk-component-button-primary-bg);
  color: var(--hk-component-button-primary-fg);
  font: var(--hk-font-weight-semibold) var(--hk-font-size-body) / 1 var(--hk-font-family-text);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--hk-duration-fast) var(--hk-easing-standard);
}

button::after, .button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--hk-color-scrim);
  opacity: 0;
  transition: opacity var(--hk-duration-fast) var(--hk-easing-standard);
  pointer-events: none;
}

button:hover::after, .button:hover::after { opacity: calc(var(--hk-opacity-press) / 2); }
button:active::after, .button:active::after { opacity: var(--hk-opacity-press); }
button:active, .button:active { transform: scale(var(--hk-scale-press)); }
button.quiet, .quiet { background: transparent; color: var(--hk-color-primary-text); border-color: var(--hk-color-primary-text); }
button.danger, .danger { background: transparent; color: var(--hk-color-error); border-color: var(--hk-color-error); }
button[disabled], select[disabled], input[disabled] { opacity: var(--hk-opacity-disabled, 0.5); cursor: default; transform: none; }
button[disabled]::after { opacity: 0; }
form.inline { display: inline; }

.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--hk-space-xs); }
.row label { flex-basis: 100%; margin-block-end: 0; }
.row > .grow { flex: 1 1 14rem; }
.stack > * + * { margin-block-start: var(--hk-space-sm); }
.grow { flex: 1 1 14rem; }

/* ---------- lists and tables ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hk-space-xs) var(--hk-space-sm);
  padding-block: var(--hk-space-sm);
  border-block-start: var(--hk-size-line) solid var(--hk-color-surface-raised);
}
.list li:first-child { border-block-start: 0; }
.tag {
  font-style: normal;
  font-size: var(--hk-font-size-caption);
  padding: 0 var(--hk-space-xs);
  border: var(--hk-size-line) solid var(--hk-color-surface-raised);
  border-radius: var(--hk-component-chip-radius);
  color: var(--hk-color-text-muted);
}

dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--hk-space-xxs) var(--hk-space-md); margin: 0 0 var(--hk-space-sm); }
dt { color: var(--hk-color-text-muted); }
dd { margin: 0; }
table { border-collapse: collapse; inline-size: 100%; font-size: var(--hk-font-size-caption); }
th, td { text-align: start; padding: var(--hk-space-xs) var(--hk-space-xs); border-block-end: var(--hk-size-line) solid var(--hk-color-surface-raised); vertical-align: top; }
th { color: var(--hk-color-text-muted); font-weight: var(--hk-font-weight-semibold); }

/* ---------- notices and errors ---------- */
.notice {
  margin-block-end: var(--hk-space-md);
  padding: var(--hk-space-sm) var(--hk-space-md);
  border: var(--hk-size-line) solid var(--hk-color-primary);
  border-radius: var(--hk-radius-md);
  background: var(--hk-color-surface);
}
.errors, .error, .field-error { color: var(--hk-color-error); }
.errors { padding-inline-start: var(--hk-space-lg); margin-block-end: var(--hk-space-md); }
.field-error { font-size: var(--hk-font-size-caption); margin-block: var(--hk-space-xxs) var(--hk-space-xs); }
[hidden] { display: none !important; }
