/* Styxtech CSAT — styles
   Brand tokens defined as CSS custom properties for easy re-skin.
   No external fonts/CSS loaded: keeps CSP strict and FCP fast. */

:root {
  /* Brand palette — lime-to-teal gradient reflects the Styxtech logo. */
  --color-primary:      #1B3A3A;   /* dark teal/forest — body text on light, solid brand */
  --color-primary-600:  #0F2424;
  --color-primary-400:  #2E5A4A;
  --color-accent:       #7EB93B;   /* lime green — CTAs, highlights */
  --color-accent-600:   #5F9B27;
  --color-accent-200:   #C7E950;   /* bright lime for gradient tops */

  --color-success: #146C43;
  --color-danger:  #B3261E;

  /* Surfaces */
  --color-bg:          #F4F7F3;       /* very soft green-tinted off-white */
  --color-bg-alt:      #EAF2E4;       /* card hover / subtle zone */
  --color-surface:     #FFFFFF;
  --color-border:      #D6DED4;
  --color-border-soft: #E7EDE3;
  --color-muted:       #5A6663;
  --color-text:        #16221F;

  --radius:     10px;
  --radius-sm:  6px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 2px rgba(20, 46, 44, 0.06);
  --shadow-md:  0 4px 14px rgba(20, 46, 44, 0.08);
  --shadow-lg:  0 10px 30px rgba(20, 46, 44, 0.10);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --focus-ring: 0 0 0 3px rgba(126, 185, 59, 0.35);

  --tap-target: 44px;

  /* Headline brand gradient — echoes the logo */
  --brand-gradient: linear-gradient(135deg, #C7E950 0%, #7EB93B 35%, #2E5A4A 75%, #1B3A3A 100%);
  --brand-gradient-soft: linear-gradient(135deg, #F4F9EC 0%, #E7F3D8 60%, #DCEAC5 100%);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Soft brand wash top-left so the page doesn't feel sterile */
  background-image:
    radial-gradient(ellipse 800px 400px at 0% 0%, rgba(199, 233, 80, 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 100% 10%, rgba(46, 90, 74, 0.06) 0%, transparent 70%);
  background-attachment: fixed;
}

/* Header */
.page-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-soft);
  padding: var(--space-4) var(--space-5);
  position: relative;
}
.page-header::after {
  /* Thin brand-gradient underline under the header */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: var(--brand-gradient);
  opacity: 0.85;
}
.page-header .logo { height: 56px; width: auto; display: block; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}

.page-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
  color: var(--color-muted);
  font-size: 0.875rem;
  text-align: center;
}
.page-footer a { color: var(--color-primary-400); }

/* Hero intro — warm card with soft brand gradient */
.intro {
  background: var(--brand-gradient-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.intro::before {
  /* Soft accent corner glow */
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(199, 233, 80, 0.55) 0%, transparent 70%);
  pointer-events: none;
}
.intro h1 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.25rem);
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  color: var(--color-primary);
  letter-spacing: -0.015em;
  position: relative;
}
.intro h1::after {
  /* subtle underline accent */
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: var(--space-3);
  border-radius: 2px;
  background: var(--brand-gradient);
}
.intro p {
  margin: var(--space-3) 0 0;
  color: var(--color-primary-400);
  max-width: 58ch;
  position: relative;
}

/* Progress */
.progress {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  padding: var(--space-3) 0 var(--space-4);
  margin-bottom: var(--space-4);
}
.progress-bar {
  height: 8px;
  background: var(--color-border-soft);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(20, 46, 44, 0.04);
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-gradient);
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(126, 185, 59, 0.4);
}
.progress-label {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: var(--space-2);
  font-weight: 500;
}

/* Form */
.survey { display: flex; flex-direction: column; gap: var(--space-5); }

.section {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 150ms ease, border-color 150ms ease;
  position: relative;
}
.section:hover,
.section:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
}
.section legend,
.section h2 {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 var(--space-2);
  padding: 0;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.section-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--brand-gradient-soft);
  color: var(--color-primary-400);
  display: inline-grid;
  place-items: center;
}
.section-icon svg { width: 100%; height: 100%; display: block; }
.section p.hint {
  margin: 0 0 var(--space-4);
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.field { margin-top: var(--space-5); }
.field:first-of-type { margin-top: 0; }
.field .label {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.field .label .required { color: var(--color-danger); margin-left: 2px; }
.field .help {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0 0 var(--space-3);
}
.field .error {
  display: none;
  color: var(--color-danger);
  font-size: 0.875rem;
  margin-top: var(--space-2);
  font-weight: 500;
}
.field.has-error .error { display: block; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--color-danger); }

/* Inputs */
input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  min-height: var(--tap-target);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}
input:hover:not(:focus),
textarea:hover:not(:focus),
select:hover:not(:focus) {
  border-color: var(--color-primary-400);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.char-count {
  display: block;
  text-align: right;
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: var(--space-1);
}

/* Radio groups (role) */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.radio-group .option {
  flex: 1 1 auto;
  min-width: 140px;
}
.radio-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.radio-group label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--color-surface);
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  transition: border-color 120ms ease, background 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}
.radio-group label:hover {
  border-color: var(--color-accent);
  background: #F6FBEE;
  transform: translateY(-1px);
}
.radio-group input:checked + label {
  border-color: var(--color-accent);
  background: linear-gradient(180deg, #F6FBEE 0%, #EAF4D2 100%);
  color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(126, 185, 59, 0.20);
}
.radio-group input:focus-visible + label {
  box-shadow: var(--focus-ring);
}

/* NPS scale (0-10 buttons) */
.nps-scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: var(--space-1);
}
.nps-scale .option { min-width: 0; }
.nps-scale label {
  min-height: var(--tap-target);
  padding: var(--space-2) 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nps-anchors {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: var(--space-2);
}

/* 1-5 rating (stars + N/A for service lines; 1-5 buttons for quality) */
.rating {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.rating .option { min-width: 64px; flex: 0 0 auto; }
.rating label {
  min-width: 64px;
  min-height: var(--tap-target);
}

/* Honeypot — off-screen (not display:none so bots still fill it) */
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Submit */
.actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.btn {
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  min-height: var(--tap-target);
  padding: var(--space-3) var(--space-6);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--color-primary);
  color: #fff;
  transition: background 120ms ease, transform 80ms ease, box-shadow 120ms ease;
  box-shadow: 0 1px 2px rgba(20, 46, 44, 0.15);
  letter-spacing: 0.01em;
}
.btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-accent-600) 0%, var(--color-primary) 100%);
  box-shadow: 0 4px 12px rgba(126, 185, 59, 0.30);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) { background: var(--color-bg-alt); }

/* Global status banner */
.status {
  margin: 0 0 var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: none;
  font-weight: 500;
}
.status.is-visible { display: block; }
.status.is-error {
  background: #FDECEA;
  border-color: #F5C2C0;
  color: #8B1A14;
}
.status.is-info {
  background: #EAF4D2;
  border-color: #C7E1A0;
  color: #1B3A3A;
}

/* Success page */
.success-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow-md);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.success-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--brand-gradient);
}
.success-card h1 { color: var(--color-primary); margin-top: 0; }
.success-card .reference {
  display: inline-block;
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* Mobile */
@media (max-width: 540px) {
  main { padding: var(--space-5) var(--space-4) var(--space-8); }
  .intro { padding: var(--space-5) var(--space-4); }
  .section { padding: var(--space-4); }
  .nps-scale { grid-template-columns: repeat(6, 1fr); }
  .radio-group .option { min-width: 120px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  .page-header .logo { height: 44px; }
}

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

/* Screen-reader-only (accessible, but visually hidden) */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
