/*
 * Iddy shared survey engine stylesheet. Light-theme port of Bang Media's enquiry.html
 * form CSS (bmf* -> idf*), reskinned to Iddy branding. See docs/BRAND.md for source.
 */

/* Heading font - brand-specific, self-hosted from iddy.com.au */
@font-face {
  font-family: 'Behind the Nineties';
  src: url('fonts/behind-the-nineties-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Behind the Nineties';
  src: url('fonts/behind-the-nineties-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Behind the Nineties';
  src: url('fonts/behind-the-nineties-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Decorative italic accent font - used sparingly for flourish, not used by the engine itself */
@font-face {
  font-family: 'Khalila';
  src: url('fonts/khalila-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Body font - self-hosted copy of Google's Roboto (static weight instances) */
@font-face {
  font-family: 'Roboto';
  src: url('fonts/roboto-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('fonts/roboto-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('fonts/roboto-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --idf-bg: #FFF0E2;        /* page background - Iddy's cream */
  --idf-card: #FFF9F3;      /* card/input background - near-white cream, matches pill inputs */
  --idf-ink: #3C2A2A;       /* primary text - Iddy's dark brown */
  --idf-muted: #6B5A54;     /* secondary text - muted brown */
  --idf-accent: #D4761E;    /* accent - burnt-orange/terracotta driving CTAs and links */
  --idf-accent-ink: #FFFFFF;/* text on accent - white, matches submit/next button text */
  --idf-border: #E4CCB8;    /* darkened cream so pill/input borders stay visible on --idf-bg/--idf-card */
  --idf-error: #D85252;     /* decorative red from BRAND.md, used only for error text here */
  --idf-font: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --idf-font-heading: 'Behind the Nineties', 'Roboto', sans-serif;
  --idf-radius: 100px;      /* button/pill radius - Iddy uses fully rounded pills throughout */
  --idf-radius-card: 20px;  /* smaller radius for photo/diagram corners */
}

/* This engine is intentionally single-theme (Iddy's light cream brand), so it does not
   need a prefers-color-scheme/data-theme override the way a generic artifact would. */

.idf-body { margin: 0; background: var(--idf-bg); color: var(--idf-ink); font-family: var(--idf-font); min-height: 100vh; }
.idf-body * { box-sizing: border-box; }

.idf-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: rgba(60,42,42,.08); z-index: 30; }
.idf-progress-fill { height: 100%; width: 0; background: var(--idf-accent); transition: width .4s ease; }

.idf-logo { position: absolute; top: 18px; left: 48px; z-index: 30; display: inline-block; line-height: 0; }
/* Logo scales smoothly with the viewport: full 120px on desktop, down to ~78px on small phones. */
.idf-logo img { width: clamp(78px, 18vw, 120px); height: auto; display: block; }
@media (max-width: 991px) { .idf-logo { left: 20px; } }
@media (max-width: 479px) { .idf-logo { top: 14px; left: 16px; } }

.idf-close { position: fixed; top: 21px; right: 44px; z-index: 31; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; color: var(--idf-muted); text-decoration: none; border: 1px solid transparent; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.idf-close:hover { color: var(--idf-accent); background: rgba(60,42,42,.05); border-color: var(--idf-border); }
.idf-close:focus-visible { outline: 2px solid var(--idf-accent); outline-offset: 2px; }
.idf-close svg { display: block; width: 22px; height: 22px; }
@media (max-width: 991px) { .idf-close { right: 14px; } }
@media (max-width: 479px) { .idf-close { right: 10px; } }

.idf-stage { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 6.5rem 1.5rem 6.5rem; }
.idf-card { width: 100%; max-width: 680px; }
.idf-done { text-align: center; }

.idf-back { background: none; border: none; padding: 0; margin: 0 0 1.7rem; color: var(--idf-muted); font-family: var(--idf-font); font-size: .95rem; cursor: pointer; }
.idf-back:hover { color: var(--idf-accent); }

.idf-title { display: block; margin: 0 0 .7rem; font-family: var(--idf-font-heading); font-size: clamp(1.65rem, 4.5vw, 2.35rem); font-weight: 600; line-height: 1.25; color: var(--idf-ink); }
.idf-title--hero { font-size: clamp(2rem, 5.5vw, 2.9rem); }
.idf-sub { margin: 0 0 1.7rem; color: var(--idf-muted); font-size: 1.05rem; line-height: 1.55; }
.idf-sub a { color: var(--idf-accent); text-decoration: underline; }

/* white backing plate: the measurement-diagram source PNGs are very light line art on a
   transparent ground, and need a lighter-than-cream backdrop to read clearly */
/* Measurement diagrams are ink line art on a clean white card - the card lifts them off the
   cream page and gives the dark strokes a crisp, bright ground. */
.idf-step-img { display: block; max-width: 100%; max-height: 300px; width: auto; height: auto; margin: 0 auto 1.5rem; padding: 1.25rem; background: #fff; border-radius: var(--idf-radius-card); box-shadow: 0 6px 20px rgba(60,42,42,.08); object-fit: contain; box-sizing: border-box; }

/* Inputs: borderless, bottom-underline pattern (Bang's typeform look), light-theme colours */
.idf-input { width: 100%; background: transparent; border: none; border-bottom: 2px solid var(--idf-border); border-radius: 0; color: var(--idf-ink); font-family: var(--idf-font); font-size: 1.45rem; padding: .55rem 0; outline: none; }
.idf-input:focus { border-bottom-color: var(--idf-accent); }
.idf-input::placeholder { color: var(--idf-muted); opacity: .6; }

.idf-textarea { width: 100%; background: var(--idf-card); border: 1px solid var(--idf-border); border-radius: .8rem; color: var(--idf-ink); font-family: var(--idf-font); font-size: 1.1rem; line-height: 1.55; padding: 1rem 1.1rem; outline: none; min-height: 9rem; resize: vertical; }
.idf-textarea:focus { border-color: var(--idf-accent); }
.idf-textarea::placeholder { color: var(--idf-muted); opacity: .6; }

.idf-error { min-height: 1.35rem; margin-top: .8rem; color: var(--idf-error); font-size: .95rem; }

.idf-actions { display: flex; align-items: center; gap: 1.1rem; margin-top: 1.2rem; flex-wrap: wrap; }
.idf-actions--center { justify-content: center; }

.idf-btn { font-family: var(--idf-font-heading); font-size: 1.05rem; font-weight: 500; letter-spacing: .01em; color: var(--idf-accent-ink); background: var(--idf-accent); border: 1px solid var(--idf-accent); border-radius: var(--idf-radius); padding: .72rem 2rem; cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease; text-decoration: none; display: inline-block; }
.idf-btn:hover { background: var(--idf-ink); border-color: var(--idf-ink); color: #fff; }
.idf-btn:disabled { opacity: .55; cursor: default; }
.idf-btn:disabled:hover { background: var(--idf-accent); border-color: var(--idf-accent); color: var(--idf-accent-ink); }

.idf-skip { background: none; border: none; color: var(--idf-muted); font-family: var(--idf-font); font-size: .98rem; cursor: pointer; padding: .4rem .2rem; }
.idf-skip:hover { color: var(--idf-accent); }

/* Choice pills (single/multi) - responsive single column, centred card up to 680px */
.idf-choices { display: flex; flex-direction: column; gap: .6rem; margin-top: .3rem; }
.idf-choice { display: flex; align-items: center; gap: .85rem; width: 100%; text-align: left; background: var(--idf-card); border: 1px solid var(--idf-border); border-radius: var(--idf-radius); padding: .62rem 1.1rem .62rem .62rem; color: var(--idf-ink); font-family: var(--idf-font); font-size: 1.03rem; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.idf-choice:hover { border-color: var(--idf-accent); }
.idf-choice.idf-on { border-color: var(--idf-accent); background: rgba(212,118,30,.1); color: var(--idf-ink); }
.idf-key { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; display: flex; align-items: center; justify-content: center; border: 1px solid var(--idf-border); border-radius: 50%; color: var(--idf-accent); font-size: .85rem; font-weight: 600; }
.idf-choice.idf-on .idf-key { background: var(--idf-accent); color: var(--idf-accent-ink); border-color: var(--idf-accent); }
/* Inline "Other" text field, revealed under its option when selected. */
.idf-other { margin: .1rem 0 .15rem; }
.idf-other-input { width: 100%; box-sizing: border-box; background: var(--idf-card); border: 1px solid var(--idf-border); border-radius: .8rem; color: var(--idf-ink); font-family: var(--idf-font); font-size: 1rem; padding: .7rem 1rem; outline: none; }
.idf-other-input:focus { border-color: var(--idf-accent); }
.idf-other-input::placeholder { color: var(--idf-muted); opacity: .6; }

/* Rating: numbered scale buttons */
.idf-rating { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .3rem; }
.idf-rate { width: 3rem; height: 3rem; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--idf-card); border: 1px solid var(--idf-border); border-radius: 50%; color: var(--idf-ink); font-family: var(--idf-font); font-size: 1.1rem; font-weight: 500; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.idf-rate:hover { border-color: var(--idf-accent); }
.idf-rate.idf-on { border-color: var(--idf-accent); background: var(--idf-accent); color: var(--idf-accent-ink); }
.idf-rate-labels { display: flex; justify-content: space-between; margin-top: .6rem; color: var(--idf-muted); font-size: .9rem; }

.idf-hint { position: fixed; bottom: 1.2rem; left: 0; right: 0; text-align: center; color: var(--idf-muted); font-size: .85rem; z-index: 30; pointer-events: none; }
/* Keyboard hints are meaningless on touch devices, and on short viewports the fixed bar
   collides with a tall card's buttons - hide it in both cases. */
@media (hover: none), (max-width: 620px), (max-height: 700px) {
  .idf-hint { display: none; }
}
.idf-hp { position: absolute; left: -5000px; top: -5000px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.idf-noscript { max-width: 680px; margin: 8rem auto 0; padding: 0 1.5rem; color: var(--idf-ink); font-size: 1.1rem; line-height: 1.6; }
.idf-noscript a { color: var(--idf-accent); }

.idf-btn:focus-visible, .idf-choice:focus-visible, .idf-rate:focus-visible, .idf-back:focus-visible, .idf-skip:focus-visible { outline: 2px solid var(--idf-accent); outline-offset: 2px; }

@keyframes idfIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes idfOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-14px); } }
.idf-anim-in { animation: idfIn .32s ease both; }
.idf-anim-out { animation: idfOut .18s ease both; }

@media (prefers-reduced-motion: reduce) {
  .idf-anim-in, .idf-anim-out { animation: none; }
  .idf-progress-fill { transition: none; }
}

@media (max-width: 991px) {
  .idf-stage { padding: 5.5rem 1.25rem 6rem; }
}
@media (max-width: 620px) {
  .idf-title { font-size: clamp(1.4rem, 6vw, 1.9rem); }
  .idf-sub { font-size: .98rem; margin-bottom: 1.4rem; }
  .idf-input { font-size: 1.25rem; }
  .idf-textarea { font-size: 1rem; }
  /* Choice pills + their letter badges scale down with the rest of the layout on phones. */
  .idf-choices { gap: .5rem; }
  .idf-choice { font-size: .95rem; padding: .55rem .95rem .55rem .5rem; gap: .65rem; }
  .idf-key { width: 1.6rem; height: 1.6rem; font-size: .76rem; }
  .idf-rate { width: 2.7rem; height: 2.7rem; font-size: 1rem; }
}
@media (max-width: 479px) {
  .idf-stage { padding: 4.75rem 1rem 6rem; }
  .idf-btn, .idf-skip { font-size: .98rem; }
  .idf-choice { font-size: .9rem; padding: .5rem .85rem .5rem .45rem; }
  .idf-key { width: 1.5rem; height: 1.5rem; font-size: .72rem; }
}
