/* ============================================================
   Knowsis Questionnaire Audit – form + confirmation styles
   Dark theme palette to feel cohesive with apps.knowsis.work.
   ============================================================ */

:root {
  /* Page background — canonical Knowsis navy gradient (matches the chrome) */
  --navy-deep:    #142440;
  --navy-mid:     #1e3a5f;
  --bg:           linear-gradient(135deg, #142440 0%, #1e3a5f 100%);

  /* Glassmorphic surface tokens (per apps.knowsis.work tool cards) */
  --card-bg:           rgba(255, 255, 255, 0.04);
  --card-bg-elevated:  rgba(255, 255, 255, 0.06);
  --card-border:       rgba(191, 144, 0, 0.3);
  --card-border-hover: #BF9000;
  --input-bg:          rgba(255, 255, 255, 0.06);
  --input-border:      rgba(255, 255, 255, 0.15);
  --rule:              rgba(255, 255, 255, 0.10);

  /* Typography colours */
  --text:         rgba(255, 255, 255, 0.95);
  --text-soft:    rgba(255, 255, 255, 0.70);
  --text-weak:    rgba(255, 255, 255, 0.50);

  /* Brand */
  --accent:       #BF9000;   /* knowsis gold */
  --accent-soft:  #D4A800;   /* canonical hover-gradient partner */
  --gold-glow:    rgba(191, 144, 0, 0.3);
  --gold-tint:    rgba(191, 144, 0, 0.08);

  --success:      #10b981;
  --error:        #ef4444;
  --shadow-card:        0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-card-hover:  0 20px 60px rgba(0, 0, 0, 0.3), 0 0 30px rgba(191, 144, 0, 0.1);
  --radius:       20px;
  --radius-sm:    8px;
  --max:          780px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  font-family: 'Calibri', 'Segoe UI', Roboto, sans-serif; /* canonical Section 2 */
  font-weight: 300;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;   /* canonical: contain the off-screen mobile nav drawer */
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--accent-soft); text-decoration: underline; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 20px 60px;
}
.container.narrow { max-width: 640px; }
@media (max-width: 768px) {
  .container { padding: 36px 16px 40px; }
}

/* ============================================================
   Audit Hero — framing copy at the top of the form
   ============================================================ */
.audit-hero {
  text-align: center;
  margin: 0 auto 36px;
  max-width: 720px;
}
.audit-hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(191, 144, 0, 0.12);
  border: 1px solid rgba(191, 144, 0, 0.4);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.audit-hero-title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 14px;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  text-wrap: balance;       /* keep multi-word titles from orphaning a single trailing word */
}
.audit-hero-title .accent {
  background: linear-gradient(135deg, #BF9000 0%, #FFD700 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.audit-hero-lede {
  font-size: 16px;
  color: var(--text-soft);
  line-height: 1.7;
  margin: 0;
}
@media (max-width: 768px) {
  .audit-hero { margin-bottom: 28px; }
  .audit-hero-title { font-size: 28px; }
  .audit-hero-lede { font-size: 15px; }
}

/* ============================================================
   Canonical Knowsis chrome — header + footer (Issue 2a redo)
   Reference: /home/knowsis-ai/knowsis-audit-context/knowsis-web/
     SKILL.md Sections 1, 5, 11; references/logo.md.
   These rules are lifted from knowsis.net/styles.css verbatim
   so apps.knowsis.work/audit/ feels like a sibling surface.
   ============================================================ */
.header {
  background: linear-gradient(135deg, #142440 0%, #1e3a5f 100%);
  color: white;
  padding: 20px 0;
  border-bottom: 4px solid #BF9000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
}
.logo-image {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(191, 144, 0, 0.3));
  transition: all 0.3s ease;
}
.logo-image:hover {
  filter: drop-shadow(0 4px 12px rgba(191, 144, 0, 0.5));
  transform: scale(1.05);
}
.logo-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 3px;
  color: white;
}
.logo-accent { color: #BF9000; }

.nav-menu {
  display: flex;
  align-items: center;
}
nav a {
  color: white;
  text-decoration: none;
  margin-left: 30px;
  font-weight: 500;
  transition: all 0.3s;
  position: relative;
}
nav a:hover { color: #BF9000; }
nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: #BF9000;
  transition: width 0.3s ease;
}
nav a:hover::after { width: 100%; }

.header-badge {
  background: rgba(191, 144, 0, 0.15);
  border: 1px solid #BF9000;
  color: #BF9000;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Default: hide the in-drawer badge copy. The mobile media query below
   reverses this so the drawer copy is shown and the desktop copy is hidden. */
.nav-menu > .header-badge { display: none; }

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  z-index: 1001;
  background: none;
  border: none;
  padding: 5px;
}
.hamburger span {
  width: 25px;
  height: 3px;
  background: white;
  transition: all 0.3s ease;
  border-radius: 2px;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

.footer {
  background: linear-gradient(135deg, #142440 0%, #1e3a5f 100%);
  color: white;
  padding: 60px 30px 30px;
  border-top: 4px solid #BF9000;
  margin-top: 60px;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  margin-bottom: 30px;
}
.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}
.footer-links a:hover { color: #BF9000; }
.footer-legal {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.footer-legal a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.3s;
}
.footer-legal a:hover { color: #BF9000; }
.footer-copyright {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: linear-gradient(180deg, #142440 0%, #1e3a5f 100%);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 80px;
    transition: right 0.3s ease;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }
  .nav-menu.active { right: 0; }
  .nav-menu a {
    margin: 0;
    padding: 18px 30px;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 16px;
  }
  .nav-menu a:hover { background: rgba(191, 144, 0, 0.1); }
  .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  .nav-overlay.active { display: block; }
  /* Badge would overflow alongside the hamburger; surface it inside the
     drawer instead so the platform identifier stays discoverable. */
  .header-right > .header-badge { display: none; }
  .nav-menu .header-badge {
    display: inline-block;
    margin: 16px 30px 0;
    align-self: flex-start;
  }
}

/* ============================================================
   Stepper — discrete cards with gold-prominent active state
   ============================================================ */
.stepper {
  list-style: none;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  padding: 0;
  margin: 0 0 32px;
}
.stepper li {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  color: var(--text-weak);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: all 0.3s ease;
  position: relative;
}
.stepper li .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-weak);
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.stepper li.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(191, 144, 0, 0.18) 0%, rgba(191, 144, 0, 0.06) 100%);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(191, 144, 0, 0.2);
}
.stepper li.active .num {
  background: linear-gradient(135deg, #BF9000 0%, #D4A800 100%);
  color: var(--navy-deep);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(191, 144, 0, 0.4);
}
.stepper li.done {
  color: var(--text-soft);
  border-color: rgba(191, 144, 0, 0.4);
}
.stepper li.done .num {
  background: rgba(191, 144, 0, 0.2);
  color: var(--accent);
  border-color: rgba(191, 144, 0, 0.5);
}
.stepper li.done .num::before {
  content: '✓';
  font-size: 16px;
}
.stepper li.done .num-text { display: none; }
@media (max-width: 560px) {
  .stepper { gap: 8px; }
  .stepper li { padding: 10px 12px; gap: 8px; font-size: 13px; }
  .stepper li .num { width: 26px; height: 26px; font-size: 13px; }
  /* On very narrow viewports, hide non-active labels to save room */
  .stepper li:not(.active) .label { display: none; }
}

/* ============================================================
   Card — glassmorphic step panel with gold top stripe
   (per apps.knowsis.work tool card + skill Section 7 emphasis)
   ============================================================ */
.card {
  position: relative;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #BF9000 0%, #D4A800 50%, #BF9000 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}
@media (max-width: 768px) {
  .card { padding: 28px 22px; border-radius: 16px; }
  .card::before { border-radius: 16px 16px 0 0; }
}

/* Step eyebrow (above per-step H1) */
.step-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

/* Per-step H1 — DAP hero typography with gold-accent key word */
h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  color: var(--text);
  text-wrap: balance;
}
h1 .accent {
  background: linear-gradient(135deg, #BF9000 0%, #FFD700 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
@media (max-width: 768px) {
  h1 { font-size: 26px; }
}

h2 { font-size: 17px; margin: 24px 0 8px; font-weight: 700; color: var(--text); }

.lede {
  margin: 0 0 28px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
}

/* ============================================================
   Forms — dark CTA pattern (skill Section 8)
   ============================================================ */
.field { display: block; margin: 0 0 22px; }
.field-label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: 0.2px;
}
.field-label .weak { color: var(--text-weak); font-weight: 400; font-size: 13px; }
.hint { display: block; font-size: 13px; color: var(--text-soft); margin-top: 6px; }
.hint.counter { color: var(--text-weak); }
.hint.counter.ok { color: var(--success); }
.error {
  display: block;
  font-size: 13px;
  color: var(--error);
  margin-top: 6px;
  min-height: 1em;
}
input[type=text], input[type=email], input[type=number],
select, textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  transition: all 0.2s ease;
}
input::placeholder, textarea::placeholder {
  color: var(--text-weak);
}
input:hover, select:hover, textarea:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(191, 144, 0, 0.2);
  background: rgba(255, 255, 255, 0.10);
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
textarea { resize: vertical; min-height: 96px; }

/* Custom select arrow (canonical gold triangle from knowsis.net) */
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23BF9000' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
select option { background: var(--navy-mid); color: white; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid > .field { margin-bottom: 0; }
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}

/* ----- buttons ----- */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
button {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 30px;
  border-radius: 30px;          /* canonical pill */
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.primary {
  background: linear-gradient(135deg, #BF9000 0%, #D4A800 100%);
  color: #142440;             /* navy — WCAG AA on gold gradient (8.4:1) */
  border-color: transparent;
}
button.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(191, 144, 0, 0.4);
}
button.primary:active:not(:disabled) { transform: translateY(0); }
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
button.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   Upload dropzone
   ============================================================ */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 28px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(191, 144, 0, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(191, 144, 0, 0.15);
}
.drop-icon { font-size: 38px; color: var(--accent); margin-bottom: 4px; }
.drop-line strong { color: var(--text); }
.drop-line { color: var(--text-soft); font-size: 15px; }
.drop-meta { color: var(--text-weak); font-size: 13px; margin-top: 6px; }

.upload-status {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
}
.upload-status.ok    { border-color: rgba(16, 185, 129, 0.5); background: rgba(16, 185, 129, 0.08); }
.upload-status.error { border-color: var(--error); color: var(--error); background: rgba(239, 68, 68, 0.08); }
.upload-status .filename { color: var(--text); font-weight: 700; }
.upload-status .meta { color: var(--text-soft); }

/* ============================================================
   Payment summary — structured stat block
   ============================================================ */
.payment-summary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  margin: 8px 0 22px;
}
.payment-summary h2 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.payment-summary dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 18px;
  margin: 0;
}
.payment-summary dt { color: var(--text-soft); font-size: 14px; }
.payment-summary dd { margin: 0; color: var(--text); font-size: 15px; word-break: break-word; }

/* ============================================================
   Confirmation page — structured stat-block layout
   ============================================================ */
.confirmation { text-align: center; padding: 48px 36px; }
@media (max-width: 768px) {
  .confirmation { padding: 32px 22px; }
}
.confirmation-icon {
  margin: 0 auto 20px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(191, 144, 0, 0.18) 0%, rgba(191, 144, 0, 0.06) 100%);
  border: 1px solid rgba(191, 144, 0, 0.4);
  border-radius: 16px;
}
.confirmation h1 { font-size: 32px; margin-bottom: 14px; }
.confirmation .lede { max-width: 520px; margin: 0 auto 32px; }

.confirmation .meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 auto;
  text-align: left;
  max-width: 660px;
}
.confirmation .meta > .stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.confirmation .meta .stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.confirmation .meta .stat-value {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
  line-height: 1.5;
}
.confirmation .meta .stat-value code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
  display: inline-block;
}

.confirmation #status-foot {
  max-width: 520px;
  margin: 28px auto 0;
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- utility ----- */
.muted { color: var(--text-soft); }
.small { font-size: 13px; }
