/* =========================================================================
   Attractiveness Test — styling
   One primary (indigo) + one accent (coral). Light editorial layout.
   No external fonts, no frameworks.
   ========================================================================= */

:root {
  --bg:        #f7f7f5;
  --surface:   #ffffff;
  --ink:       #14161c;
  --ink-2:     #3d414d;
  --muted:     #6b7280;
  --line:      #e3e4e7;
  --line-soft: #eef0f2;
  --primary:   #3538a8;
  --primary-d: #262882;
  --primary-w: #ececfb;
  --accent:    #d8563f;
  --accent-w:  #fbece8;
  --good:      #1c7a5b;
  --error:     #b3362a;
  --radius:    14px;
  --shadow:    0 1px 2px rgba(20,22,28,.04), 0 12px 32px rgba(20,22,28,.05);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.page { max-width: 1120px; margin: 0 auto; padding: 0 28px 80px; }

/* ---------- top bar ---------- */
.topbar {
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 650; font-size: 15px; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none;
}
.brand-dim { color: var(--muted); font-weight: 450; }
.brand-mark {
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--primary);
  position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 5px;
  border: 1.6px solid #fff; border-radius: 50%;
}
.topbar-note { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

/* ---------- shared type ---------- */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}

/* ---------- hero / first screen ---------- */
.hero { padding: 58px 0 40px; }
.hero-head { max-width: 720px; margin-bottom: 34px; }
.hero h1 {
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.04; letter-spacing: -.045em; font-weight: 700;
  margin: 0 0 18px;
}
.lede {
  font-size: clamp(16px, 2vw, 19px); line-height: 1.55;
  color: var(--ink-2); max-width: 620px; margin: 0;
}

/* workbench: two panels side by side */
.workbench {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  align-items: stretch;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  min-height: 420px;
  display: flex; flex-direction: column;
}
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.panel-head .step {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--primary); background: var(--primary-w);
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
}
.panel-head h2 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: -.015em; }

/* dropzone */
.dropzone {
  border: 1.5px dashed #c8cad6; border-radius: 12px;
  background: #fbfbfd;
  padding: 38px 20px; text-align: center;
  cursor: pointer; outline: none;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--primary); background: var(--primary-w); }
.dropzone:focus-visible { box-shadow: 0 0 0 3px rgba(53,56,168,.18); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-w); transform: scale(1.005); }
.dz-icon { color: var(--primary); margin-bottom: 12px; }
.dz-main { margin: 0 0 4px; font-size: 15px; color: var(--ink-2); }
.dz-main strong { color: var(--ink); font-weight: 650; }
.dz-link { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.dz-sub { margin: 0; font-size: 12px; color: var(--muted); }

/* preview */
.preview-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #f0f0f2; }
.preview-wrap img { width: 100%; height: 240px; object-fit: cover; }
.clear-btn {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,.92);
  color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.clear-btn:hover { background: #fff; border-color: var(--muted); }

.validation { min-height: 18px; font-size: 12px; margin: 10px 0 0; color: var(--muted); }
.validation.is-error { color: var(--error); }
.validation.is-ok { color: var(--good); }

/* buttons */
.btn {
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 650; letter-spacing: -.005em;
  padding: 13px 18px; transition: background .16s ease, transform .12s ease, opacity .16s ease;
}
.btn:focus-visible { outline: 3px solid rgba(53,56,168,.3); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: #fff; margin-top: 14px; width: 100%; }
.btn-primary:hover:not(:disabled) { background: var(--primary-d); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .42; cursor: not-allowed; }
.btn-primary.is-running .btn-label { visibility: hidden; }
.btn-primary.is-running { position: relative; }
.btn-spinner { display: none; }
.btn-primary.is-running .btn-spinner {
  display: block; position: absolute; left: 50%; top: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-ghost {
  background: var(--surface); color: var(--primary);
  border: 1px solid var(--line); padding: 10px 16px;
}
.btn-ghost:hover { border-color: var(--primary); background: var(--primary-w); }
.privacy { font-size: 11px; color: var(--muted); margin: 14px 0 0; text-align: center; }

/* ---------- output states ---------- */
.empty-state, .loading-state, .error-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: 13px; min-height: 260px;
}
.empty-ring {
  width: 74px; height: 74px; border-radius: 50%;
  border: 8px solid var(--line-soft); margin-bottom: 18px; position: relative;
}
.empty-ring::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 8px solid transparent; border-top-color: var(--primary-w);
}
.loading-track { width: 160px; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.loading-track span { display: block; height: 100%; width: 40%; background: var(--primary); border-radius: 4px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.error-title { color: var(--error); font-weight: 650; font-size: 16px; margin: 0 0 6px; }
.error-text { margin: 0; max-width: 260px; }

/* result */
.result { flex: 1; }
.result[hidden] { display: none; }
.score-block {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.score-main { display: flex; align-items: baseline; gap: 6px; }
.score-num {
  font-size: 68px; line-height: .9; font-weight: 700; letter-spacing: -.06em;
  color: var(--primary); font-variant-numeric: tabular-nums;
}
.score-den { font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.score-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tier {
  font-size: 12px; font-weight: 650; color: var(--accent);
  background: var(--accent-w); padding: 4px 10px; border-radius: 999px;
}
.score-rule { font-size: 11px; color: var(--muted); }

.breakdown { display: flex; flex-direction: column; gap: 13px; }
.metric-row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.metric-name { font-size: 13px; color: var(--ink-2); font-weight: 550; }
.metric-val { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric-val small { font-size: 10px; color: var(--muted); font-weight: 400; }
.meter { height: 6px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
.meter span {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), #6a6de0);
  transition: width .5s cubic-bezier(.2,.7,.3,1);
}
.result-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.psl { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- content sections ---------- */
.content { padding: 66px 0 10px; border-top: 1px solid var(--line); margin-top: 26px; }
.section-head { max-width: 660px; margin-bottom: 38px; }
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -.035em;
  font-weight: 700; margin: 0 0 16px;
}
.section-lede { color: var(--ink-2); font-size: 16px; line-height: 1.65; margin: 0; }

.metric-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.metric-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px;
}
.mc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.mc-index { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.mc-top h3 { font-size: 16px; font-weight: 650; margin: 0; flex: 1; letter-spacing: -.01em; }
.mc-weight { font-size: 11px; color: var(--primary); background: var(--primary-w); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.metric-card p { font-size: 13px; line-height: 1.6; margin: 0 0 10px; color: var(--ink-2); }
.metric-card p span {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 3px;
}
.mc-formula { font-family: var(--mono); font-size: 12px !important; background: var(--bg); padding: 10px 12px; border-radius: 8px; }
.mc-detail { color: var(--muted) !important; font-size: 12px !important; margin-bottom: 0 !important; }

/* formula card */
.formula-card {
  margin-top: 22px; background: var(--ink); color: #fff;
  border-radius: 14px; padding: 30px;
}
.formula-card .eyebrow { color: #9b9df0; }
.formula-head h3 { font-size: 22px; font-weight: 650; margin: 0 0 22px; letter-spacing: -.02em; }
.formula-eq {
  font-family: var(--mono); font-size: clamp(15px, 2.5vw, 21px);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  padding: 16px 18px; border-radius: 10px; margin: 0 0 16px; overflow-x: auto;
}
.formula-note { font-size: 13px; color: #b9bcc8; line-height: 1.7; margin: 0 0 24px; max-width: 720px; }
.formula-note em { color: #fff; font-style: normal; font-weight: 600; }
.weight-table { display: flex; flex-direction: column; gap: 9px; }
.wt-row { display: grid; grid-template-columns: 150px 1fr 42px; gap: 14px; align-items: center; font-size: 12px; color: #d7d9e2; }
.wt-bar { height: 5px; background: rgba(255,255,255,.1); border-radius: 5px; overflow: hidden; }
.wt-bar i { display: block; height: 100%; background: #8b8def; border-radius: 5px; }
.wt-row > span:last-child { font-family: var(--mono); text-align: right; }
.formula-note-tight { margin: 18px 0 0; font-size: 12px; }

/* PSL display mapping */
.psl-map { margin-top: 28px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 24px; }
.psl-map-head h4 { font-size: 16px; font-weight: 650; margin: 0 0 10px; letter-spacing: -.01em; }
.psl-map .formula-note { font-size: 12px; color: #a9adbd; margin: 0 0 16px; }
.psl-rows { display: flex; flex-direction: column; gap: 1px; }
.psl-row {
  display: grid; grid-template-columns: 1fr 1fr;
  font-family: var(--mono); font-size: 12px;
  padding: 8px 12px; background: rgba(255,255,255,.04);
}
.psl-row:first-child { background: rgba(255,255,255,.09); color: #fff; font-weight: 600; }
.psl-row span:last-child { text-align: right; color: #cfd2df; }
.psl-row:first-child span:last-child { color: #fff; }

/* FAQ */
.faq-section { padding-bottom: 20px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); padding: 2px 0; }
.faq-list summary {
  list-style: none; cursor: pointer; padding: 18px 34px 18px 0;
  font-size: 15px; font-weight: 600; position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--primary); font-weight: 400;
}
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { margin: 0 0 20px; color: var(--ink-2); font-size: 14px; max-width: 720px; }

/* footer */
.footer {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); margin-top: 44px; padding-top: 24px;
  font-size: 12px; color: var(--muted);
}
.footer-dim { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .page { padding: 0 18px 56px; }
  .topbar { height: 58px; }
  .topbar-note { display: none; }
  .hero { padding: 36px 0 26px; }
  .hero h1 { font-size: 40px; }
  .workbench { grid-template-columns: 1fr; gap: 14px; }
  .panel { min-height: 0; padding: 20px; }
  .score-num { font-size: 56px; }
  .metric-list { grid-template-columns: 1fr; }
  .content { padding: 48px 0 6px; }
  .formula-card { padding: 22px; }
  .wt-row { grid-template-columns: 110px 1fr 38px; gap: 10px; }
  .footer { flex-direction: column; gap: 6px; text-align: center; }
}

@media (max-width: 400px) {
  .page { padding: 0 14px 48px; }
  .hero h1 { font-size: 34px; }
  .dropzone { padding: 28px 14px; }
  .score-num { font-size: 48px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
