* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  background: #f4f5f7;
  overflow: hidden;        /* no page scroll; the gesture drives the reveal */
}

/* ============================================================
   Condura Pangarappliances application form
   ============================================================ */
:root {
  --red: #e1251b;
  --red-dark: #c41d15;
  --ink: #222;
  --muted: #6b7280;
  --border: #d7d7dd;

  /* Logo sizing (tweak these to resize the logos) */
  --curtain-logo-size: 958px;            /* max height of the centred curtain logo */
  --curtain-bottom-logo-size: 348px;     /* max height of the bottom curtain logo */
  --form-logo-size: 200px;               /* max height of the header logo */
}

/* The whole form page (behind the canvas). Scrolls internally. */
.form-section {
  position: fixed;
  inset: 0;
  z-index: 1;              /* behind the hero */
  overflow-y: auto;
  background: var(--red);  /* fallback under the doodle image */
}

/* ---------- White header bar: logo only, centered ---------- */
.form-header {
  background: #fff;
  text-align: center;
  padding: 28px 16px;
}

.brand-logo {
  display: block;
  max-height: var(--form-logo-size);
  max-width: 92%;
  margin: 0 auto;
  object-fit: contain;
}

/* ---------- White footer: row of product cards ---------- */
.form-footer {
  background: #fff;
  padding: 44px 24px 56px;
}

.fp-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Each card: the item image (gray #f8f8f8 card art) continues into a
   matching gray panel that holds the price + button we add here. */
.fp-card {
  flex: 1 1 200px;
  max-width: 264px;
  display: flex;
  flex-direction: column;
  background: #f8f8f8;
  border-radius: 12px;
  overflow: hidden;
}

.fp-img {
  display: block;
  width: 100%;
  height: auto;
}

.fp-price {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  padding: 4px 20px 0;
  margin-bottom: 18px;
}

.fp-btn {
  display: block;
  margin: auto 20px 22px;   /* auto-top keeps buttons bottom-aligned */
  padding: 11px 0;
  text-align: center;
  border: 1.5px solid var(--red);
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.fp-btn:hover { background: var(--red); color: #fff; }

/* ---------- Red doodle body ---------- */
.form-body {
  background-color: var(--red);
  background-image: url("assets/form/bg_form.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  padding: 46px 24px 64px;
}

/* ---------- White card ---------- */
.form-card {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  padding: 48px 56px 52px;
  border-radius: 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.22);
}

.form-card h1 {
  color: var(--red);
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  margin-bottom: 40px;
}

/* ---------- Section headers ("| I.  Personal Information") ---------- */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 22px;
}

.section-head .bar {
  width: 5px;
  height: 22px;
  background: var(--red);
  border-radius: 2px;
}

.section-head .num {
  color: var(--red);
  font-weight: 800;
  font-size: 20px;
}

.section-head h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.section-desc {
  color: #333;
  font-size: 15px;
  margin: -6px 0 18px 4px;
}

.divider {
  border: none;
  border-top: 1px solid #ececec;
  margin: 34px 0;
}

/* ---------- Fields & grid ---------- */
.grid {
  display: grid;
  gap: 22px;
  margin-bottom: 6px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.req { color: var(--red); }

/* input with leading icon */
.input-wrap { position: relative; }

.input-wrap .ic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: #9aa0a6;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 37, 27, 0.12);
}

textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 37, 27, 0.12);
}

.counter {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- File dropzone ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 34px 24px;
  border: 2px dashed #cfcfd6;
  border-radius: 14px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover { border-color: var(--red); background: #fff6f5; }
.dropzone.has-file { border-color: var(--red); background: #fff6f5; }

.dz-title {
  color: var(--red);
  font-weight: 700;
  font-size: 15px;
}

.dz-sub {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  max-width: 620px;
}

/* ---------- Disclaimer box ---------- */
.disclaimer {
  background: #fdf3f2;
  border: 1px solid #f3d3d0;
  border-left: 5px solid var(--red);
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.55;
  color: #333;
  margin-bottom: 22px;
}
.disclaimer strong { color: var(--red); }

/* ---------- Checkboxes ---------- */
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  margin-bottom: 16px;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--red);
  flex-shrink: 0;
}

.link {
  color: var(--red);
  font-weight: 700;
  text-decoration: underline;
}

/* ---------- Submit ---------- */
.submit-btn {
  display: block;
  margin: 30px auto 0;
  min-width: 300px;
  padding: 15px 40px;
  border: none;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(225, 37, 27, 0.35);
  transition: background 0.15s, transform 0.08s;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-card { padding: 32px 22px 36px; }
  .form-body { padding: 28px 14px 48px; }
}

/* On mobile the footer cards scroll horizontally instead of wrapping */
@media (max-width: 640px) {
  .fp-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;      /* room for the scrollbar */
  }
  .fp-card {
    flex: 0 0 72%;            /* fixed width so they don't shrink; peek the next */
    max-width: 260px;
    scroll-snap-align: start;
  }
}

/* ---------- Curtain drawing surface (top section of the form) ---------- */
.hero {
  position: relative;     /* normal flow: the very top of the scrolling form */
  width: 100%;
  height: 100vh;
  /* White "paper" with the doodle prompt art to draw on top of */
  background: #ffffff url("assets/curtain/bg_curtain.png") center / cover no-repeat;
  overflow: hidden;
}

#draw {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;     /* let JS own touch gestures (drawing) */
}

/* Curtain logos: two pieces, neither of which ever blocks drawing */
.curtain-logo {
  position: absolute;
  left: 50%;
  z-index: 3;
  width: auto;
  height: auto;
  pointer-events: none;
}

/* Middle piece: dead-centred both axes, at any aspect ratio */
.curtain-logo--middle {
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(92%, 90vh);      /* short/ultrawide: never wider than the hero is tall */
  max-height: min(var(--curtain-logo-size), 80vh);
}

/* Bottom piece: always pinned to the bottom-centre */
.curtain-logo--bottom {
  bottom: 0;
  transform: translateX(-50%);
  max-width: 92%;
  max-height: min(var(--curtain-bottom-logo-size), 50vh);
}

/* Mobile: drawing is off, so let the canvas scroll */
@media (max-width: 640px) {
  #draw {
    touch-action: auto;   /* allow page scrolling (no drawing on mobile) */
    cursor: default;
  }
}


/* ---------- Full-page thank-you screen (shown after submit) ---------- */
.thankyou-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;            /* above everything, including the curtain */
  background: #fff;       /* white page, matching the reference art */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
}

.thankyou-overlay[hidden] { display: none; }

.thankyou-content {
  width: 100%;
  max-width: 720px;
  text-align: center;
  animation: popIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

/* Checkmark + "THANK YOU!" art, cropped to its content band (12%–45%
   of the transparent 16:9 PNG) via negative margins under overflow:hidden */
.thankyou-mark {
  width: min(360px, 78vw);
  margin: 0 auto;
  overflow: hidden;
}
.thankyou-mark img {
  display: block;
  width: 100%;
  margin: -6.5% 0 -30.5%;
}

/* "Salamat..." lead lines */
.thankyou-lead {
  color: #5b5b5b;
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.7;
  margin-top: 6px;
}

/* Light-pink follow-up note box */
.thankyou-note {
  max-width: 620px;
  margin: 28px auto 0;
  background: #fdf3f2;
  border: 1px solid #f6d9d7;
  border-radius: 16px;
  padding: 22px 30px;
}

.tn-title {
  color: var(--red);
  font-weight: 800;
  font-size: clamp(15px, 2.2vw, 17px);
  line-height: 1.5;
  margin-bottom: 12px;
}

.tn-sub {
  color: #444;
  font-weight: 600;
  font-size: clamp(14px, 2vw, 15.5px);
  line-height: 1.5;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
