:root {
  --brown: #5C3629;
  --gold: #CAA87B;
  --orange: #F37021;
  --white: #FFFFFF;
  --gray: #555859;
  --black: #231815;
  --sky: #015699;
  --paper: #FBF8F4;
  --line: #E7DED2;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pad: clamp(24px, 4vw, 64px);
  --slow: 600ms cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--paper); color: var(--black); font-family: var(--sans); font-weight: 300; }
body { overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
input, select, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

#app { position: fixed; inset: 0; }

.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity var(--slow), transform var(--slow), visibility 0s linear 600ms;
}
.screen.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity var(--slow), transform var(--slow), visibility 0s; }

/* logo provizoriu: se înlocuiește cu fișierul oficial (alb/negru) */
.logo { font-family: var(--sans); font-weight: 600; letter-spacing: .18em; font-size: 15px; color: var(--black); }
.logo-light { color: var(--white); }

.eyebrow { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gray); font-weight: 500; }
.link-btn { font-size: 14px; color: var(--gray); padding: 12px 4px; letter-spacing: .02em; }
.link-btn:active { color: var(--brown); }

.btn { min-height: 64px; padding: 0 36px; border-radius: 2px; font-size: 17px; font-weight: 500; letter-spacing: .02em; transition: transform .2s, background .3s, opacity .3s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-ghost { color: var(--brown); border: 1px solid var(--line); }

.topbar { display: flex; align-items: center; gap: 32px; padding: 20px var(--pad); min-height: 84px; }
.topbar .restart { margin-left: auto; }

/* ---------- lock ---------- */
.screen-lock { background: var(--paper); align-items: center; justify-content: center; z-index: 5; }
.lock { width: min(440px, 90vw); display: flex; flex-direction: column; gap: 16px; }
.lock .logo { margin-bottom: 16px; }
.lock h2 { font-family: var(--serif); font-weight: 400; font-size: 40px; color: var(--brown); line-height: 1; }
.lock > p { color: var(--gray); font-size: 15px; margin-top: -6px; }
.lock .btn { margin-top: 6px; }

/* ---------- attract ---------- */
.screen-attract { background: var(--brown); cursor: pointer; }
.attract-scenes, .attract-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.attract-scenes > div { position: absolute; inset: -3%; opacity: 0; transition: opacity 2.4s ease; }
.attract-scenes > div.on { opacity: 1; }
.attract-scenes > div.on svg { animation: drift 14s linear forwards; }
.attract-scenes svg { width: 100%; height: 100%; display: block; will-change: transform; backface-visibility: hidden; }
@keyframes drift { from { transform: scale(1.02) translateX(0); } to { transform: scale(1.08) translateX(-1.5%); } }
.attract-veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(35, 24, 21, .82) 0%, rgba(92, 54, 41, .55) 45%, rgba(35, 24, 21, .1) 100%); }
.attract-content { position: relative; margin: auto 0; padding: 0 var(--pad); max-width: 720px; display: flex; flex-direction: column; gap: 28px; color: var(--white); }
.attract-content .logo { font-size: 18px; margin-bottom: 24px; }
.attract-title { font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 6.4vw, 92px); line-height: 1.02; }
.attract-sub { font-size: 19px; color: rgba(255, 255, 255, .82); }
/* static: orice animație pe un contur de 1px, peste fundalul în mișcare, se vede ca pâlpâire */
.attract-cta { align-self: flex-start; margin-top: 8px; padding: 16px 40px; border: 1px solid var(--gold); background: rgba(35, 24, 21, .35); color: var(--white); font-size: 15px; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- quiz ---------- */
.screen-quiz { background: var(--paper); }
.progress { display: flex; align-items: center; gap: 16px; flex: 1; max-width: 420px; margin-left: 24px; }
.progress-track { flex: 1; height: 2px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--gold); transition: width var(--slow); }
.progress-label { font-size: 13px; color: var(--gray); font-variant-numeric: tabular-nums; min-width: 32px; }

.quiz-body { flex: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); padding: 0 var(--pad) var(--pad); align-items: center; }
.quiz-question { display: flex; flex-direction: column; gap: 20px; align-self: center; }
.quiz-question h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 4.2vw, 60px); line-height: 1.08; color: var(--brown); }
.quiz-question .back { align-self: flex-start; margin-top: 12px; }
.quiz-question .back[hidden] { display: block; visibility: hidden; }
.quiz-question.anim, .answers.anim { animation: fadeIn .55s ease both; }
.answers.anim { animation-delay: .08s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.answer {
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px; text-align: left;
  min-height: clamp(150px, 22vh, 210px); padding: 24px; background: var(--white); border: 1px solid var(--line);
  transition: border-color .25s, background .25s, transform .25s;
}
.answer svg { width: 34px; height: 34px; color: var(--brown); }
.answer span { font-size: 18px; line-height: 1.3; color: var(--black); font-weight: 400; }
.answer:active { transform: scale(.99); }
.answer.is-selected { border-color: var(--gold); background: #F6EEE2; box-shadow: inset 0 0 0 1px var(--gold); }
.answer.is-selected svg { color: var(--gold); }
.answers.locked { pointer-events: none; }
.answers.single-word .answer span { font-family: var(--serif); font-size: 30px; }

/* ---------- analysing ---------- */
.screen-analysing { background: var(--brown); color: var(--white); align-items: center; justify-content: center; }
.analysing { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.analysing p { font-family: var(--serif); font-size: 34px; }
.road { width: 220px; }
.road path { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 260; stroke-dashoffset: 260; }
.screen-analysing.is-active .road path { animation: draw 1.4s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- result ---------- */
.screen-result { flex-direction: row; background: var(--paper); }
.result-media { flex: 0 0 44%; position: relative; overflow: hidden; background: var(--line); }
.result-media svg, .result-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen-result.is-active .result-media svg, .screen-result.is-active .result-media img { animation: slowzoom 12s ease-out forwards; }
@keyframes slowzoom { from { transform: scale(1.06); } to { transform: scale(1); } }
.result-body { flex: 1; display: flex; flex-direction: column; padding: 0 var(--pad) var(--pad); gap: 18px; overflow-y: auto; }
.topbar-inline { padding: 20px 0; margin-bottom: auto; }
.result-title { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 4.6vw, 68px); line-height: 1.02; color: var(--brown); }
.result-desc { font-size: 18px; line-height: 1.55; color: var(--gray); max-width: 560px; }
.result-model { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 6px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.model-name { font-family: var(--serif); font-size: 30px; color: var(--black); }
.model-name strong { font-weight: 600; }
.model-name span { color: var(--gray); font-size: 22px; }
.result-model p { font-size: 17px; line-height: 1.5; }
.result-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; margin-bottom: auto; }

/* ---------- form ---------- */
.screen-form { background: var(--paper); }
.form-heading h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; color: var(--brown); line-height: 1; }
.form-heading p { font-size: 14px; color: var(--gray); margin-top: 4px; }
.form { flex: 1; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 4vw, 64px); padding: 0 var(--pad) var(--pad); overflow-y: auto; align-content: start; }
.form-col { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--gray); letter-spacing: .02em; }
.field input, .field select, .prefixed {
  height: 56px; border: 1px solid var(--line); background: var(--white); border-radius: 2px; padding: 0 16px; font-size: 18px; color: var(--black); font-weight: 400; outline: none; width: 100%;
  -webkit-appearance: none; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--gray) 50%), linear-gradient(-45deg, transparent 50%, var(--gray) 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus, .field select:focus, .prefixed:focus-within { border-color: var(--gold); }
.prefixed { display: flex; align-items: center; gap: 10px; padding: 0 0 0 16px; }
.prefixed em { font-style: normal; color: var(--gray); }
.prefixed input { border: 0; height: 100%; padding: 0 16px 0 0; flex: 1; min-width: 0; background: transparent; font-size: 18px; outline: none; }
.field.invalid input, .field.invalid .prefixed { border-color: #B3261E; }
.field-hint { font-size: 13px; color: #B3261E; min-height: 0; }
.field-hint:empty { display: none; }
.field-hint button { color: var(--brown); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; padding: 4px 0; }
.check.invalid span { color: #B3261E; }

.check { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 1.45; padding: 6px 0; }
.check b { font-weight: 400; }
.check input { -webkit-appearance: none; appearance: none; flex: 0 0 26px; height: 26px; border: 1px solid var(--gray); border-radius: 2px; background: var(--white); margin-top: -2px; display: grid; place-content: center; }
.check input:checked { background: var(--brown); border-color: var(--brown); }
.check input:checked::after { content: ''; width: 12px; height: 7px; border-left: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(-45deg) translate(1px, -1px); }
.check a { color: var(--brown); text-underline-offset: 3px; white-space: nowrap; }
.consent-intro { font-size: 13px; color: var(--gray); margin-top: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.qrs { display: flex; gap: 20px; margin-top: 6px; }
.qr { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 13px; color: var(--gray); line-height: 1.3; }
.qr img { width: 64px; height: 64px; background: var(--white); padding: 6px; border: 1px solid var(--line); }
.form-error { color: #B3261E; font-size: 14px; min-height: 20px; }
.submit-row { display: flex; flex-direction: column; gap: 12px; }
.notice { font-size: 12.5px; line-height: 1.45; color: var(--gray); }
.submit-row .btn { width: 100%; }

/* ---------- thanks ---------- */
.screen-thanks { background: var(--brown); color: var(--white); align-items: center; justify-content: center; text-align: center; }
.thanks { display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 640px; padding: 0 var(--pad); }
.thanks .logo { margin-bottom: 30px; }
.thanks h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 6vw, 84px); line-height: 1; }
.thanks p { font-size: 20px; line-height: 1.5; color: rgba(255, 255, 255, .88); }
.thanks .thanks-sub { font-size: 15px; color: var(--gold); }
.thanks-timer { width: 120px; height: 1px; background: rgba(255, 255, 255, .2); margin-top: 40px; overflow: hidden; }
.thanks-timer span { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; }

/* ---------- sheets ---------- */
.sheet { position: absolute; inset: 0; background: rgba(35, 24, 21, .55); display: grid; place-items: center; z-index: 20; animation: fadeIn .3s ease; }
.sheet[hidden] { display: none; }
.sheet-card { width: min(860px, 92vw); height: 86vh; background: var(--white); display: flex; flex-direction: column; }
.sheet-close { align-self: flex-end; padding: 16px 24px; }
.sheet-card iframe { flex: 1; border: 0; }
.pin-card { background: var(--paper); padding: 36px 44px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.pin-dots { display: flex; gap: 14px; }
.pin-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--brown); }
.pin-dots i.on { background: var(--brown); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; }
.pin-pad button { height: 64px; border: 1px solid var(--line); background: var(--white); font-size: 22px; }

/* ---------- admin ---------- */
.admin { position: absolute; inset: 0; z-index: 30; background: #F4F1EC; overflow-y: auto; -webkit-user-select: text; user-select: text; font-weight: 400; }
.admin[hidden] { display: none; }
.adm-head { position: sticky; top: 0; background: var(--brown); color: var(--white); display: flex; align-items: center; gap: 24px; padding: 16px 32px; z-index: 2; }
.adm-head .logo { color: var(--white); }
.adm-head h1 { font-size: 15px; font-weight: 500; letter-spacing: .04em; }
.adm-head .spacer { flex: 1; }
.adm-head button { border: 1px solid rgba(255, 255, 255, .35); padding: 8px 16px; font-size: 14px; }
.adm-wrap { padding: 28px 32px 60px; display: grid; gap: 24px; max-width: 1400px; }
.adm-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi { background: var(--white); padding: 18px 20px; border: 1px solid var(--line); }
.kpi b { display: block; font-size: 34px; font-weight: 500; color: var(--brown); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--gray); }
.kpi small { display: block; font-size: 12px; color: var(--gray); margin-top: 4px; }
.adm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card { background: var(--white); border: 1px solid var(--line); padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.card h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gray); font-weight: 500; }
.dist-row { display: grid; grid-template-columns: 170px 1fr 70px; align-items: center; gap: 12px; font-size: 14px; }
.dist-bar { height: 10px; background: #F0EBE4; }
.dist-bar i { display: block; height: 100%; }
.dist-row em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; color: var(--gray); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th, .adm-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table th { font-weight: 500; color: var(--gray); font-size: 12px; }
.adm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 20px; background: #EFE7DC; color: var(--brown); white-space: nowrap; }
.pill.ok { background: #E3EFE6; color: #24613A; }
.pill.wait { background: #FCEBDD; color: #A0480F; }
.adm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--gray); }
.adm-form input { height: 40px; border: 1px solid var(--line); padding: 0 10px; font-size: 14px; }
.adm-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-btn { border: 1px solid var(--brown); color: var(--brown); padding: 10px 16px; font-size: 14px; }
.adm-btn.solid { background: var(--brown); color: var(--white); }
.adm-btn.warn { border-color: #B3261E; color: #B3261E; }
.adm-note { font-size: 12.5px; color: var(--gray); line-height: 1.5; }
.mail { background: #FAF8F5; border: 1px solid var(--line); padding: 14px 16px; font-size: 13px; white-space: pre-wrap; line-height: 1.5; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.toggle input { width: 20px; height: 20px; }

@media (max-width: 900px), (orientation: portrait) {
  .quiz-body, .form { grid-template-columns: 1fr; align-content: start; }
  .quiz-body { padding-top: 12px; }
  .screen-result { flex-direction: column; }
  .result-media { flex: 0 0 34%; }
  .adm-grid { grid-template-columns: repeat(2, 1fr); }
  .adm-cols { grid-template-columns: 1fr; }
  body { overflow: auto; }
}
@media (max-width: 600px) {
  .answers { grid-template-columns: 1fr; }
  .answer { min-height: 0; flex-direction: row; align-items: center; padding: 16px; }
  .progress { display: none; }
  .row2, .adm-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
