/* =============================================================
   ai-accountingcy — shared design tokens and base
   =============================================================
   The subject is Cyprus tax law: an authoritative, precise domain where
   a wrong answer costs money. The design is built to read as a reference
   work rather than a chatbot — warm paper, a deep Mediterranean green for
   action, and brass used ONLY on citations, the way a seal marks an
   official document.

   Every face here carries full Greek. That is not optional: the corpus,
   the answers and the audience are Greek, and a font that silently falls
   back mid-sentence is a visible defect.
   ============================================================= */

:root {
  /* --- ground and ink --- */
  --paper:        #f7f5f0;
  --paper-raised: #ffffff;
  --paper-sunken: #efece4;
  --ink:          #141a1f;
  --ink-soft:     #43505a;
  --ink-faint:    #78848d;
  --rule:         #ddd8cc;
  --rule-soft:    #e9e5db;

  /* --- action --- */
  --green:        #0e5c4a;
  --green-hover:  #0b4b3c;
  --green-wash:   #e3efea;
  --on-green:     #ffffff;

  /* --- citations only. Brass is the seal; spending it anywhere else
         makes it decoration instead of meaning. --- */
  --brass:        #8a6d1f;
  --brass-wash:   #f5eeda;

  /* --- semantic, kept apart from the accent --- */
  --danger:       #a03828;
  --danger-wash:  #f9e8e4;
  --warn:         #8a6410;
  --warn-wash:    #f7efdc;

  --shadow-sm: 0 1px 2px rgba(20, 26, 31, .05);
  --shadow-md: 0 2px 4px rgba(20, 26, 31, .06), 0 12px 28px -14px rgba(20, 26, 31, .18);
  --shadow-lg: 0 4px 8px rgba(20, 26, 31, .06), 0 24px 56px -20px rgba(20, 26, 31, .24);

  --focus: #0e5c4a;

  --serif: Alegreya, Georgia, "Times New Roman", serif;
  --sans:  Commissioner, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* A type scale, so nothing is sized by feel. */
  --step--1: clamp(.82rem, .8rem + .1vw, .88rem);
  --step-0:  clamp(1rem, .97rem + .15vw, 1.06rem);
  --step-1:  clamp(1.18rem, 1.1rem + .35vw, 1.35rem);
  --step-2:  clamp(1.42rem, 1.28rem + .65vw, 1.8rem);
  --step-3:  clamp(1.7rem, 1.45rem + 1.2vw, 2.5rem);
  --step-4:  clamp(2.05rem, 1.6rem + 2.2vw, 3.6rem);

  --measure: 66ch;
  --radius: 10px;
  --radius-sm: 6px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #10161a;
    --paper-raised: #171f24;
    --paper-sunken: #0b1013;
    --ink:          #e8eae6;
    --ink-soft:     #b2bdc4;
    --ink-faint:    #7d8a92;
    --rule:         #2a353b;
    --rule-soft:    #1e272c;
    --green:        #4fbc9d;
    --green-hover:  #6bcfb2;
    --green-wash:   #10302a;
    --on-green:     #05231c;
    --brass:        #d6b256;
    --brass-wash:   #2e2612;
    --danger:       #e2887a;
    --danger-wash:  #351915;
    --warn:         #d9ae52;
    --warn-wash:    #2f2510;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 2px 4px rgba(0,0,0,.4), 0 12px 28px -14px rgba(0,0,0,.7);
    --shadow-lg: 0 4px 8px rgba(0,0,0,.4), 0 24px 56px -20px rgba(0,0,0,.8);
    --focus: #4fbc9d;
  }
}
:root[data-theme="dark"] {
  --paper:        #10161a;
  --paper-raised: #171f24;
  --paper-sunken: #0b1013;
  --ink:          #e8eae6;
  --ink-soft:     #b2bdc4;
  --ink-faint:    #7d8a92;
  --rule:         #2a353b;
  --rule-soft:    #1e272c;
  --green:        #4fbc9d;
  --green-hover:  #6bcfb2;
  --green-wash:   #10302a;
  --on-green:     #05231c;
  --brass:        #d6b256;
  --brass-wash:   #2e2612;
  --danger:       #e2887a;
  --danger-wash:  #351915;
  --warn:         #d9ae52;
  --warn-wash:    #2f2510;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 2px 4px rgba(0,0,0,.4), 0 12px 28px -14px rgba(0,0,0,.7);
  --shadow-lg: 0 4px 8px rgba(0,0,0,.4), 0 24px 56px -20px rgba(0,0,0,.8);
  --focus: #4fbc9d;
}

*, *::before, *::after { box-sizing: border-box; }

/* The browser's own `[hidden] { display: none }` loses to ANY author rule
   that sets display — and this sheet sets `display: grid` on forms. The
   result was both tab panels rendering at once on the sign-in page, which
   a browser test caught and a code review did not. `!important` is right
   here: `hidden` is a statement of fact, not a suggestion. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.012em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-family: var(--sans); font-weight: 650; letter-spacing: -.005em; }
p  { margin: 0; max-width: var(--measure); }

a { color: var(--green); text-underline-offset: .18em; text-decoration-thickness: .07em; }
a:hover { color: var(--green-hover); }

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

.eyebrow {
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.mono { font-family: var(--mono); font-feature-settings: "zero" 1; }
.tnum { font-variant-numeric: tabular-nums; }

/* --- layout ------------------------------------------------ */
.wrap {
  width: min(100% - 2.5rem, 1120px);
  margin-inline: auto;
}
.stack > * + * { margin-block-start: var(--gap, 1.1rem); }

/* --- controls ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; line-height: 1;
  padding: .82rem 1.35rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, transform .08s ease;
  /* 44px minimum touch target — thumbs, not cursors. */
  min-height: 46px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: var(--on-green); border-color: var(--green); }
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); color: var(--on-green); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { background: var(--paper-sunken); border-color: var(--ink-faint); color: var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.field { display: flex; flex-direction: column; gap: .38rem; }
.field label { font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: var(--step--1); color: var(--ink-faint); }

input, textarea, select {
  font: inherit;
  width: 100%;
  padding: .78rem .9rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  min-height: 46px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, textarea:focus, select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-wash);
  outline: none;
}
input[aria-invalid="true"] { border-color: var(--danger); }

.msg {
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--step--1);
  border: 1.5px solid transparent;
}
.msg-error { background: var(--danger-wash); border-color: var(--danger); color: var(--danger); }
.msg-ok    { background: var(--green-wash);  border-color: var(--green);  color: var(--green); }
.msg-warn  { background: var(--warn-wash);   border-color: var(--warn);   color: var(--warn); }

/* Screen-reader-only, but still focusable when it is a skip link. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; inset-inline-start: 1rem; inset-block-start: -100%;
  background: var(--green); color: var(--on-green);
  padding: .7rem 1.1rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 100; font-weight: 600; text-decoration: none;
}
.skip:focus { inset-block-start: 0; color: var(--on-green); }
