:root {
  /* PAR Core Colors */
  --par-0: #212438;
  --par-1: #2f3452;
  --par-2: #8c9fff;
  --par-3: #6864d1;
  --par-4: #ff5719;
  --par-5: #f8931c;

  /* Tints */
  --par-2-10: #f3f5ff; /* Off-white background */
  --par-2-20: #e2e6f5; /* Border / hairline */

  /* Status (UI only) */
  --par-error: #ff2751;
  --par-success: #34c679;

  --font-primary: "Manrope", Arial, sans-serif;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(33, 36, 56, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  font-weight: 400;
  color: var(--par-1);
  background: var(--par-2-10);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Header (white, sticky — matches partech.com) ------------------------- */
.site-header {
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 30px;
  width: auto;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background: var(--par-2-20);
}

.brand-title {
  color: #6b7191;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.3px;
}

/* Top-right CTA, echoing partech.com's "Book a Demo" placement. */
.header-cta {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--par-2), var(--par-3));
  padding: 10px 22px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(104, 100, 209, 0.3);
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.header-cta:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(104, 100, 209, 0.4);
}

/* PAR's approved 4-colour brand strip (PAR 2 → 3 → 4 → 5). */
.brand-strip {
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--par-2) 0 25%,
    var(--par-3) 25% 50%,
    var(--par-4) 50% 75%,
    var(--par-5) 75% 100%
  );
}

/* --- Page ----------------------------------------------------------------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}

.intro {
  margin-bottom: 28px;
}

.intro h1 {
  font-weight: 200;
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 10px;
  color: var(--par-1);
  line-height: 1.15;
}

.subtitle {
  font-size: 16px;
  margin: 0;
  max-width: 60ch;
  color: var(--par-1);
}

/* --- 404 / error page ----------------------------------------------------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.error-code {
  font-weight: 200;
  font-size: clamp(72px, 16vw, 160px);
  line-height: 1;
  margin: 0;
  background: linear-gradient(90deg, var(--par-3), var(--par-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page h1 {
  font-weight: 200;
  font-size: clamp(28px, 5vw, 44px);
  margin: 4px 0 0;
  color: var(--par-1);
  line-height: 1.15;
}

.error-page .subtitle {
  margin: 10px 0 28px;
}

.error-page .btn-primary {
  display: inline-block;
  text-decoration: none;
}

/* --- Card / form ---------------------------------------------------------- */
.card {
  background: #ffffff;
  border: 1px solid var(--par-2-20);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 28px;
}

legend {
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--par-3);
  padding: 0;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-full {
  grid-column: 1 / -1;
  margin-top: 16px;
}

/* The flex display on .field overrides the browser default for [hidden], so
   re-assert it for conditionally shown fields. */
.field[hidden] {
  display: none;
}

.field > span {
  font-size: 13px;
  font-weight: 800;
  color: var(--par-1);
}

.field em {
  color: var(--par-4);
  font-style: normal;
}

input,
select,
textarea {
  font-family: var(--font-primary);
  font-size: 15px;
  color: var(--par-1);
  background: #ffffff;
  border: 1.5px solid var(--par-2);
  border-radius: 999px;
  padding: 12px 18px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--par-3);
  box-shadow: 0 0 0 3px rgba(104, 100, 209, 0.18);
}

/* Only flag invalid fields red after the user has attempted to submit. */
.was-submitted input:invalid,
.was-submitted select:invalid,
.was-submitted textarea:invalid {
  border-color: var(--par-error);
}

textarea {
  resize: vertical;
  /* Pill ends look wrong on a tall multi-line box — use a soft rounded corner. */
  border-radius: 20px;
}

input:read-only,
input:disabled {
  background: #eef0f8;
  color: #6b7191;
  cursor: not-allowed;
}

/* --- Honeypot (anti-bot) — keep visually & functionally hidden ------------ */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Product combobox (type-to-search) ------------------------------------ */
.combobox {
  position: relative;
}

.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #ffffff;
  border: 1px solid #9aa3c4;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
}

.combobox-list[hidden] {
  display: none;
}

.combobox-option {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 15px;
  color: var(--par-1);
  cursor: pointer;
}

.combobox-option:hover,
.combobox-option.active {
  background: var(--par-2-10);
}

.combobox-option .code {
  color: #6b7191;
  font-size: 13px;
  white-space: nowrap;
}

.combobox-empty {
  padding: 9px 11px;
  font-size: 14px;
  color: #6b7191;
}

/* --- Return policy --------------------------------------------------------- */
.policy-box {
  border: 1px solid #9aa3c4;
  border-radius: 8px;
  background: var(--par-2-10);
  padding: 16px 18px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
  color: var(--par-1);
}

.policy-box h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
}

.policy-box p {
  margin: 0 0 10px;
}

.policy-box ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.policy-box li {
  margin-bottom: 8px;
}

.policy-box a {
  color: var(--par-3);
}

.policy-consent {
  font-weight: 800;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
}

.checkbox-field input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
  border: none;
  flex: 0 0 auto;
  accent-color: var(--par-3);
  cursor: pointer;
}

.checkbox-field span {
  font-size: 14px;
  font-weight: 400;
  color: var(--par-1);
}

.checkbox-field em {
  color: var(--par-4);
  font-style: normal;
}

/* --- Turnstile (CAPTCHA) --------------------------------------------------- */
.turnstile {
  margin: 4px 0 20px;
  min-height: 65px; /* reserve space to avoid layout shift while it loads */
}

/* --- Messages ------------------------------------------------------------- */
.form-message {
  display: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}

.form-message.show {
  display: block;
}

.form-message.success {
  background: rgba(52, 198, 121, 0.12);
  border: 1px solid var(--par-success);
  color: #1c7a4a;
}

.form-message.error {
  background: rgba(255, 39, 81, 0.1);
  border: 1px solid var(--par-error);
  color: #b3132f;
}

.form-message ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* --- Actions -------------------------------------------------------------- */
.actions {
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--par-2), var(--par-3));
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(104, 100, 209, 0.35);
  transition: filter 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 20px rgba(104, 100, 209, 0.45);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- Reason mode toggle --------------------------------------------------- */
.reason-mode {
  border: 1px solid var(--par-2-20);
  border-radius: var(--radius);
  background: var(--par-2-10);
  padding: 18px 20px;
  /* Clear separation from the Order / Purchase Date grid above. */
  margin: 32px 0 24px;
}

.reason-mode-label {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--par-1);
  margin-bottom: 14px;
}

.reason-mode-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--par-1);
}

.radio-field input[type='radio'] {
  width: 17px;
  height: 17px;
  margin: 0;
  padding: 0;
  border: none;
  flex: 0 0 auto;
  accent-color: var(--par-3);
  cursor: pointer;
}

#shared-reason[hidden],
.per-product-reason[hidden] {
  display: none;
}

/* --- Product lines -------------------------------------------------------- */
.product-line {
  border: 1px solid var(--par-2-20);
  border-radius: var(--radius);
  background: var(--par-2-10);
  padding: 18px;
  margin-bottom: 16px;
}

.product-line-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.product-line-title {
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--par-3);
}

.btn-remove {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 13px;
  color: var(--par-error);
  background: transparent;
  border: 1px solid var(--par-error);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-remove:hover {
  background: var(--par-error);
  color: #ffffff;
}

.btn-secondary {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 14px;
  color: var(--par-3);
  background: transparent;
  border: 1px dashed var(--par-3);
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-secondary:hover {
  background: var(--par-2-10);
}

/* --- Language picker (floating, bottom-left) ------------------------------ */
.lang-switcher {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 100;
  font-family: var(--font-primary);
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--par-2-20);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(33, 36, 56, 0.14);
  font-weight: 800;
  font-size: 14px;
  color: var(--par-1);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lang-current:hover {
  border-color: var(--par-2);
  box-shadow: 0 6px 18px rgba(33, 36, 56, 0.2);
}

.lang-flag {
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(33, 36, 56, 0.12);
}

.lang-caret {
  color: #6b7191;
  font-size: 12px;
}

.lang-menu {
  list-style: none;
  margin: 0 0 10px;
  padding: 6px;
  position: absolute;
  bottom: 100%;
  left: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid var(--par-2-20);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(33, 36, 56, 0.2);
}

.lang-menu[hidden] {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  color: var(--par-1);
}

.lang-option img {
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(33, 36, 56, 0.12);
}

.lang-option:hover,
.lang-option.active {
  background: var(--par-2-10);
}

/* --- Footer (dark navy — matches partech.com) ----------------------------- */
.site-footer {
  background: var(--par-0);
  color: var(--par-2);
}

.footer-legal {
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
  padding: 18px 24px;
  text-align: center;
  font-size: 12px;
  color: #8c9fff;
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
  }
}
