/* ================================================================
   Telmo component styles, reproduced as plain CSS for the device check.
   Every value comes from tokens.css or a Telmo spec in
   AMOS-X/system-design/dev-guide/sections (cited per block).
   Light theme only: dark mode is out of scope (i18n-theming.js).
   ================================================================ */

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

/* No font-size on html: the page reports the user's root font size. */
body {
  margin: 0;
  background: var(--bg-app);
  color: var(--text-2);
  font-family: var(--font-primary);
  font-size: var(--fs-body-lg);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* Column width: a documented layout literal (foundation.js, Spacing math). */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg) var(--space-4xl);
  /* Notched phones / tablets in landscape: keep content out of the safe-area insets. */
  padding-left: max(var(--space-lg), env(safe-area-inset-left));
  padding-right: max(var(--space-lg), env(safe-area-inset-right));
  padding-bottom: max(var(--space-4xl), env(safe-area-inset-bottom));
}

/* Lockup (foundation.js, product-mark): "AMOS" Poppins 600 / 1px tracking + duotone X,
   mark = cap height + ~8% (20px text -> 22px mark), gap ~5px (half a bar-width), margin-top -1px. */
.brand-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); margin-bottom: var(--space-lg); }
.brand { display: flex; align-items: center; gap: 5px; }
.brand-text {
  font-family: var(--font-primary);
  font-size: var(--fs-page-title);
  font-weight: var(--fw-semibold);
  letter-spacing: 1px;
  line-height: 1;
  color: var(--text-1);
}
.brand-mark { width: 22px; height: 22px; margin-top: -1px; }
/* Veridian wordmark (company logo), right side of the brand bar; height matches the lockup. */
.company-logo { display: block; height: 18px; width: auto; }

/* Page title (foundation.js, Page Title Style) */
.page-title {
  margin: 0 0 var(--space-xs);
  font-size: var(--fs-page-title);
  font-weight: var(--fw-semibold);
  line-height: 1.25;
  color: var(--text-1);
}
.subtitle { margin: 0 0 var(--space-xl); color: var(--text-3); }

/* Content card (components.js, content-cards) */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
}
.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border-1);
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-4);
}
.card-header svg { width: 16px; height: 16px; flex-shrink: 0; }
.card-header .status { margin-left: auto; }
.card-body { padding: var(--space-lg) var(--space-xl) var(--space-xl); }
.card-body > :first-child { margin-top: 0; }
.card-body > :last-child { margin-bottom: 0; }

/* Field grid (components.js, content-cards) */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg) var(--space-3xl); }
.field-label {
  margin-bottom: 3px;
  font-size: var(--fs-label-lg);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-4);
}
.field-value { font-size: var(--fs-body-lg); font-weight: var(--fw-medium); color: var(--text-1); overflow-wrap: anywhere; }
.field-value.mono { font-family: var(--font-mono); font-size: var(--fs-body); color: var(--text-2); }
.field-value--full { grid-column: 1 / -1; }
@media (max-width: 599.98px) { .field-grid { grid-template-columns: 1fr; } }

/* Form controls (controls.js, form-controls) */
.field { margin-bottom: var(--space-lg); }
/* Stacked fields: gap instead of margins, so a [hidden] field leaves no space behind. */
.stack { display: flex; flex-direction: column; gap: var(--space-lg); }
.stack > .field { margin-bottom: 0; }
.label {
  display: block;
  margin-bottom: 5px;
  font-size: var(--fs-label-lg);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-4);
}
.required { color: var(--red-text); }
.input, .textarea {
  display: block;
  width: 100%;
  min-height: var(--field-height);
  padding: 9px 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--fs-body-lg);
  color: var(--text-1);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:focus, .textarea:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(0, 168, 178, 0.1);
}
.textarea { min-height: 56px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.textarea.mono { font-family: var(--font-mono); font-size: var(--fs-label-lg); color: var(--text-2); }
.helper { margin-top: var(--space-xs); font-size: var(--fs-label-lg); color: var(--text-4); }

/* Buttons (controls.js, buttons) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--field-height);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--action); color: var(--text-inverse); }
.btn-primary:hover { background: var(--action-hover); }
.btn-secondary { background: var(--bg-surface); color: var(--text-2); border: 1px solid var(--border-2); }
.btn-secondary:hover { background: var(--bg-surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--bg-surface-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
/* Compact size (controls.js, Sizes): 6px 12px, 12px / 600, 14px icon */
.btn-compact { min-height: 0; padding: 6px var(--space-md); font-size: var(--fs-body); }
.btn-compact svg { width: 14px; height: 14px; }

/* Details toggle (components.js, feedback-patterns, Error Details Toggle) */
.details-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--text-4);
}
.details-toggle:hover { color: var(--text-2); }
.details-toggle:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.details-toggle svg { width: 14px; height: 14px; transition: transform 0.2s; }
.details-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

/* Inline banner (layouts.js login error: red bg/border/text; green for success) */
.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: var(--fs-body-lg);
}
.banner svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.banner-error { background: var(--red-bg); border-color: var(--red-border); color: var(--red-text); }
.banner-success { background: var(--green-bg); border-color: var(--green-border); color: var(--green-text); }

/* Status pill (components.js, pills: Status Pills soft-fill; Closed = neutral bordered) */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-1);
  font-size: var(--fs-label-lg);
  font-weight: var(--fw-semibold);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-3);
  background: var(--bg-surface-2);
}
.status svg { width: 13px; height: 13px; }
.status.done { color: var(--green-text); background: var(--green-bg); border-color: transparent; }
.status.skipped { color: var(--amber-text); background: var(--amber-bg); border-color: transparent; }

/* Phone tier (ADR 0060, <= 767px): primary action spans the column */
@media (max-width: 767.98px) {
  .btn-block-phone { width: 100%; }
}

/* Touch tier (ADR 0060): 44px targets and 16px field text on coarse pointers.
   Applied by pointer type, not width, so it covers tablets (Tab Active5) as well as phones. */
@media (pointer: coarse) {
  .btn, .input { min-height: var(--touch-target-min); }
  .input, .textarea { font-size: var(--fs-touch-input); }
  .details-toggle { min-height: var(--touch-target-min); }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
  .details-toggle svg { transition: none; }
}

.mono { font-family: var(--font-mono); }
[hidden] { display: none !important; }
