/* ktb-temel.css: danisan foundation (TASARIM.md 4.1, 4.4, 4.5, 5.1, 5.5, 7.9).
   Tokens, base, buttons, cards and the system page. Loaded before gorsel-test.css on /GorselTest and by
   _DurumLayout (404, expired report, errors). The report keeps its own palette in ktb-patient-tokens.css.
   Fonts: /fonts/font-faces.css. */

:root {
  /* psikorontgen.com palette (owner, 2026-11-27): ice blue paper, navy ink and primary, orange only for links
     and a warm pause tint. */
  --paper: #eef6fb;
  --surface: #ffffff;
  --surface-2: #dcecf6;
  --sand: #fdeee3;
  --sand-ink: #8a3a08;
  --line: #cfe1ec;
  --line-ui: #6b8496;
  --ink: #14324a;
  --ink-soft: #3b5568;
  --ink-muted: #4a6375;
  --accent: #14324a;
  --accent-deep: #0c2233;
  --accent-soft: #dcecf6;
  --accent-ink: #14324a;
  --accent-line: #7fb6d6;
  --link: #a8480a;

  /* the abstract horizon of the report cover, reused on the test start */
  --sun: #ffffff;
  --hill-1: #c6dfef;
  --hill-2: #a3cbe4;
  --hill-3: #7fb6d6;

  --font-sans: 'Inter', -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --e1: 0 1px 2px rgb(20 50 74 / .06), 0 6px 18px -10px rgb(20 50 74 / .14);
  --e2: 0 2px 4px rgb(20 50 74 / .06), 0 18px 40px -18px rgb(20 50 74 / .2);

  --t-fast: 140ms;
  --t-base: 220ms;
  --t-slow: 360ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --focus-ring: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "cv11" 1;
  -webkit-font-smoothing: antialiased;
  hyphens: manual;
}

h1, h2, h3 { color: var(--ink); text-wrap: balance; }

a { color: var(--link); }

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Skip link: off screen until it receives keyboard focus. */
.ktb-skip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.ktb-skip:focus,
.ktb-skip:focus-visible { transform: none; }

/* ---- Buttons (5.1): one primary per screen ---- */
.ktb-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  margin: 0;
  padding: 0 28px;
  border: 0;
  border-radius: var(--r-pill);
  font: 600 17px/1.25 var(--font-sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}
.ktb-btn svg { flex: none; transition: transform var(--t-fast) var(--ease); }
.ktb-btn:active { transform: scale(.99); }

.ktb-btn--primary {
  width: 100%;
  max-width: 420px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--e1);
}
.ktb-btn--primary:hover { background: var(--accent-deep); box-shadow: var(--e2); }
.ktb-btn--primary:hover svg { transform: translateX(2px); }

.ktb-btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-ui);
}
.ktb-btn--secondary:hover { background: var(--surface-2); }

.ktb-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.ktb-btn:disabled,
.ktb-btn[aria-disabled="true"] {
  background: var(--surface-2);
  color: var(--ink-muted);
  box-shadow: none;
  cursor: default;
}

@media (min-width: 1024px) {
  .ktb-btn--primary { width: auto; min-width: 240px; }
}

/* ---- Cards (5.5): main card; inner boxes never carry a shadow ---- */
.ktb-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--e1);
  padding: 24px 20px;
}
@media (min-width: 720px) {
  .ktb-card { padding: 32px; }
}

/* Icon disc on phase and system cards. Accent for steps, sand for a pause, neutral for problems
   (a level hue never marks a system state). */
.ktb-disc {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.ktb-disc--sand { background: var(--sand); color: var(--sand-ink); }
.ktb-disc--neutral { background: var(--surface-2); color: var(--ink-soft); }

/* ---- System page (7.9): 404, expired report, errors ---- */
.ktb-durum {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
@media (min-width: 380px) {
  .ktb-durum { padding-left: 20px; padding-right: 20px; }
}

/* The client path carries the ice-blue line on top of its card, as the landing page's "Kendiniz icin" card. */
.ktb-durum-card {
  width: 100%;
  max-width: 520px;
  border-top: 4px solid var(--accent-line);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: ktb-rise var(--t-slow) var(--ease) both;
}
.ktb-durum-card .ktb-disc { margin-bottom: 18px; }
.ktb-durum-title {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ktb-durum-text {
  margin: 0 0 24px;
  max-width: 40ch;
  color: var(--ink-soft);
}
@media (min-width: 720px) {
  .ktb-durum-title { font-size: 28px; }
}

@keyframes ktb-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes ktb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ktb-btn,
  .ktb-btn svg { transition: none; }
  .ktb-btn:active,
  .ktb-btn--primary:hover svg { transform: none; }
  .ktb-durum-card { animation: ktb-fade 120ms linear both; }
}

/* Night audit 2026-11-06, round 5: the 404 / expired-link text runs about 7 lines on a phone; centred it read
   ragged. Same rule as the test's phase cards: the card reads from one left edge, the card stays centred. */
.ktb-durum-card { align-items: flex-start; text-align: left; }
.ktb-durum-text { max-width: none; }

/* NIGHT-R9 (2026-11-08): forced-colors mode drops box-shadow, which drew every focus ring here (WCAG 2.4.7). */
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText !important; outline-offset: 2px !important; }
}

/* ---- Privacy notice (launch 2026-11-27): the system page card, wide enough for a long text and one table ---- */
.ktb-durum:has(.ktb-gizlilik) { place-items: start center; }
.ktb-gizlilik { max-width: 720px; animation: none; }
.ktb-gizlilik h2 {
  margin: 28px 0 8px;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
}
.ktb-gizlilik p,
.ktb-gizlilik ul { margin: 0 0 12px; color: var(--ink-soft); }
.ktb-gizlilik ul { padding-left: 22px; }
.ktb-gizlilik li { margin: 0 0 4px; }
.ktb-gizlilik strong { color: var(--ink); }
.ktb-gizlilik a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.ktb-gizlilik-tablo { width: 100%; overflow-x: auto; margin: 0 0 12px; }
.ktb-gizlilik table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ktb-gizlilik th,
.ktb-gizlilik td { padding: 8px 10px; border-bottom: 1px solid var(--line, #cfe1ec); text-align: left; vertical-align: top; }
.ktb-gizlilik th { font-weight: 600; color: var(--ink); }
@media (max-width: 520px) {
  .ktb-gizlilik table, .ktb-gizlilik tbody, .ktb-gizlilik tr, .ktb-gizlilik td { display: block; }
  .ktb-gizlilik thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ktb-gizlilik tr { padding: 8px 0; border-bottom: 1px solid var(--line, #cfe1ec); }
  .ktb-gizlilik td { border: 0; padding: 2px 0; }
  .ktb-gizlilik td:first-child { font-weight: 600; color: var(--ink); }
}
.ktb-gizlilik-don { margin-top: 24px; }
.ktb-gizlilik-don a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Privacy link under every system page */
.ktb-durum { min-height: calc(100dvh - 64px); }
.ktb-durum-alt { display: flex; justify-content: center; padding: 8px 16px 20px; font-size: 15px; }
.ktb-durum-alt a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); }
