/* =====================================================================
   AMASIA Feedback Form
   Built on the AMASIA / Pangea design system (Angular + PrimeNG, Fluent
   theme + Pangea brand layer). Tokens mirror amasia-styleguide.css so the
   form is visually identical to the live product.
   ===================================================================== */

/* ---- Roboto (self-hosted, matches the app's bundled fonts) --------- */
@font-face { font-family: Roboto; font-style: normal; font-weight: 300;
  font-display: swap; src: url(fonts/roboto-300.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 400;
  font-display: swap; src: url(fonts/roboto-400.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 500;
  font-display: swap; src: url(fonts/roboto-500.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 700;
  font-display: swap; src: url(fonts/roboto-700.woff2) format("woff2"); }

:root {
  --font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol";
  --font-size-base: 1rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Brand — AMASIA logo mark */
  --amasia-navy:   #101848;
  --amasia-blue:   #2068a0;
  --amasia-orange: #d86830;

  /* Brand — Pangea */
  --pangea-primary-orange: #f56513;
  --pangea-primary-orange-active: #df5000;
  --pangea-primary-grey: #ececec;
  --pangea-secondary-dark-grey: #858585;
  --pangea-secondary-grey: #f3f3f3;

  /* Primary — Fluent blue */
  --primary-color: #0078d4;
  --primary-color-text: #ffffff;
  --primary-50:  #f2f8fd;
  --primary-100: #c2dff5;
  --primary-200: #91c5ed;
  --primary-400: #3092dc;
  --primary-500: #0078d4;
  --primary-600: #0066b4;
  --primary-700: #005494;

  /* Text */
  --text-color: #323130;
  --text-color-secondary: #605e5c;

  /* Surfaces */
  --surface-ground:  #faf9f8;
  --surface-card:    #ffffff;
  --surface-border:  #edebe9;
  --surface-hover:   #f3f2f1;

  /* Gray scale */
  --gray-50:  #f3f2f1;
  --gray-100: #e1dfdd;
  --gray-200: #bebbb8;
  --gray-300: #a19f9d;
  --gray-400: #797775;

  /* Semantic */
  --green-500:  #60a90a;
  --yellow-500: #ffb900;
  --red-500:    #d13438;
  --error-border: #a4252c;
  --cyan-500:   #00b7c3;

  /* Geometry */
  --border-radius: 2px;
  --content-padding: 1rem;
  --shadow-card: 0 1.6px 3.6px rgba(0,0,0,.13), 0 0.3px 0.9px rgba(0,0,0,.11);
  --shadow-card-hover: 0 6.4px 14.4px rgba(0,0,0,.13), 0 1.2px 3.6px rgba(0,0,0,.11);

  color-scheme: light;
}

* { box-sizing: border-box; }

/* the hidden attribute must always win, even over display:flex components */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  color: var(--text-color);
  background: var(--surface-ground);
  line-height: 1.5;
  /* subtle brand wash so the page feels premium, not flat */
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(32,104,160,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(216,104,48,.06), transparent 55%);
  background-attachment: fixed;
}

h1, h2, h3 { margin: 0; }

/* =====================================================================
   Header
   ===================================================================== */
.masthead {
  background: var(--amasia-navy);
  color: #fff;
  padding: 1.1rem 1rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  box-shadow: var(--shadow-card);
}
.masthead img { height: 34px; width: auto; display: block; }
.masthead .mast-text { font-size: .8rem; letter-spacing: .04em; color: #c9d2ec; }
.masthead .mast-text b { color: #fff; font-weight: var(--font-weight-medium); }

/* =====================================================================
   Layout
   ===================================================================== */
.wrap { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 4rem; }

.intro { text-align: center; margin-bottom: 1.75rem; }
.intro img { height: 76px; width: auto; margin-bottom: .75rem; }
.intro h1 { font-size: 1.9rem; font-weight: var(--font-weight-bold); letter-spacing: -.01em; }
.intro p { color: var(--text-color-secondary); margin: .5rem auto 0; max-width: 38rem; }
.intro .time-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-top: .9rem; padding: .3rem .75rem;
  background: #fff; border: 1px solid var(--surface-border);
  border-radius: 999px; font-size: .8rem; color: var(--text-color-secondary);
  box-shadow: var(--shadow-card);
}
.intro .time-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }

/* Progress bar */
.progress {
  position: sticky; top: 0; z-index: 5;
  height: 4px; background: var(--gray-100); border-radius: 999px;
  margin-bottom: 1.5rem; overflow: hidden;
}
.progress > span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--amasia-blue), var(--pangea-primary-orange));
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}

/* =====================================================================
   Section cards
   ===================================================================== */
.card {
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--surface-border);
  padding: 1.35rem 1.35rem 1.5rem;
  margin-bottom: 1.1rem;
}
.section-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.1rem; }
.section-num {
  flex: none;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--amasia-navy); color: #fff;
  font-size: .85rem; font-weight: var(--font-weight-bold);
  border-radius: 50%;
}
.section-head h2 { font-size: 1.18rem; font-weight: var(--font-weight-medium); }
.section-head .sub { font-size: .82rem; color: var(--text-color-secondary); font-weight: 400; }

.q { margin-bottom: 1.25rem; }
.q:last-child { margin-bottom: 0; }
.q > .q-label { display: block; font-weight: var(--font-weight-medium); margin-bottom: .55rem; }
.q > .q-label .opt { color: var(--text-color-secondary); font-weight: 400; font-size: .85rem; }

/* =====================================================================
   Selectable button cards (Role / Environment)
   ===================================================================== */
.choices { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choice {
  position: relative;
  display: flex; flex-direction: column; gap: .25rem;
  padding: .85rem .9rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background .18s, transform .08s;
  user-select: none;
}
.choice:hover { border-color: var(--primary-400); background: var(--primary-50); }
.choice:active { transform: translateY(1px); }
.choice .c-ico { font-size: 1.2rem; line-height: 1; }
.choice .c-title { font-weight: var(--font-weight-medium); font-size: .95rem; }
.choice .c-desc { font-size: .78rem; color: var(--text-color-secondary); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .check {
  position: absolute; top: .55rem; right: .55rem;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--gray-200); background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .18s, background .18s;
}
.choice .check::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary-color); transform: scale(0); transition: transform .18s;
}
.choice.selected {
  border-color: var(--primary-color);
  background: var(--primary-50);
  box-shadow: inset 0 0 0 1px var(--primary-color);
}
.choice.selected .check { border-color: var(--primary-color); }
.choice.selected .check::after { transform: scale(1); }

/* =====================================================================
   Star ratings (Core features)
   ===================================================================== */
.rating-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: .9rem 1rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--border-radius);
  background: var(--surface-ground);
  margin-bottom: .6rem;
}
.rating-row:last-of-type { margin-bottom: 0; }
.rating-meta .r-title { font-weight: var(--font-weight-medium); }
.rating-meta .r-desc { font-size: .8rem; color: var(--text-color-secondary); }

.stars { display: inline-flex; gap: .15rem; direction: rtl; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label {
  cursor: pointer; font-size: 1.7rem; line-height: 1;
  color: var(--gray-200);
  transition: color .12s, transform .12s;
  padding: 0 .05rem;
}
.stars label:hover, .stars label:hover ~ label { color: var(--yellow-500); }
.stars label:hover { transform: scale(1.18); }
.stars input:checked ~ label { color: var(--yellow-500); }
.stars.rated label { color: var(--gray-200); }

/* low-score fade-in comment */
.lowbox {
  display: none; opacity: 0; max-height: 0; overflow: hidden;
  transition: opacity .35s ease, max-height .35s ease, margin .35s ease;
  margin-top: 0;
}
.lowbox.show { display: block; opacity: 1; max-height: 220px; margin-top: .6rem; }
.lowbox textarea { min-height: 3.2rem; }
.lowbox .lowhint {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--pangea-primary-orange-active); margin-bottom: .35rem;
}

/* =====================================================================
   Segmented quick-tap (Usability)
   ===================================================================== */
.segmented { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.seg {
  cursor: pointer; user-select: none;
  padding: .5rem .85rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  background: #fff;
  font-size: .9rem;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: all .16s;
}
.seg .seg-ico { font-size: 1rem; }
.seg:hover { border-color: var(--primary-400); background: var(--primary-50); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg.selected {
  color: #fff;
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: inset 0 0 0 1px var(--primary-color);
}

/* =====================================================================
   Form controls
   ===================================================================== */
.textarea, .input {
  width: 100%; box-sizing: border-box;
  padding: .6rem .75rem;
  font-family: var(--font-family); font-size: var(--font-size-base);
  color: var(--text-color); background: #fff;
  border: 1px solid var(--text-color-secondary);
  border-radius: var(--border-radius);
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 6rem; resize: vertical; }
.textarea:focus, .input:focus {
  outline: none; border-color: var(--primary-color);
  box-shadow: inset 0 0 0 1px var(--primary-color);
}
.field-help { font-size: .82rem; color: var(--text-color-secondary); margin-top: .35rem; }

/* =====================================================================
   Collapsible glitch reporter
   ===================================================================== */
.disclosure { margin-top: 1rem; border-top: 1px solid var(--surface-border); padding-top: 1rem; }
.disclosure-toggle {
  display: flex; align-items: center; gap: .55rem;
  cursor: pointer; user-select: none;
  font-weight: var(--font-weight-medium); color: var(--text-color);
  background: none; border: none; padding: 0; font-size: .95rem; font-family: inherit;
}
.disclosure-toggle .chevron { transition: transform .25s; color: var(--text-color-secondary); }
.disclosure.open .disclosure-toggle .chevron { transform: rotate(90deg); }
.disclosure-toggle .tag {
  font-size: .72rem; color: var(--text-color-secondary); font-weight: 400;
  background: var(--gray-50); padding: .1rem .45rem; border-radius: 999px;
}
.disclosure-body {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .35s ease, opacity .3s ease, margin .3s ease;
}
.disclosure.open .disclosure-body { max-height: 600px; opacity: 1; margin-top: .9rem; }

.check-list { display: grid; gap: .5rem; }
.check-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .7rem;
  border: 1px solid var(--surface-border); border-radius: var(--border-radius);
  background: var(--surface-ground); cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s;
}
.check-item:hover { background: var(--surface-hover); }
.check-item input { width: 16px; height: 16px; accent-color: var(--primary-color); flex: none; }
.check-item.checked { border-color: var(--primary-400); background: var(--primary-50); }
.check-item span { font-size: .92rem; }

/* =====================================================================
   Buttons / footer
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  cursor: pointer; user-select: none;
  padding: .7rem 1.5rem;
  font-family: var(--font-family); font-size: 1rem; font-weight: var(--font-weight-medium);
  border-radius: var(--border-radius); border: 1px solid transparent;
  transition: background-color .2s, border-color .2s, box-shadow .2s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn-brand { color: #fff; background: var(--pangea-primary-orange); border-color: var(--pangea-primary-orange); }
.btn-brand:hover { background: var(--pangea-primary-orange-active); border-color: var(--pangea-primary-orange-active); box-shadow: var(--shadow-card); }
.btn-secondary { background: #fff; color: var(--text-color); border: 1px solid var(--text-color-secondary); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.submit-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.submit-row .note { font-size: .82rem; color: var(--text-color-secondary); }

.foot { text-align: center; margin-top: 2rem; font-size: .8rem; color: var(--text-color-secondary); }

/* =====================================================================
   Success state
   ===================================================================== */
.thanks {
  display: none; text-align: center; padding: 2.5rem 1.5rem;
  animation: pop .5s cubic-bezier(.2,.9,.3,1.2);
}
.thanks.show { display: block; }
.thanks .badge-ico {
  width: 72px; height: 72px; margin: 0 auto 1rem;
  border-radius: 50%; background: var(--green-500); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem;
  box-shadow: 0 8px 22px rgba(96,169,10,.35);
}
.thanks h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.thanks p { color: var(--text-color-secondary); }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* =====================================================================
   Icons (inline SVG, replaces all emoji)
   ===================================================================== */
.ico    { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -.15em; }
.ico-lg { width: 30px; height: 30px; color: var(--primary-color); }
.ico-xl { width: 36px; height: 36px; }

/* =====================================================================
   Stepper (clickable section navigation)
   ===================================================================== */
.stepper {
  display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem;
  margin-bottom: 1rem; scrollbar-width: thin;
}
.step-pill {
  flex: 0 0 auto; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .7rem; border-radius: 999px;
  border: 1px solid var(--surface-border); background: #fff;
  color: var(--text-color-secondary); font-size: .82rem;
  transition: border-color .15s, background .15s, color .15s;
}
.step-pill .pill-num {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-100); color: var(--text-color-secondary);
  font-size: .72rem; font-weight: var(--font-weight-bold);
}
.step-pill:hover { border-color: var(--primary-400); color: var(--text-color); }
.step-pill.done .pill-num { background: var(--green-500); color: #fff; }
.step-pill.active {
  border-color: var(--amasia-navy); background: var(--amasia-navy); color: #fff;
}
.step-pill.active .pill-num { background: #fff; color: var(--amasia-navy); }

.step[hidden] { display: none !important; }

/* =====================================================================
   Layout helpers
   ===================================================================== */
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.grid-2 .q { margin-bottom: 1.25rem; }
.mt { margin-top: .7rem; }

.req {
  color: var(--error-border); font-weight: var(--font-weight-medium);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
}
.input.invalid, .textarea.invalid {
  border-color: var(--error-border);
  box-shadow: inset 0 0 0 1px var(--error-border);
}
.err-msg { display: none; color: var(--error-border); font-size: .82rem; margin-top: .35rem; }
.err-msg.show { display: block; }

.choices.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choices.compact .choice { padding: .7rem .85rem .7rem .9rem; }

/* =====================================================================
   Feature rating boxes
   ===================================================================== */
.rate-grid { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.rate-box {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .9rem 1rem; border: 1px solid var(--surface-border);
  border-radius: var(--border-radius); background: var(--surface-ground);
}
.rate-box .rate-meta { display: flex; flex-direction: column; }
.rate-box .stars { margin-top: .35rem; }

/* =====================================================================
   Callout
   ===================================================================== */
.callout {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .85rem 1rem; margin: 0 0 1.25rem;
  background: var(--primary-50); border: 1px solid var(--primary-100);
  border-left: 3px solid var(--primary-color); border-radius: var(--border-radius);
  font-size: .88rem; color: var(--text-color);
}
.callout .ico { width: 20px; height: 20px; flex: none; color: var(--primary-color); margin-top: .1rem; }
.callout b { font-weight: var(--font-weight-medium); }

/* =====================================================================
   File upload dropzone
   ===================================================================== */
.dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .35rem; padding: 1.5rem 1rem; cursor: pointer;
  border: 2px dashed var(--gray-200); border-radius: var(--border-radius);
  background: var(--surface-ground); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--primary-color); background: var(--primary-50); }
.dropzone .dz-title { font-weight: var(--font-weight-medium); }
.dropzone .dz-hint { font-size: .8rem; color: var(--text-color-secondary); }
.dropzone .dz-file { font-size: .85rem; color: var(--primary-700); margin-top: .35rem; font-weight: var(--font-weight-medium); }
.dropzone.has-file { border-color: var(--green-500); background: rgba(96,169,10,.06); }
.dropzone.has-file .dz-file { color: var(--green-500); }
.dropzone.error { border-color: var(--red-500); background: rgba(209,52,56,.05); }
.dropzone.error .dz-file { color: var(--red-500); }

.check-item.standalone { margin-top: .25rem; }

/* =====================================================================
   Wizard navigation row
   ===================================================================== */
.nav-row { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.nav-row .step-count { color: var(--text-color-secondary); font-size: .85rem; margin: 0 auto; }
.nav-row .btn { min-width: 7rem; }

/* =====================================================================
   Review step
   ===================================================================== */
.review-sec { padding: .9rem 0; border-bottom: 1px solid var(--surface-border); }
.review-sec:last-child { border-bottom: none; }
.review-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.review-head h3 { font-size: 1.02rem; font-weight: var(--font-weight-medium); }
.link-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--primary-color); font-size: .85rem; padding: 0;
}
.link-btn:hover { color: var(--primary-700); text-decoration: underline; }
.review-sec dl { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: .3rem .9rem; margin: 0; }
.review-sec dt { color: var(--text-color-secondary); font-size: .88rem; }
.review-sec dd { margin: 0; font-size: .9rem; white-space: pre-wrap; }
.review-sec dd .muted { color: var(--gray-300); }

/* =====================================================================
   Error state
   ===================================================================== */
.errbox { border-left: 3px solid var(--red-500); }
.errbox h2 { font-size: 1.25rem; margin-bottom: .5rem; color: var(--error-border); }
.errbox p { color: var(--text-color-secondary); margin-top: 0; }

/* success badge uses an SVG check now (no emoji) */
.thanks .badge-ico { font-size: 0; }
.thanks .ref { font-size: .82rem; color: var(--text-color-secondary); margin-top: .75rem; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 620px) {
  .grid-2, .rate-grid { grid-template-columns: 1fr; }
  .review-sec dl { grid-template-columns: 1fr; gap: .1rem .9rem; }
  .review-sec dd { margin-bottom: .5rem; }
}

@media (max-width: 520px) {
  .intro h1 { font-size: 1.6rem; }
  .card { padding: 1.1rem; }
  .nav-row .btn { min-width: 0; flex: 1; }
  .nav-row .step-count { order: -1; flex-basis: 100%; text-align: center; }
}
