@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+TC:wght@400;500;600;700&family=Noto+Serif+TC:wght@600;800&display=swap");

:root {
  --ink: #17130f;
  --ink-soft: #302820;
  --paper: #f8f0e3;
  --paper-deep: #ead9bf;
  --red: #a51f24;
  --red-dark: #64191b;
  --brass: #b5843d;
  --moss: #54614b;
  --line: rgba(44, 36, 29, 0.18);
  --white: #fffaf2;
  --shadow: 0 24px 70px rgba(23, 19, 15, 0.16);
  --font-display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-body: "IBM Plex Sans TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(165, 31, 36, 0.08) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(rgba(84, 97, 75, 0.08) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.15;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(23, 19, 15, 0.18) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 60%, rgba(165, 31, 36, 0.15) 0 1px, transparent 1px);
  background-size: 19px 23px, 29px 31px;
  mix-blend-mode: multiply;
}

button,
input,
textarea,
select {
  font: inherit;
}

main {
  overflow: hidden;
}

.redeem-shell {
  width: min(100%, 1320px);
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(300px, 0.56fr);
  gap: clamp(16px, 3vw, 34px);
  align-items: start;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 38px);
}

.brand-panel {
  position: relative;
  order: 2;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(18px, 2.4vw, 28px);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(181, 132, 61, 0.12) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgba(84, 97, 75, 0.1) 1px, transparent 1px) 0 0 / 28px 28px,
    rgba(255, 250, 242, 0.92);
  border: 1px solid rgba(44, 36, 29, 0.18);
  box-shadow: 0 16px 40px rgba(23, 19, 15, 0.08);
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.8;
  background:
    linear-gradient(135deg, rgba(165, 31, 36, 0.08), transparent 46%),
    radial-gradient(circle at 86% 12%, rgba(181, 132, 61, 0.16), transparent 26%);
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(44, 36, 29, 0.12);
  pointer-events: none;
}

.brand-topline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
  color: var(--white);
  background: var(--red);
  border: 2px solid var(--white);
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(165, 31, 36, 0.22);
  transform: rotate(-7deg);
}

.kicker,
.eyebrow {
  margin: 0 0 12px;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.brand-panel h1,
.form-header h2,
.section-heading h2,
.notice-band h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: 0;
}

.brand-panel h1 {
  position: relative;
  z-index: 2;
  max-width: 520px;
  font-size: clamp(1.9rem, 2.6vw, 3rem);
}

.lead {
  position: relative;
  z-index: 2;
  max-width: 440px;
  margin: 0;
  color: rgba(48, 40, 32, 0.76);
  font-size: 0.98rem;
  line-height: 1.75;
}

.supplier-strip {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.supplier-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--ink-soft);
  border: 1px solid rgba(44, 36, 29, 0.18);
  background: rgba(255, 253, 247, 0.78);
  font-size: 0.86rem;
}

.redeem-form {
  order: 1;
  align-self: center;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: clamp(20px, 3vw, 34px);
  background: rgba(255, 250, 242, 0.95);
  border: 1px solid rgba(44, 36, 29, 0.22);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.form-header,
.full {
  grid-column: 1 / -1;
}

.form-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.form-header h2,
.section-heading h2,
.notice-band h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.field,
.choice-field {
  min-width: 0;
}

label,
legend {
  display: block;
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 700;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

input[type="text"],
input[type="tel"],
textarea,
select {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid rgba(44, 36, 29, 0.24);
  border-radius: 0;
  outline: 0;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 22px,
    calc(100% - 12px) 22px;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

select:disabled {
  color: rgba(48, 40, 32, 0.42);
  background-color: rgba(234, 217, 191, 0.36);
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--red);
  background-color: #fffaf2;
  box-shadow: 0 0 0 4px rgba(165, 31, 36, 0.12);
}

.voucher-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
}

.secondary-button {
  min-height: 50px;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid rgba(44, 36, 29, 0.24);
  cursor: pointer;
  font-weight: 800;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.secondary-button:hover {
  background: #e0caa6;
  transform: translateY(-1px);
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.hint,
.inline-result {
  margin: 7px 0 0;
  color: rgba(44, 36, 29, 0.62);
  font-size: 0.82rem;
}

.inline-result.success {
  color: #28633d;
  font-weight: 700;
}

.inline-result.error {
  color: var(--red-dark);
  font-weight: 700;
}

.segmented,
.option-grid {
  display: grid;
  gap: 10px;
}

.segmented {
  grid-template-columns: 1fr 1fr;
}

.option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented label,
.option-grid label {
  margin: 0;
  cursor: pointer;
}

.segmented input,
.option-grid input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.segmented span,
.option-grid span {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid rgba(44, 36, 29, 0.24);
  font-weight: 700;
  text-align: center;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.segmented input:focus-visible + span,
.option-grid input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(165, 31, 36, 0.12);
}

.segmented input:checked + span,
.option-grid input:checked + span {
  color: var(--white);
  background: var(--red);
  border-color: var(--red-dark);
  transform: translateY(-1px);
}

.conditional-panel {
  padding: 14px;
  background: rgba(234, 217, 191, 0.34);
  border: 1px solid rgba(181, 132, 61, 0.34);
}

.confirm-line {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
  cursor: pointer;
}

.confirm-line input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--red);
}

.status-message {
  grid-column: 1 / -1;
  min-height: 0;
  display: none;
  padding: 12px 14px;
  border: 1px solid transparent;
  line-height: 1.55;
}

.status-message.is-visible {
  display: block;
}

.status-message.success {
  color: #1f3d2c;
  background: rgba(84, 97, 75, 0.14);
  border-color: rgba(84, 97, 75, 0.34);
}

.status-message.error {
  color: var(--red-dark);
  background: rgba(165, 31, 36, 0.1);
  border-color: rgba(165, 31, 36, 0.3);
}

.submit-button {
  grid-column: 1 / -1;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    opacity 0.2s ease;
}

.submit-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.submit-button:hover {
  background: var(--red);
  transform: translateY(-1px);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.products-band,
.notice-band {
  padding: clamp(48px, 7vw, 92px) clamp(16px, 5vw, 72px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto 26px;
}

.product-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.product-item {
  min-height: 156px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background: rgba(255, 250, 242, 0.58);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.product-item:hover {
  background: rgba(255, 250, 242, 0.92);
  transform: translateY(-2px);
}

.product-item strong {
  display: block;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.45;
}

.product-item span {
  color: var(--moss);
  font-size: 0.92rem;
  font-weight: 700;
}

.process-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--ink);
}

.process-item {
  min-height: 144px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(165, 31, 36, 0.3), transparent),
    var(--ink);
}

.process-item strong {
  color: var(--brass);
  font-family: var(--font-display);
  font-size: 2.2rem;
}

.process-item span {
  font-size: 1rem;
  font-weight: 700;
}

.notice-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 0.68fr);
  gap: clamp(24px, 5vw, 70px);
  background: var(--white);
  border-top: 1px solid var(--line);
}

.notice-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.notice-columns article {
  padding: 22px;
  background: var(--white);
}

.notice-columns h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.18rem;
}

.notice-columns p {
  margin: 0;
  color: rgba(44, 36, 29, 0.78);
  line-height: 1.78;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1100px) {
  .redeem-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 0;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .notice-band,
  .notice-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .redeem-shell {
    padding: 0;
    gap: 0;
  }

  .brand-panel,
  .redeem-form {
    box-shadow: none;
  }

  .brand-panel {
    min-height: 0;
    padding: 24px;
    border: 0;
  }

  .brand-panel::after {
    inset: 12px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    font-size: 1.7rem;
  }

  .brand-panel h1 {
    font-size: 3rem;
  }

  .lead {
    margin-bottom: 20px;
    font-size: 1rem;
  }

  .supplier-strip {
    gap: 7px;
  }

  .supplier-strip span {
    min-height: 30px;
    font-size: 0.78rem;
  }

  .redeem-form {
    grid-template-columns: 1fr;
    padding: 22px 16px 30px;
    border-inline: 0;
  }

  .form-header {
    display: block;
  }

  .form-header h2,
  .section-heading h2,
  .notice-band h2 {
    font-size: 1.85rem;
  }

  .voucher-row {
    grid-template-columns: 1fr;
  }

  .option-grid.three,
  .option-grid,
  .segmented {
    grid-template-columns: 1fr;
  }

  .products-band,
  .notice-band {
    padding: 44px 16px;
  }

  .section-heading {
    display: block;
  }

  .product-grid,
  .process-band {
    grid-template-columns: 1fr;
  }

  .product-item {
    min-height: 126px;
  }

  .process-item {
    min-height: 112px;
  }
}
