/* ── TOKENS ──────────────────────────────────────────────────── */
:root {
  --bd-black:  #231F20;
  --bd-red:    #ED1F24;
  --bd-grey:   #A8B0B5;
  --bd-light:  #F4F4F4;
  --bd-white:  #FFFFFF;
  --bd-border: #D8D8D8;
  --radius:    6px;
  --shadow:    0 2px 12px rgba(0,0,0,.10);
  --transition: .2s ease;
}

/* ── RESET ───────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--bd-black);
  background: var(--bd-light);
  min-height: 100vh;
  padding-bottom: 90px;
}

/* ── HEADER ──────────────────────────────────────────────────── */
.site-header {
  background: var(--bd-black);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bd-logo {
  height: clamp(36px, 6vw, 56px);
  width: auto;
  display: block;
}

/* ── HERO ────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--bd-black) 0%, #3a3335 100%);
  color: var(--bd-white);
  text-align: center;
  padding: 52px 24px;
  position: relative;
}
.hero-badge {
  display: inline-block;
  background: var(--bd-red);
  color: var(--bd-white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 30px;
  margin-bottom: 18px;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.hero p {
  font-size: clamp(14px, 2vw, 16px);
  color: rgba(255,255,255,.78);
  max-width: 580px;
  margin: 0 auto 24px;
  line-height: 1.65;
}
.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: 8px;
}
.hero-stat { display: flex; flex-direction: column; align-items: center; }
.hero-stat strong { font-size: 22px; color: var(--bd-red); font-weight: 700; }
.hero-stat span { font-size: 11px; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .08em; }

/* ── PROGRESS BAR ────────────────────────────────────────────── */
.progress-wrap {
  background: var(--bd-white);
  border-bottom: 1px solid var(--bd-border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
  list-style: none;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 2px;
  background: var(--bd-border);
  z-index: 0;
}
.step.active:not(:last-child)::after,
.step.done:not(:last-child)::after { background: var(--bd-red); }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bd-border);
  background: var(--bd-white);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--bd-grey);
  position: relative; z-index: 1;
  transition: var(--transition);
}
.step.active .step-num { border-color: var(--bd-red); color: var(--bd-red); background: #fff3f3; }
.step.done .step-num   { border-color: var(--bd-red); background: var(--bd-red); color: #fff; }
.step-label {
  font-size: 10px; font-weight: 600; color: var(--bd-grey);
  text-transform: uppercase; letter-spacing: .07em; text-align: center;
  transition: var(--transition);
}
.step.active .step-label { color: var(--bd-red); }
.step.done .step-label   { color: var(--bd-black); }

/* ── LAYOUT ──────────────────────────────────────────────────── */
.page-body {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── SECTION CARD ────────────────────────────────────────────── */
.form-section { background: var(--bd-white); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.section-header {
  background: var(--bd-black);
  color: var(--bd-white);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-header .section-num {
  background: var(--bd-red); color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 3px; text-transform: uppercase; letter-spacing: .06em; flex-shrink: 0;
}
.section-header h2 { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.section-body { padding: 24px 22px; }

/* ── FIELD GRID ──────────────────────────────────────────────── */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field-grid .full { grid-column: 1 / -1; }
@media (max-width: 580px) { .field-grid { grid-template-columns: 1fr; } .field-grid .full { grid-column: 1; } }

/* ── FORM ELEMENTS ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
label { font-size: 12px; font-weight: 600; color: var(--bd-black); text-transform: uppercase; letter-spacing: .06em; }
label .req { color: var(--bd-red); margin-left: 2px; }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--bd-border);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 14px; color: var(--bd-black);
  background: var(--bd-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none; -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--bd-red);
  box-shadow: 0 0 0 3px rgba(237,31,36,.1);
}
input.error, select.error, textarea.error { border-color: var(--bd-red); background: #fff8f8; }
.field-error { font-size: 11px; color: var(--bd-red); font-weight: 500; display: none; }
.field-error.visible { display: block; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23231F20' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* ── RADIO / GIFT CARD ───────────────────────────────────────── */
.radio-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.radio-card { flex: 1; min-width: 140px; cursor: pointer; }
.radio-card input[type="radio"] { display: none; }
.radio-card-inner {
  border: 2px solid var(--bd-border); border-radius: 8px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  transition: var(--transition); background: var(--bd-white);
}
.radio-card input:checked + .radio-card-inner { border-color: var(--bd-red); background: #fff3f3; }
.radio-card-icon { width: 36px; height: 22px; border-radius: 4px; background: var(--bd-black); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.radio-card-icon svg { width: 22px; height: 14px; }
.radio-card-label { font-size: 14px; font-weight: 600; }
.radio-card-sub { font-size: 11px; color: var(--bd-grey); margin-top: 1px; }

/* ── UNIT TABLE ──────────────────────────────────────────────── */
.table-intro { font-size: 13px; color: #555; margin-bottom: 16px; line-height: 1.6; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.units-table {
  width: 100%; border-collapse: collapse; min-width: 700px; font-size: 13px;
}
.units-table thead tr { background: var(--bd-black); color: var(--bd-white); }
.units-table thead th { padding: 10px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.units-table thead th.col-num  { width: 34px; text-align: center; }
.units-table thead th.col-model { width: 210px; }
.units-table thead th.col-serial { width: 130px; }
.units-table thead th.col-enduser { width: 150px; }
.units-table thead th.col-invoice { width: 120px; }
.units-table thead th.col-amount  { width: 90px; }
.units-table thead th.col-upload  { width: 130px; }
.units-table tbody tr { border-bottom: 1px solid var(--bd-border); }
.units-table tbody tr:nth-child(even) { background: #fafafa; }
.units-table tbody td { padding: 6px 8px; vertical-align: middle; }
.units-table tbody td.col-num { text-align: center; color: var(--bd-grey); font-size: 12px; font-weight: 600; }
.units-table input[type="text"],
.units-table input[type="number"],
.units-table select { padding: 7px 8px; font-size: 12px; border-radius: 4px; }
.amount-cell { position: relative; }
.amount-cell .currency-sign { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--bd-grey); font-size: 12px; pointer-events: none; }
.amount-cell input { padding-left: 22px; }
.row-upload-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--bd-red);
  border: 1.5px solid var(--bd-red); border-radius: 4px;
  padding: 5px 8px; cursor: pointer; background: #fff;
  transition: var(--transition); white-space: nowrap;
}
.row-upload-btn:hover { background: #fff3f3; }
.row-upload-indicator {
  font-size: 10px; color: #2e7d32; font-weight: 600;
  display: none; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}
.hidden-file-input { display: none; }
.add-row-btn {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1.5px dashed var(--bd-grey);
  color: var(--bd-grey); border-radius: var(--radius);
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.add-row-btn:hover { border-color: var(--bd-red); color: var(--bd-red); }
.add-row-btn svg { width: 14px; height: 14px; }
.running-total { margin-top: 14px; text-align: right; font-size: 14px; font-weight: 600; color: var(--bd-black); }
.running-total span { color: var(--bd-red); font-size: 18px; }

/* ── ELIGIBILITY NOTE ────────────────────────────────────────── */
.eligibility-note {
  background: #f7f7f7; border-left: 3px solid var(--bd-red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px; margin-bottom: 20px;
  font-size: 13px; color: #444; line-height: 1.6;
}
.eligibility-note strong { color: var(--bd-black); }

/* ── STICKY FOOTER ───────────────────────────────────────────── */
.sticky-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bd-white); border-top: 1px solid var(--bd-border);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  z-index: 200; box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.footer-note { font-size: 12px; color: var(--bd-grey); line-height: 1.4; max-width: 360px; }
.footer-note strong { color: var(--bd-black); }
.btn-submit {
  background: var(--bd-red); color: var(--bd-white);
  border: none; border-radius: var(--radius);
  padding: 13px 32px; font-size: 15px; font-weight: 700;
  font-family: 'Inter', sans-serif; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap; flex-shrink: 0;
}
.btn-submit:hover   { background: #c9181d; }
.btn-submit:active  { transform: scale(.98); }
.btn-submit:disabled { background: var(--bd-grey); cursor: not-allowed; }
.btn-submit svg { width: 16px; height: 16px; }

/* ── SUCCESS MODAL ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bd-white); border-radius: 12px;
  max-width: 520px; width: 100%; padding: 40px 36px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(20px); transition: transform .3s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-icon {
  width: 72px; height: 72px; border-radius: 50%; background: #e8f5e9;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.modal-icon svg { width: 36px; height: 36px; }
.modal h2 { font-family: 'Playfair Display', serif; font-size: 24px; margin-bottom: 12px; color: var(--bd-black); }
.modal p  { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 8px; }
.modal-ref {
  display: inline-block; background: var(--bd-light); border-radius: 4px;
  padding: 6px 16px; font-size: 13px; font-weight: 600; color: var(--bd-black);
  margin-top: 4px; margin-bottom: 20px; letter-spacing: .04em;
}
.btn-done {
  background: var(--bd-black); color: var(--bd-white);
  border: none; border-radius: var(--radius);
  padding: 12px 32px; font-size: 14px; font-weight: 700;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: background var(--transition);
}
.btn-done:hover { background: #3a3335; }

/* ── ERROR BANNER ────────────────────────────────────────────── */
.form-error-banner {
  background: #fff0f0; border: 1.5px solid var(--bd-red);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 13px; color: var(--bd-red); font-weight: 600; display: none; margin-bottom: 8px;
}
.form-error-banner.visible { display: block; }

/* ── SPINNER ──────────────────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; display: none;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MISC ────────────────────────────────────────────────────── */
.instructions-box {
  background: var(--bd-light); border-radius: var(--radius);
  padding: 14px 16px; font-size: 13px; color: #555; line-height: 1.65; margin-bottom: 20px;
}
.instructions-box strong { color: var(--bd-black); }

@media (max-width: 540px) {
  .sticky-footer { flex-direction: column; align-items: stretch; }
  .footer-note   { max-width: 100%; }
  .btn-submit    { justify-content: center; }
  .modal         { padding: 28px 20px; }
}
