/* Deploy Task Template — application styles.
   Every value here is ported 1:1 from the Claude Design export
   (design/export/Deploy Task Template.dc.html) and the design system's
   Button / Badge / Input components. Keep them in sync with the export. */

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-page);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  color: var(--text-heading);
  margin: 0;
}

/* ---------------------------------------------------------------- header */

.page-header {
  background: var(--surface-dark);
  padding: 48px 24px 56px;
}

.page-header__inner {
  max-width: var(--container);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-script);
  font-size: 28px;
  color: var(--gold-400);
  line-height: 1.1;
}

.page-title {
  font-size: var(--text-3xl);
  text-transform: uppercase;
  color: var(--cream-50);
  margin: 4px 0 0;
  text-wrap: balance;
}

.page-lede {
  margin: 12px 0 0;
  font-size: 17px;
  line-height: var(--leading-body);
  color: var(--tan-300);
  max-width: 560px;
  text-wrap: pretty;
}

/* ------------------------------------------------------------------ grid */

.layout {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  /* min() is load-bearing: auto-fit collapses to one track but that track keeps
     the 340px minimum, so without it the layout overhangs a 320px viewport
     (WCAG 1.4.10 Reflow, and 400% zoom on a 1280px screen). */
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 24px;
  align-items: start;
}

.layout__col {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  min-width: 0;
}

.card--sticky {
  position: sticky;
  top: 24px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.card__head--tight { margin-bottom: 12px; }

.card__title {
  font-size: var(--text-xl);
  text-transform: uppercase;
}

.field-stack {
  display: grid;
  gap: 16px;
}

/* ----------------------------------------------------------------- badge */
/* components/core/Badge.jsx */

.badge {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
  white-space: nowrap;
}

.badge--neutral { background: var(--surface-warm); color: var(--brown-600); }
.badge--brand   { background: var(--brand); color: #fff; }

/* ----------------------------------------------------------------- input */
/* components/forms/Input.jsx */

.field {
  display: block;
  font-family: var(--font-body);
  min-width: 0;
}

.field__label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.field__hint {
  font-weight: 400;
  color: var(--text-muted);
}

.field__input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-strong);
  background: var(--surface-card);
  color: var(--text-body);
  outline: none;
  transition: box-shadow var(--dur-fast);
}

.field__input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ---------------------------------------------------------------- button */
/* components/core/Button.jsx */

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--dur-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.1;
}

.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn:focus-visible {
  /* An outline, not a box-shadow: --focus-ring is rgba(...,.35), which resolves
     to 1.77:1 on the white card, and a box-shadow is discarded in forced-colors
     mode. Brand red is 4.64:1 on white and 4.11:1 on the warm surface, and the
     offset keeps it off the primary button's own red fill. */
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.btn--primary { background: var(--brand); color: var(--text-on-brand); }
.btn--primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn--primary:active:not(:disabled) { background: var(--brand-press); transform: scale(.98); }

.btn--secondary {
  background: transparent;
  color: var(--text-heading);
  border-color: var(--black-900);
}
.btn--secondary:hover:not(:disabled) { background: var(--black-900); color: var(--text-inverse); }
.btn--secondary:active:not(:disabled) { transform: scale(.98); }

/* ----------------------------------------------------------------- steps */

.steps {
  display: grid;
  gap: 4px;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: background var(--dur-fast) var(--ease-out);
}

.step:hover { background: var(--surface-warm); }
.step:focus-visible { outline: 3px solid var(--brand); outline-offset: -1px; }

.step__box {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  background: var(--white);
  margin-top: 2px;
  position: relative;
}

.step__tick {
  position: absolute;
  inset: -2px;
  border-radius: 6px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.step__tick svg {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step__n {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-muted);
  width: 22px;
  flex: none;
  margin-top: 3px;
  letter-spacing: .04em;
}

.step__text {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  color: var(--text-body);
}

.step[aria-checked="false"] .step__text {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* A step whose {subdomain} value is blank is forced off and cannot be toggled on.
   No opacity here: it would drag --text-muted below the 4.5:1 text threshold. */
.step--skipped { cursor: default; }
.step--skipped:hover { background: transparent; }

.step__var {
  background: var(--cream-100);
  /* --brand is only 4.11:1 on --cream-100; --brand-hover (red-600) is 5.16:1.
     Still the design system's own palette, one step darker. */
  color: var(--brand-hover);
  font-weight: 700;
  border-radius: 6px;
  padding: 1px 6px;
  border: 1px solid var(--border-soft);
}

/* ---------------------------------------------------------------- result */

.output {
  background: var(--cream-50);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  min-height: 220px;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-body);
  margin: 0;
  font-family: var(--font-body);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  align-items: center;
}

/* --------------------------------------------------------- format switch */

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-warm);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
}

.segmented__btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  padding: 5px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--brown-600);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.segmented__btn:hover { color: var(--text-heading); }

.segmented__btn[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}

.segmented__btn:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- footer */

.page-footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px 48px;
  font-size: 13px;
  color: var(--text-muted);
}

.page-footer a { color: var(--brand-hover); text-decoration: underline; }
.page-footer a:hover { color: var(--brand-press); }

/* ------------------------------------------------------------ responsive */
/* The export is a fixed desktop layout; below the 340px grid minimum the
   auto-fit grid already collapses to one column. These only soften the
   generous desktop padding on small screens. */

@media (max-width: 560px) {
  .page-header { padding: 32px 18px 36px; }
  .eyebrow { font-size: 22px; }
  .page-title { font-size: var(--text-2xl); }
  .page-lede { font-size: 15px; }
  .layout { padding: 20px 18px 44px; gap: 18px; }
  .card { padding: 18px; border-radius: var(--radius-md); }
  .card--sticky { position: static; }
  .page-footer { padding: 0 18px 32px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* The sticky Result panel is only useful when it can't scroll past. */
@media (max-height: 720px) {
  .card--sticky { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .btn:active:not(:disabled) { transform: none; }
}

@media print {
  .page-header, .layout__col, .actions, .segmented, .page-footer { display: none !important; }
  .layout { display: block; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .card--sticky { position: static; }
  .output { border: 0; background: transparent; min-height: 0; }
}
