/* =============================================================
   HB Machining — Color Palette Review Site
   Phase 1: Frontend Shell
   ============================================================= */

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #ECEEF1;
  color: #1C1F26;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
ul { list-style: none; }


/* ─── Review Header ─────────────────────────────────────────── */
.review-bar {
  background: #1C1F26;
  color: #E8ECF1;
  padding: 14px 24px;
  border-bottom: 3px solid #3E7FD4;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.review-bar__inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.review-bar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.review-bar__logo {
  font-size: 1.4rem;
  color: #3E7FD4;
  line-height: 1;
}

.review-bar__title {
  color: #E8ECF1;
}

.review-bar__instructions {
  font-size: 0.825rem;
  color: #8B95A5;
  flex: 1;
}

.review-bar__cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  background: #3E7FD4;
  color: #fff;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s;
}

.review-bar__cta:hover {
  background: #3070bf;
}


/* ─── Review Introduction ───────────────────────────────────── */
.review-intro {
  background: #252932;
  border-bottom: 1px solid #383D47;
  padding: 36px 32px;
}

.review-intro__inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.review-intro__headline {
  font-size: 1.6rem;
  font-weight: 700;
  color: #E8ECF1;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  flex-shrink: 0;
}

.review-intro__body {
  font-size: 0.9rem;
  color: #8B95A5;
  max-width: 680px;
  line-height: 1.75;
  flex: 1;
}


/* ─── Palette Section & Grid ────────────────────────────────── */
.palette-section {
  padding: 40px 24px 56px;
  background: #ECEEF1;
}

.palette-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}


/* ─── Palette Card ───────────────────────────────────────────── */
.palette-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.palette-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 44px rgba(0,0,0,0.14), 0 3px 10px rgba(0,0,0,0.08);
}


/* ── Card: Header (colored band) ── */
.pc-header {
  padding: 24px 24px 22px;
  position: relative;
}

.pc-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.pc-header__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 2px;
  padding: 3px 10px;
  margin-bottom: 10px;
  color: #fff;
}

.pc-header__name {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.pc-header__descriptor {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.pc-header__swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pc-swatch {
  position: relative;
  width: 56px;
  height: 50px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.22);
  cursor: default;
  overflow: hidden;
  flex-shrink: 0;
}

.pc-swatch__hex,
.pc-swatch__name {
  position: absolute;
  left: 0;
  right: 0;
  font-size: 0.6rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.pc-swatch__name {
  top: 5px;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  mix-blend-mode: normal;
}

.pc-swatch__hex {
  bottom: 4px;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  font-size: 0.55rem;
}


/* ── Card: Section label ── */
.pc-section-label {
  padding: 5px 18px 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7A8499;
  background: #ECEEF1;
  border-top: 1px solid #D8DCE4;
  border-bottom: 1px solid #D8DCE4;
}


/* ── Card: Nav mockup ── */
.pc-nav {
  display: flex;
  align-items: center;
  padding: 0 18px;
  min-height: 48px;
  gap: 0;
}

.pc-nav__identity {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin-right: 12px;
}

.pc-nav__logo {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.pc-nav__brand {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.pc-nav__links {
  display: flex;
  flex: 1;
  gap: 0;
  overflow: hidden;
}

.pc-nav__link {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0 9px;
  height: 48px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}


/* ── Card: Shared button ── */
.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: 3px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: default;
  white-space: nowrap;
  flex-shrink: 0;
}

.pc-btn--ghost {
  background: transparent !important;
  border: 1.5px solid rgba(255,255,255,0.4);
  color: #fff !important;
}

.pc-btn--cta {
  font-size: 0.82rem;
  padding: 8px 20px;
}

.pc-btn--form {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}


/* ── Card: Hero mockup ── */
.pc-hero {
  padding: 26px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.pc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.pc-hero__eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
}

.pc-hero__headline {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  position: relative;
}

.pc-hero__sub {
  font-size: 0.75rem;
  line-height: 1.6;
  opacity: 0.82;
  max-width: 380px;
  position: relative;
}

.pc-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
  position: relative;
}

.pc-hero__stats {
  display: flex;
  gap: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 4px;
  position: relative;
}

.pc-hero__stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pc-hero__stat strong {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.pc-hero__stat span {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}


/* ── Card: Content cards mockup ── */
.pc-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.pc-card {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top-width: 3px;
}

.pc-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.pc-card__title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pc-card__body {
  font-size: 0.72rem;
  line-height: 1.5;
  flex: 1;
}

.pc-card__link {
  font-size: 0.7rem;
  font-weight: 700;
  cursor: default;
  letter-spacing: 0.01em;
}


/* ── Card: CTA mockup ── */
.pc-cta {
  padding: 22px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pc-cta__content {
  flex: 1;
}

.pc-cta__heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.pc-cta__sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  margin-top: 3px;
}


/* ── Card: Form block mockup ── */
.pc-form {
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pc-form__title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.pc-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pc-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pc-form__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pc-form__input {
  height: 30px;
  border: 1.5px solid;
  border-radius: 3px;
  background: #FAFBFC;
}


/* ── Card: Isolate button (positioned in header top-right) ── */
.pc-header__isolate-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  padding: 4px 11px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pc-header__isolate-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* ── Isolated card spans the full grid width ── */
.palette-card--isolated {
  grid-column: 1 / -1;
}


/* ── Card: Footer — character note + select button ── */
.pc-footer {
  padding: 16px 20px 18px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pc-footer__character {
  font-size: 0.78rem;
  line-height: 1.6;
  font-style: italic;
}

.pc-footer__select-btn {
  align-self: flex-start;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 20px;
  border-radius: 3px;
  background: transparent;
  border: 1.5px solid currentColor;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.pc-footer__select-btn:hover {
  opacity: 0.8;
}

.pc-footer__select-btn--selected {
  color: #fff !important;
  border-color: transparent !important;
}


/* ── Card: 3D torus canvas ── */
.pc-torus {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 8px;
  overflow: hidden;
}

.pc-torus__canvas {
  display: block;
  width: 100%;
  height: 200px;
  cursor: grab;
}

.pc-torus__canvas:active {
  cursor: grabbing;
}

.pc-torus__hint {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  padding: 6px 0 4px;
  pointer-events: none;
  opacity: 0.85;
}


/* ─── Feedback Section ───────────────────────────────────────── */
.feedback {
  background: #F0F2F5;
  border-top: 4px solid #3E7FD4;
  padding: 72px 32px;
}

.feedback__inner {
  max-width: 800px;
  margin: 0 auto;
}

.feedback__header {
  margin-bottom: 48px;
}

.feedback__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0D1523;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.feedback__subtitle {
  font-size: 0.95rem;
  color: #4A5568;
  line-height: 1.7;
  max-width: 600px;
}

/* Fieldset */
.feedback__fieldset {
  border: 1px solid #C8D3E0;
  border-radius: 4px;
  padding: 28px 28px 24px;
  margin-bottom: 24px;
  background: #FFFFFF;
}

.feedback__legend {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1B3A6B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 8px;
  margin-left: -4px;
}

.feedback__hint {
  font-size: 0.825rem;
  color: #64748B;
  margin-bottom: 20px;
  margin-top: 4px;
}

.feedback__required {
  color: #C0392B;
  margin-left: 2px;
}

.feedback__optional {
  font-size: 0.75rem;
  font-weight: 400;
  color: #8B95A5;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

/* Form rows */
.feedback__row {
  display: flex;
  gap: 20px;
}

.feedback__row--two-col > .feedback__field {
  flex: 1;
}

.feedback__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback__field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1C1F26;
}

.feedback__field input[type="text"],
.feedback__field input[type="email"],
.feedback__field textarea {
  border: 1px solid #C8D3E0;
  border-radius: 3px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #1C1F26;
  background: #FAFBFC;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.feedback__field input[type="text"]:focus,
.feedback__field input[type="email"]:focus,
.feedback__field textarea:focus {
  outline: none;
  border-color: #3E7FD4;
  box-shadow: 0 0 0 3px rgba(62, 127, 212, 0.15);
}

.feedback__field textarea {
  resize: vertical;
  min-height: 100px;
}

/* Brand quality score grid */
.feedback__score-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feedback__score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid #E8ECF1;
}

.feedback__score-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.feedback__score-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1C1F26;
  min-width: 110px;
}

.feedback__scale {
  display: flex;
  gap: 8px;
}

.score-btn {
  cursor: pointer;
}

.score-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.score-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 3px;
  border: 1.5px solid #C8D3E0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4A5568;
  background: #F4F6F9;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.score-btn:hover span {
  border-color: #3E7FD4;
  color: #3E7FD4;
  background: #EDF3FB;
}

.score-btn input:checked + span {
  background: #3E7FD4;
  color: #fff;
  border-color: #3E7FD4;
}

.score-btn input:focus-visible + span {
  outline: 2px solid #3E7FD4;
  outline-offset: 2px;
}

/* Reviewer type radio group */
.feedback__radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #1C1F26;
}

.radio-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #3E7FD4;
  cursor: pointer;
}

/* Preferred palette radio group */
.feedback__preference-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pref-option {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.pref-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pref-option__label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 0;
  border: 1.5px solid #C8D3E0;
  border-radius: 4px;
  background: #F4F6F9;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  line-height: 1.3;
  overflow: hidden;
}

.pref-option__swatch {
  width: 6px;
  align-self: stretch;
  border-radius: 0;
  flex-shrink: 0;
}

.pref-option__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pref-option__label strong {
  font-size: 0.88rem;
  color: #1C1F26;
  display: block;
}

.pref-option__label em {
  font-size: 0.75rem;
  font-style: normal;
  color: #64748B;
  display: block;
}

.pref-option__accent {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 4px;
}

.pref-option:hover .pref-option__label {
  border-color: #3E7FD4;
  background: #EDF3FB;
}

.pref-option input:checked + .pref-option__label {
  border-color: #3E7FD4;
  background: #EDF3FB;
  box-shadow: inset 0 0 0 1px #3E7FD4;
}

.pref-option input:focus-visible + .pref-option__label {
  outline: 2px solid #3E7FD4;
  outline-offset: 2px;
}

/* Submit row */
.feedback__submit-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.feedback__submit-btn {
  padding: 13px 36px;
  background: #1B3A6B;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s;
}

.feedback__submit-btn:hover:not(:disabled) {
  background: #122849;
}

.feedback__submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.feedback__privacy-note {
  font-size: 0.775rem;
  color: #64748B;
  max-width: 320px;
  line-height: 1.5;
}

/* Status messages */
.feedback__message {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 3px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.feedback__message--success {
  background: #EDF7ED;
  border: 1px solid #4CAF50;
  color: #1B5E20;
}

.feedback__message--warning {
  background: #FFF8E1;
  border: 1px solid #FFB300;
  color: #4D3900;
}

.feedback__message--error {
  background: #FEECEC;
  border: 1px solid #E53E3E;
  color: #7B1C1C;
}


/* Palette selection toast */
.palette-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1a2332;
  color: #fff;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 18px rgba(0,0,0,0.28);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
}

.palette-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ─── Responsive ─────────────────────────────────────────────── */

/* 3-column grid for very wide screens */
@media (min-width: 1400px) {
  .palette-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Single column for tablet and below */
@media (max-width: 900px) {
  .palette-grid {
    grid-template-columns: 1fr;
  }

  .feedback__row--two-col {
    flex-direction: column;
  }

  .pc-content {
    grid-template-columns: 1fr;
  }

  .pc-nav__links {
    display: none;
  }

  .pc-form__row {
    grid-template-columns: 1fr;
  }

  .review-intro__inner {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .review-intro {
    padding: 28px 20px;
  }

  .review-intro__inner {
    flex-direction: column;
    gap: 10px;
  }

  .palette-section {
    padding: 24px 16px 40px;
  }

  .palette-grid {
    gap: 20px;
  }

  .feedback {
    padding: 48px 20px;
  }

  .feedback__fieldset {
    padding: 20px 16px;
  }

  .feedback__preference-group {
    flex-direction: column;
  }

  .feedback__score-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .review-intro__headline {
    font-size: 1.3rem;
    margin-bottom: 0;
  }

  .pc-hero__stats {
    gap: 16px;
    flex-wrap: wrap;
  }

  .pc-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .review-bar__inner {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .review-bar__instructions {
    order: 3;
    flex-basis: 100%;
    font-size: 0.775rem;
  }

  .review-bar__cta {
    margin-left: auto;
  }
}
