*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #16324f;
  --navy-dark: #0d1f33;
  --navy-tint: rgba(22, 50, 79, 0.06);
  --gold: #b8892b;
  --gold-light: #d8ac5c;
  --gold-soft: rgba(184, 137, 43, 0.14);
  --bg: #f7f8fa;
  --bg-alt: #eef1f5;
  --card: #ffffff;
  --text: #1c2530;
  --text-muted: #5b6673;
  --border: #dfe4ea;
  --shadow: 0 10px 30px rgba(13, 31, 51, 0.12);
  --font-head: "Fraunces", Georgia, serif;
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.65; overflow-x: hidden; }
img, iframe, video { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); }

/* Top bar */
.top-bar { background: var(--navy-dark); color: rgba(247,248,250,.85); font-size: 13px; padding: 9px 40px; display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; }
.top-bar a { color: var(--gold-light); font-weight: 700; }
.top-bar a:hover { color: #fff; }

/* Header */
.header { position: sticky; top: 0; z-index: 100; padding: 14px 40px; display: flex; align-items: center; justify-content: space-between; background: rgba(247,248,250,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); transition: box-shadow .3s ease; gap: 16px; }
.header.header-scrolled { box-shadow: 0 6px 22px rgba(13,31,51,.1); }
.header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--navy); white-space: nowrap; }
.header-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex-shrink: 0; background: var(--bg-alt); }
.main-nav { display: flex; align-items: center; gap: 30px; margin: 0 auto; }
.main-nav a { position: relative; font-size: 14px; font-weight: 600; color: var(--text); padding: 6px 0; }
.main-nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--gold); transition: width .25s ease; }
.main-nav a:hover { color: var(--navy); }
.main-nav a:hover::after { width: 100%; }
.btn-header-cta { background: var(--navy); color: #fff; font-size: 14px; font-weight: 700; padding: 11px 24px; border: 1.5px solid var(--navy); border-radius: 4px; cursor: pointer; transition: background .2s ease, transform .15s ease; white-space: nowrap; flex-shrink: 0; }
.btn-header-cta:hover { background: var(--navy-dark); transform: translateY(-1px); }

/* Hero */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 70px 40px; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; }
.hero-copy { flex: 1 1 460px; max-width: 560px; }
.hero-copy h1 { font-size: 40px; line-height: 1.2; color: var(--navy-dark); margin-bottom: 18px; }
.hero-sub { color: var(--text-muted); font-size: 17px; margin-bottom: 26px; }
.hero-note { margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.hero-figure { position: relative; flex: 1 1 320px; max-width: 460px; }
.hero-figure img { border-radius: 12px; box-shadow: var(--shadow); }
.hero-figure-badge { position: absolute; bottom: -18px; left: -18px; background: var(--card); border-radius: 10px; padding: 14px 18px; box-shadow: var(--shadow); text-align: center; }
.hero-figure-badge strong { display: block; color: var(--navy); font-size: 20px; }
.hero-figure-badge span { font-size: 12px; color: var(--text-muted); }

/* Buttons */
.btn-primary { background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; padding: 14px 28px; border: none; border-radius: 6px; cursor: pointer; transition: background .2s ease, transform .15s ease; position: relative; }
.btn-primary:hover { background: var(--navy-dark); transform: translateY(-1px); }
.btn-primary.gold { background: var(--gold); }
.btn-primary.gold:hover { background: #a1791f; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-secondary { background: transparent; border: 1.5px solid var(--border); color: var(--text); font-weight: 600; padding: 13px 22px; border-radius: 6px; cursor: pointer; }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
.loading-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; margin-left: 8px; vertical-align: -3px; animation: spin .7s linear infinite; }
.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .loading-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Services */
.services, .about, .faq, .contacts, .final-cta, .reviews-section { max-width: 1200px; margin: 0 auto; padding: 60px 40px; }
.services h2, .about h2, .faq h2, .contacts h2, .reviews-section h2 { text-align: center; color: var(--navy-dark); font-size: 30px; margin-bottom: 36px; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.service-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 26px; }
.service-icon { font-size: 28px; }
.service-card h3 { margin: 12px 0 8px; font-size: 18px; color: var(--navy-dark); }
.service-card p { color: var(--text-muted); font-size: 14px; }

/* About */
.about-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.about-feature { padding: 20px; background: var(--navy-tint); border-radius: 10px; }
.about-feature h3 { font-size: 16px; color: var(--navy-dark); margin-bottom: 6px; }
.about-feature p { font-size: 14px; color: var(--text-muted); }

/* Team & Documents */
.team-section, .documents-section { max-width: 1200px; margin: 0 auto; padding: 60px 40px; }
.team-section h2, .documents-section h2 { text-align: center; color: var(--navy-dark); font-size: 30px; margin-bottom: 10px; }
.section-sub { text-align: center; color: var(--text-muted); font-size: 15px; margin-bottom: 32px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.team-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-align: center; }
.team-card img { width: 100%; aspect-ratio: 280 / 320; object-fit: cover; display: block; background: var(--bg-alt); }
.team-name { font-weight: 700; font-size: 14px; color: var(--navy-dark); margin-top: 12px; }
.team-role { font-size: 12px; color: var(--text-muted); padding-bottom: 14px; }
.documents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.document-card { display: block; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.document-card img { width: 100%; aspect-ratio: 300 / 400; object-fit: cover; display: block; background: var(--bg-alt); transition: transform .2s ease; }
.document-card:hover img { transform: scale(1.03); }

/* Reviews carousel */
.reviews-carousel { position: relative; display: flex; align-items: center; gap: 12px; }
.reviews-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.reviews-track::-webkit-scrollbar { display: none; }
.review-card { flex: 0 0 300px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 22px; scroll-snap-align: start; }
.review-card p { font-size: 14px; color: var(--text); margin-bottom: 12px; }
.review-author { font-size: 13px; font-weight: 700; color: var(--navy); }
.carousel-arrow { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-size: 18px; color: var(--navy); }
.carousel-arrow:hover { background: var(--gold-soft); }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--navy-dark); }
.faq p { margin-top: 10px; color: var(--text-muted); font-size: 14px; }

/* Contacts */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.contact-block { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.contact-block h3 { color: var(--navy-dark); margin-bottom: 8px; }
.contact-block a { color: var(--navy); font-weight: 700; }

/* Final CTA */
.final-cta { text-align: center; background: var(--navy); border-radius: 16px; color: #fff; padding: 60px 40px; }
.final-cta h2 { color: #fff; margin-bottom: 22px; }

/* Footer */
.footer { text-align: center; padding: 30px 40px; font-size: 12px; color: var(--text-muted); }
.footer .privacy-link { display: inline-block; margin-top: 8px; color: var(--navy); text-decoration: underline; }

/* Privacy modal */
.privacy-overlay { position: fixed; inset: 0; background: rgba(13,31,51,.6); display: none; align-items: center; justify-content: center; z-index: 300; padding: 20px; }
.privacy-overlay.active { display: flex; }
.privacy-modal { background: var(--card); border-radius: 12px; padding: 30px; max-width: 480px; position: relative; }
.privacy-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); }
.privacy-modal h3 { color: var(--navy-dark); margin-bottom: 14px; }
.privacy-modal p { font-size: 14px; color: var(--text-muted); }

/* Quiz overlay */
.quiz-overlay { position: fixed; inset: 0; background: rgba(13,31,51,.72); display: none; align-items: center; justify-content: center; z-index: 400; padding: 20px; }
.quiz-overlay.active { display: flex; }
.quiz-modal { background: var(--card); border-radius: 16px; padding: 34px; width: 100%; max-width: 520px; box-shadow: var(--shadow); }
.quiz-progress { margin-bottom: 22px; }
.quiz-progress span { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.quiz-progress-bar { height: 6px; background: var(--bg-alt); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.quiz-progress-fill { height: 100%; width: 0%; background: var(--gold); transition: width .3s ease; }
.quiz-question { font-size: 20px; color: var(--navy-dark); margin-bottom: 18px; }
.quiz-content { min-height: 160px; margin-bottom: 22px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.quiz-option:hover { border-color: var(--gold-light); }
.quiz-option.selected { border-color: var(--gold); background: var(--gold-soft); }
.quiz-option-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex: 0 0 auto; }
.quiz-option.selected .quiz-option-radio { border-color: var(--gold); background: var(--gold); }
.quiz-option span { font-size: 14px; }
.quiz-input, .quiz-textarea { width: 100%; padding: 13px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; }
.quiz-input:focus, .quiz-textarea:focus { outline: none; border-color: var(--gold); }
.quiz-optional-note, .quiz-privacy-note, .quiz-textarea-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.quiz-consent { display: flex; gap: 10px; font-size: 12px; color: var(--text-muted); margin-top: 14px; align-items: flex-start; }
.quiz-consent a { text-decoration: underline; color: var(--navy); }
.quiz-char-count { text-align: right; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; }

/* Sticky bottom CTA (mobile + desktop, toggled by JS) */
.sticky-cta-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 250;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 28px rgba(13,31,51,.14);
  transform: translateY(120%);
  transition: transform .32s ease;
}
.sticky-cta-bar.visible { transform: translateY(0); }
.sticky-cta-bar .btn-primary { width: 100%; max-width: 520px; margin: 0 auto; display: block; }
body.sticky-cta-active { padding-bottom: 78px; }

@media (max-width: 640px) {
  .top-bar, .services, .about, .faq, .contacts, .final-cta, .reviews-section, .team-section, .documents-section { padding-left: 20px; padding-right: 20px; }
  .header { padding-left: 20px; padding-right: 20px; }
  .main-nav, .btn-header-cta { display: none; }
  .header-photo { width: 30px; height: 30px; }

  /* Фото сразу под шапкой, во всю ширину, бейдж поверх снизу — как в референсе */
  .hero { flex-direction: column; padding: 0 0 36px; gap: 0; }
  .hero-figure { order: -1; flex: none; width: 100%; max-width: none; margin: 0; }
  .hero-figure img { width: 100%; height: 300px; object-fit: cover; border-radius: 0; display: block; }
  .hero-figure-badge { position: absolute; left: 16px; right: 16px; bottom: 16px; text-align: left; }
  .hero-copy { padding: 26px 20px 0; max-width: none; }
  .hero-copy h1 { font-size: 28px; }
}
