/* GIUSTOscribe design system: "warm luxury clinical".
   Tokens first, then shared components. Screens use these rather than their own values.
   Light and dark are both designed here; "System" follows the device when no theme is chosen. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces: the website's cream page, white cards, soft aqua for recessed areas */
  --page: #f8f5ef;
  --card: #ffffff;
  --sunken: #eaf7f8;
  --line: #dce7e7;
  --field-line: #9db3b8;
  /* Text: the website's deep teal-navy, never pure black */
  --ink: #0e3a46;
  --muted: #5b7279;
  /* Brand: the website's teal-navy and logo teal */
  --navy: #0e3a46;
  --navy-soft: #15505f;
  --on-navy: #eaf7f8;
  --on-navy-muted: #9fc3cb;
  --accent: #0f6e7c;
  --accent-ink: #ffffff;
  --accent-soft: #e5f4f5;
  --accent-text: #0f6e7c;
  --aqua: #1a9aa8;
  --sage: #8ed3da;
  --taupe: #5b7279;
  --stone: #dce7e7;
  /* Status, used sparingly */
  --warn-soft: #fdf1da;
  --warn-text: #7a4b09;
  --good-soft: #ddf0e6;
  --good-text: #10653f;
  --danger: #b3332b;
  --danger-soft: #fae4e0;
  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Lexend", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-xs: .8125rem;
  --text-sm: .9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-2xl: 2.125rem;
  /* Space and shape: quiet corners, hairlines before shadows */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgb(14 58 70 / .06), 0 10px 30px -18px rgb(14 58 70 / .20);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0b1f26;
    --card: #102c35;
    --sunken: #0e262f;
    --line: #1e3f49;
    --field-line: #51717b;
    --ink: #e6f2f4;
    --muted: #9fb6bc;
    --navy: #081a20;
    --navy-soft: #16404c;
    --on-navy: #e6f2f4;
    --on-navy-muted: #9fc3cb;
    --accent: #7fd3dd;
    --accent-ink: #06222a;
    --accent-soft: #123340;
    --accent-text: #8fdce6;
    --aqua: #8ed3da;
    --sage: #8ed3da;
    --taupe: #9fb6bc;
    --stone: #2a4a54;
    --warn-soft: #3a2f14;
    --warn-text: #ebcb85;
    --good-soft: #0f3326;
    --good-text: #a6d9bb;
    --danger: #f0a090;
    --danger-soft: #40231e;
    --shadow: 0 1px 0 rgb(0 0 0 / .2);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --page: #0b1f26;
  --card: #102c35;
  --sunken: #0e262f;
  --line: #1e3f49;
  --field-line: #51717b;
  --ink: #e6f2f4;
  --muted: #9fb6bc;
  --navy: #081a20;
  --navy-soft: #16404c;
  --on-navy: #e6f2f4;
  --on-navy-muted: #9fc3cb;
  --accent: #7fd3dd;
  --accent-ink: #06222a;
  --accent-soft: #123340;
  --accent-text: #8fdce6;
  --aqua: #8ed3da;
  --sage: #8ed3da;
  --taupe: #9fb6bc;
  --stone: #2a4a54;
  --warn-soft: #3a2f14;
  --warn-text: #ebcb85;
  --good-soft: #0f3326;
  --good-text: #a6d9bb;
  --danger: #f0a090;
  --danger-soft: #40231e;
  --shadow: 0 1px 0 rgb(0 0 0 / .2);
  color-scheme: dark;
}

/* Base */
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: var(--text-base); line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.012em; text-wrap: balance; }
h2 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; line-height: 1.25; margin: 0 0 var(--space-2); letter-spacing: -.005em; }
h3 { font-size: var(--text-base); font-weight: 700; margin: 0 0 var(--space-1); }
p { margin: 0 0 var(--space-3); }
a { color: var(--accent-text); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong, b { font-weight: 700; }
label { display: block; font-weight: 700; font-size: var(--text-sm); margin-bottom: var(--space-1); letter-spacing: .005em; }
summary { cursor: pointer; font-weight: 700; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
::selection { background: var(--sage); color: #06222a; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.spread { justify-content: space-between; }

/* Form fields */
input[type=text], input[type=password], input[type=email], input[type=search], input[type=date], input[type=month], input[type=number], input[type=time], input[type=tel], select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--field-line); border-radius: var(--radius-sm); font: inherit; color: inherit; background: var(--card);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover:not(:disabled):not([readonly]), select:hover:not(:disabled), textarea:hover:not(:disabled):not([readonly]) { border-color: var(--accent); }
textarea { min-height: 6rem; resize: vertical; line-height: 1.6; }
label.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 400; font-size: var(--text-base); margin: 0; letter-spacing: 0; }
label.check input { margin-top: .28rem; accent-color: var(--accent); width: 1.1rem; height: 1.1rem; flex: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-4); align-items: end; }
.field { margin-bottom: var(--space-4); }

/* Buttons */
button { font: inherit; font-weight: 700; font-size: var(--text-sm); letter-spacing: .01em; min-height: 42px; padding: .5rem 1.15rem; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: transparent; color: var(--accent-text); cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
button:hover:not(:disabled) { background: var(--accent-soft); }
button.primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -1px 0 rgb(0 0 0 / .18); }
button.primary:hover:not(:disabled) { background: var(--navy-soft); border-color: var(--navy-soft); color: var(--on-navy); }
button.recording { background: var(--danger); border-color: var(--danger); color: #fff; }
button.ghost { border-color: var(--line); color: var(--ink); padding: .35rem .8rem; min-height: 36px; font-weight: 400; }
button.ghost:hover:not(:disabled) { border-color: var(--field-line); background: var(--sunken); }
button.link { border: 0; background: none; padding: 0; min-height: 0; font-weight: 400; font-size: inherit; letter-spacing: 0; text-decoration: underline; text-underline-offset: .18em; text-align: left; color: var(--accent-text); }
button.link:hover:not(:disabled) { background: none; text-decoration-thickness: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* Cards and notices */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); margin-bottom: var(--space-5); box-shadow: var(--shadow); }
.notice { padding: .75rem 1rem; border-radius: var(--radius-md); background: var(--warn-soft); color: var(--warn-text); margin-bottom: var(--space-4); border-left: 3px solid currentColor; }
.notice.info { background: var(--accent-soft); color: var(--ink); border-left-color: var(--sage); }
.notice.good { background: var(--good-soft); color: var(--good-text); }
.error { color: var(--danger); font-weight: 700; margin: var(--space-2) 0 0; }
.error:empty { display: none; }
.success { color: var(--good-text); font-weight: 700; margin: var(--space-2) 0 0; }
.success:empty { display: none; }

/* Status tags: a quiet label with a dot, not a loud pill */
.tag { display: inline-flex; align-items: center; gap: .4rem; padding: .16rem .6rem .16rem .5rem; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 700; letter-spacing: .02em; white-space: nowrap; vertical-align: .08em; }
.tag::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; flex: none; }
.tag.good { background: var(--good-soft); color: var(--good-text); }
.tag.warn { background: var(--warn-soft); color: var(--warn-text); }
.tag.info { background: var(--accent-soft); color: var(--accent-text); }
.tag.plain { background: var(--sunken); color: var(--muted); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }

/* Icons */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Which logo to show on which background */
.logo-for-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-for-light { display: none; }
  :root:not([data-theme="light"]) .logo-for-dark { display: block; }
}
:root[data-theme="dark"] .logo-for-light { display: none; }
:root[data-theme="dark"] .logo-for-dark { display: block; }

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