* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --gold: #C8A882; --gold-h: #B8966E; --gold-light: #FAF6F0;
  --black: #111111; --gray: #6B6B6B; --gray-light: #F9F9F9; --border: #EAEAEA;
  --white: #FFFFFF; --r: 20px; --r-sm: 14px;
  --sb: env(safe-area-inset-bottom, 0px);
  --st: env(safe-area-inset-top, 0px);

  --p-screen: min(20px, 3vh);
  --p-card: min(18px, 2.5vh);
  --p-opt: min(14px, 2vh);
  --gap-quiz: min(8px, 1.5vh);
  --title-quiz: clamp(18px, 4vh, 22px);
}
html, body { height: 100%; background: #FFFFFF !important; overflow: hidden; }
body { color: var(--black) !important; font-family: 'Inter', -apple-system, sans-serif; }
#app { display: flex; flex-direction: column; height: 100dvh; background: #FFFFFF; max-width: 480px; margin: 0 auto; overflow: hidden; }

.top-bar { flex-shrink: 0; padding: 12px var(--p-screen) 6px; padding-top: max(12px, var(--st)); background: #FFFFFF; display: flex; align-items: center; gap: 10px; }
.pb-outer { flex: 1; height: 4px; background: var(--gray-light); border-radius: 2px; overflow: hidden; }
.pb-inner { height: 100%; background: var(--black); border-radius: 2px; transition: width 0.4s ease; }
.step-txt { font-size: 11px; font-weight: 600; color: var(--gray); white-space: nowrap; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

.content { flex: 1 1 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 var(--p-screen); animation: fadeSlideUp 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards; }
.content::-webkit-scrollbar { display: none; }
.quiz-content { display: flex; flex-direction: column; height: 100%; justify-content: flex-start; padding-bottom: 20px; }

@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.bottom { flex-shrink: 0; padding: 12px var(--p-screen); padding-bottom: calc(12px + var(--sb)); background: #FFFFFF; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.02); }
.btn { width: 100%; padding: 14px 20px; border: none; border-radius: var(--r-sm); font-family: 'Inter', sans-serif; font-size: 14.5px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; display: block; transition: all 0.15s ease; letter-spacing: 0.1px; }
.btn:active:not(:disabled) { opacity: 0.85; transform: scale(0.98); }
.btn-black { background: var(--black); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; box-shadow: 0 4px 15px rgba(200, 168, 130, 0.3); }
.btn-outline { background: transparent; color: var(--gray); border: 1.5px solid var(--border); font-weight: 500; }
.btn-outline-dark { background: transparent; color: var(--black); border: 1.5px solid var(--black); font-weight: 600; }
.btn-ghost { background: transparent; collor: var(--gray); border: 1px solid var(--gray-light); font-weight: 400; font-size: 13px; }
.btn:disabled { background: #E0E0E0; color: #A0A0A0; cursor: not-allowed; transform: none !important; opacity: 1 !important; }

/* ТИПОГРАФИКА */
.cormorant { font-family: 'Cormorant Garamond', Georgia, serif; }
.welcome-title { font-size: min(30px, 6vh); font-weight: 600; line-height: 1.1; color: var(--black); text-align: center; margin-bottom: 8px; }
.ns-title { font-size: clamp(24px, 5vh, 28px); font-weight: 600; text-align: center; color: var(--black); margin-bottom: 8px; line-height: 1.2; }
.q-title { font-size: var(--title-quiz); font-weight: 600; line-height: 1.2; color: var(--black); margin-bottom: 4px; }

/* WELCOME SCREEN */
.logo-wrap { text-align: center; padding: 24px 0 16px; flex-shrink: 1; min-height: 0;}
.logo-img { width: clamp(80px, 15vh, 110px); height: clamp(80px, 15vh, 110px); object-fit: contain; display: block; margin: 0 auto; border-radius: 50%; box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.welcome-by { font-size: 14px; color: var(--gray); text-align: center; line-height: 1.5; margin-bottom: 24px; }
.method-note { font-size: 10px; color: #999; text-align: center; line-height: 1.4; margin-bottom: 20px; padding: 0 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.stats-row { display: flex; justify-content: center; gap: 32px; margin-bottom: 20px; }
.stat-item { text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--black); letter-spacing: -0.5px; }
.stat-lbl { font-size: 10px; color: var(--gray); margin-top: 2px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }

/* PREP SCREEN */
.prep-icon { font-size: 48px; display: block; text-align: center; margin-bottom: 16px; margin-top: 20px; }
.prep-list { background: var(--gray-light); border-radius: var(--r); padding: 20px; margin-top: 24px; border: 1px solid var(--border); }
.prep-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.prep-item:last-child { margin-bottom: 0; }
.prep-num { width: 24px; height: 24px; background: var(--black); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.prep-txt { font-size: 14px; color: var(--black); line-height: 1.5; }

/* INPUTS */
.name-screen { padding-top: 16px; }
.ns-sub { font-size: 14px; color: var(--gray); text-align: center; margin-bottom: 24px; line-height: 1.5; }
.input-field { width: 100%; padding: 16px; border: 1.5px solid var(--border); border-radius: var(--r-sm); font-family: 'Inter', sans-serif; font-size: 15px; color: var(--black); outline: none; transition: all 0.2s ease; -webkit-appearance: none; box-shadow: 0 2px 4px rgba(0,0,0,0.01); }
.input-field:focus { border-color: var(--black); }
.input-field::placeholder { color: #CCCCCC; }
.input-label { font-size: 10px; font-weight: 700; color: var(--gray); letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 8px; display: block; }
.err-hint { font-size: 12px; color: #CC3333; margin-top: 8px; display: none; font-weight: 500; }
.err-hint.show { display: block; }

/* QUIZ OPTIONS */
.q-card { background: var(--white); border: 1px solid rgba(0,0,0,0.02); box-shadow: 0 5px 20px rgba(0,0,0,0.02); border-radius: var(--r); padding: var(--p-card) var(--p-card) calc(var(--p-card) * 0.8); margin-bottom: var(--gap-quiz); margin-top: 8px; flex-shrink: 0; }
.q-hint { font-size: 12.5px; color: var(--gray); line-height: 1.5; }
.opts { display: flex; flex-direction: column; gap: var(--gap-quiz); flex-grow: 1; overflow-y: auto; justify-content: flex-start; padding-bottom: 10px; }
.opt { display: flex; align-items: center; gap: 12px; padding: var(--p-opt) 18px; border: 1px solid rgba(0,0,0,0.03); box-shadow: 0 3px 10px rgba(0,0,0,0.02); border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; color: var(--black); line-height: 1.4; background: var(--white); transition: all 0.15s ease; font-weight: 500; flex-shrink: 0; }
.opt:active { transform: scale(0.99); }
.opt.sel { border-color: var(--black); background: var(--gray-light); }
.opt-dot { width: 20px; height: 20px; border: 2px solid #D0D0D0; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; background: var(--white); }
.opt.sel .opt-dot { border-color: var(--black); background: var(--black); }
.opt.sel .opt-dot::after { content: ''; width: 7px; height: 7px; background: white; border-radius: 50%; }

/* CONSENT */
.consent-screen { padding-top: 16px; }
.consent-row { display: flex; align-items: flex-start; gap: 14px; padding: 20px; background: var(--white); border-radius: var(--r); border: 1px solid var(--border); cursor: pointer; transition: all 0.2s ease; margin-bottom: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.consent-row.active { border-color: var(--black); background-color: var(--gray-light); }
.check-box { width: 24px; height: 24px; border: 2px solid #D0D0D0; border-radius: 6px; flex-shrink: 0; margin-top: 1px; background: var(--white); display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.consent-row.active .check-box { background: var(--black); border-color: var(--black); }
.check-mark { color: white; font-size: 13px; font-weight: 700; display: none; }
.consent-row.active .check-mark { display: block; }
.consent-txt { font-size: 13.5px; color: var(--black); line-height: 1.6; }
.consent-link { color: var(--gray); text-decoration: underline; cursor: pointer; }

/* LOADING */
.loading-full { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; background: #FFFFFF; text-align: center; padding: 30px; }
.loading-logo { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; margin-bottom: 24px; animation: premiumPulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes premiumPulse { 0% { transform: scale(0.95); opacity: 0.8; } 50% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(0.95); opacity: 0.8; } }
.loading-title { font-size: 22px; font-weight: 600; color: var(--black); margin-bottom: 10px; }

/* RESULTS (360 DEGREES) */
.result-top { text-align: center; padding: 24px 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.res-emoji { font-size: 48px; display: block; margin-bottom: 12px; }
.res-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray); background: var(--gray-light); padding: 5px 12px; border-radius: 20px; margin-bottom: 12px; }
.res-name { font-size: 28px; font-weight: 600; color: var(--black); margin-bottom: 12px; line-height: 1.1; }
.res-desc { font-size: 14.5px; color: #444; line-height: 1.6; }

.r-section { margin-bottom: 24px; }
.r-title { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--black); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.r-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); margin-bottom: 12px; }
.r-ul { list-style: none; padding: 0; margin: 0; }
.r-li { position: relative; padding-left: 16px; margin-bottom: 8px; font-size: 13.5px; line-height: 1.5; color: var(--black); }
.r-li::before { content: '•'; position: absolute; left: 0; color: var(--gray); font-size: 16px; line-height: 1; top: 1px; }
.r-li:last-child { margin-bottom: 0; }

.nutri-tag { display: inline-block; background: var(--gray-light); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; margin: 0 4px 6px 0; border: 1px solid var(--border); }
.fine-print { font-size: 11px; color: #AAAAAA; text-align: center; line-height: 1.5; margin-top: 10px; }

/* MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); z-index: 2000; display: none; align-items: flex-end; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-window { width: 100%; max-width: 480px; background: #FFFFFF; border-top-left-radius: var(--r); border-top-right-radius: var(--r); max-height: 90dvh; display: flex; flex-direction: column; animation: slideTop 0.3s cubic-bezier(0.23, 1, 0.32, 1) forwards; padding-bottom: calc(10px + var(--sb)); }
@keyframes slideTop { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header { padding: 20px 24px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--black); }
.modal-close { background: var(--gray-light); border: none; width: 30px; height: 30px; border-radius: 50%; font-size: 16px; font-weight: 600; color: var(--gray); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; font-size: 13px; color: #333333; line-height: 1.65; }
.modal-body b { color: var(--black); display: block; margin-top: 14px; margin-bottom: 4px; }
.modal-body b:first-child { margin-top: 0; }

/* Увеличенные отступы для кнопок в футере */
.bottom .btn + .btn {
  margin-top: 10px;
}

/* Чтобы кнопки не слипались */
.bottom {
  gap: 10px;
}

/* Стили для прогресс-бара на экране загрузки */
.progress-outer {
  width: 200px;
  height: 4px;
  background: var(--gray-light);
  border-radius: 2px;
  margin: 12px auto;
  overflow: hidden;
}
.progress-inner {
  height: 100%;
  background: var(--black);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.loading-hint {
  font-size: 13px;
  color: var(--gray);
  margin-top: 8px;
}

/* Увеличенные отступы для кнопок в футере */
.bottom .btn + .btn {
  margin-top: 10px;
}
.bottom {
  gap: 10px;
}

/* Toast уведомление */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  color: white;
  padding: 12px 24px;
  border-radius: var(--r-sm);
  font-size: 14px;
  z-index: 3000;
  opacity: 1;
  transition: opacity 0.3s;
}
.toast.fade-out {
  opacity: 0;
}

.retest-notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: #F9F5F0; border-left: 3px solid #C8A882;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 18px;
}
.retest-notice-icon { font-size: 18px; flex-shrink: 0; padding-top: 2px; }
.retest-notice-body { font-size: 13px; color: #444; line-height: 1.5; }
.retest-notice-body b { color: #111; }
.retest-notice-hint { display: block; margin-top: 4px; font-size: 12px; color: #888; font-style: italic; }

.retest-notice{display:flex;gap:10px;align-items:flex-start;background:#F9F5F0;border-left:3px solid #C8A882;border-radius:8px;padding:12px 14px;margin-bottom:18px;}
.retest-notice-icon{font-size:18px;flex-shrink:0;padding-top:2px;}
.retest-notice-body{font-size:13px;color:#444;line-height:1.5;}
.retest-notice-body b{color:#111;}
.retest-notice-hint{display:block;margin-top:4px;font-size:12px;color:#888;font-style:italic;}
