/* Legal Residence — People Beyond Borders */

:root {
  --navy-900: #0b1a33;
  --navy-800: #10233f;
  --navy-700: #16305a;
  --gold-500: #c9a15a;
  --gold-600: #a9822f;
  --gold-text: #7a5c1a; /* darker gold, meets WCAG AA (4.5:1+) for text on white/light backgrounds */
  --gold-grad: linear-gradient(135deg, #e7c77e 0%, #c9a15a 45%, #8a6a25 100%);
  --bg: #ffffff;
  --bg-alt: #f6f4ef;
  --text: #1c2431;
  --muted: #5b6472;
  --border: #e6e2d8;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 26, 51, 0.08);
  --container: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
:focus-visible { outline: 2px solid var(--gold-600); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: "Playfair Display", Georgia, "Times New Roman", serif; margin: 0 0 .5em; color: var(--navy-900); font-weight: 700; }
p { margin: 0 0 1em; color: var(--muted); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-text);
  font-weight: 700;
  margin-bottom: 14px;
}
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); }
.section-head p { font-size: 17px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--gold-grad); color: var(--navy-900); box-shadow: 0 8px 20px rgba(169,130,47,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(169,130,47,.45); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-outline-dark { background: transparent; border-color: var(--navy-900); color: var(--navy-900); }
.btn-outline-dark:hover { background: var(--navy-900); color: #fff; }
.btn-dark { background: var(--navy-900); color: #fff; }
.btn-dark:hover { background: var(--navy-700); }
.btn-block { width: 100%; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--border);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header { background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px); }
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 84px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 46px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: "Playfair Display", serif; font-size: 19px; color: var(--navy-900); letter-spacing: .02em; }
.brand-text span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { font-size: 15px; font-weight: 600; color: var(--navy-800); }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--gold-text); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; font-size: 13px; font-weight: 700; }
.lang-switch a { padding: 7px 13px; color: var(--muted); }
.lang-switch a.active { background: var(--navy-900); color: #fff; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; margin: -10px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy-900); margin: 5px 0; }

/* Hero */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(201,161,90,.22), transparent 60%),
    linear-gradient(160deg, rgba(9,20,40,.92) 15%, rgba(11,26,51,.95) 60%, rgba(11,26,51,.98) 100%),
    url('/assets/img/hero-budapest.jpg') center 30%/cover no-repeat;
  color: #fff;
  overflow: hidden;
}
@media (max-width: 760px) {
  .hero {
    background:
      radial-gradient(700px 400px at 80% -10%, rgba(201,161,90,.22), transparent 60%),
      linear-gradient(160deg, rgba(9,20,40,.92) 15%, rgba(11,26,51,.95) 60%, rgba(11,26,51,.98) 100%),
      url('/assets/img/hero-budapest-mobile.jpg') center 30%/cover no-repeat;
  }
}
.hero .container { padding-top: 96px; padding-bottom: 96px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.12; margin-bottom: 22px; }
.hero h1 em { font-style: normal; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: rgba(255,255,255,.78); font-size: 18px; max-width: 540px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-reassure { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; font-size: 13.5px; color: rgba(255,255,255,.62); }
.hero-reassure svg { flex-shrink: 0; color: var(--gold-500); }
.hero-badges { margin-top: 40px; display: flex; gap: 28px; flex-wrap: wrap; }
.hero-badges a { display: flex; flex-direction: column; cursor: pointer; transition: transform .15s ease; }
.hero-badges a:hover, .hero-badges a:focus-visible { transform: translateY(-2px); }
.hero-badges a:hover strong, .hero-badges a:focus-visible strong { color: var(--gold-500); }
.hero-badges strong { font-family: "Playfair Display", serif; font-size: 26px; color: #fff; transition: color .15s ease; }
.hero-badges span { font-size: 12.5px; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .08em; }

.hero-card {
  background: #fff;
  color: var(--text);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
}
.hero-card h3 { font-size: 20px; margin-bottom: 6px; }
.hero-card p.small { font-size: 14px; margin-bottom: 20px; }
.hero-card .form-row { margin-bottom: 12px; }

/* Forms */
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fbfaf7;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: 2px solid var(--gold-500); background: #fff; }
.form-consent { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; margin: 14px 0; }
.form-consent input { margin-top: 3px; }
.form-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }
.form-success { display: none; text-align: center; padding: 20px 0; }
.form-success.show { display: block; }
.form-success svg { margin: 0 auto 12px; }
.form-error { display: none; text-align: center; padding: 20px 0; }
.form-error.show { display: block; }
.form-error strong { color: #a3341f; }
.form-error a { color: var(--gold-text); text-decoration: underline; }

/* Trust */
.trust-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 44px; align-items: center; }
.trust-image { position: relative; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 5; }
.trust-image img { width: 100%; height: 100%; object-fit: cover; }
.trust-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(200deg, transparent 60%, rgba(11,26,51,.55)); }
.trust-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.trust-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow); }
.trust-card .icon { width: 42px; height: 42px; border-radius: 12px; background: var(--gold-grad); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.trust-card h3 { font-size: 17px; }
.trust-card p { font-size: 14px; margin: 0; }

/* Info banner (Резерв+ callout) */
.info-banner {
  display: flex; align-items: flex-start; gap: 16px;
  background: #fff8ea; border: 1px solid #f0d9a0; border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 40px;
}
.info-banner .icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px;
  background: var(--gold-grad); display: flex; align-items: center; justify-content: center;
}
.info-banner p { margin: 0; color: var(--navy-800); font-size: 15px; line-height: 1.55; }
.info-banner strong { color: var(--navy-900); }
.info-banner .hl { background: linear-gradient(180deg, transparent 62%, #ffe08a 62%); font-weight: 800; color: var(--navy-900); padding: 0 1px; }

/* Status badges on cards (Резерв+, coming-soon, etc.) */
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.badge-ok, .badge-note, .badge-soon {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 800; letter-spacing: .01em;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.badge-ok { background: #e6f6ec; color: #1a7a42; border: 1px solid #b9e6c7; }
.badge-note { background: #fdeee0; color: #a15a12; border: 1px solid #f3cfa4; }
.badge-soon { background: #eaf1f8; color: #2f5a86; border: 1px solid #c9dcee; }
.badge-row .tag, .badge-row .country-card-tag { margin-bottom: 0; }

/* Coming-soon card treatment */
.country-card.is-soon .photo { position: relative; }
.country-card.is-soon .photo img { filter: grayscale(35%); opacity: .82; }

/* Featured / recommended card treatment */
.country-card.is-featured { border-color: var(--gold-500); box-shadow: 0 0 0 2px var(--gold-500), var(--shadow); }
.country-card.is-featured .photo { position: relative; }
.country-card.is-featured .photo::after {
  content: "★ Рекомендуємо"; position: absolute; top: 14px; left: 14px;
  background: var(--gold-grad); color: var(--navy-900); font-size: 11.5px; font-weight: 800;
  letter-spacing: .02em; padding: 6px 12px; border-radius: 999px; box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.country-card.is-featured .photo[data-ribbon]::after { content: attr(data-ribbon); }


/* Process */
.process-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: start; }
.process-image { position: sticky; top: 110px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 3 / 4; }
.process-image img { width: 100%; height: 100%; object-fit: cover; }
.process-list { counter-reset: step; display: grid; gap: 0; }
.process-item { display: grid; grid-template-columns: 90px 1fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--border); }
.process-item:first-child { padding-top: 0; }
.process-item:last-child { border-bottom: none; }
.process-num { counter-increment: step; font-family: "Playfair Display", serif; font-size: 40px; color: var(--gold-600); position: relative; }
.process-num::after { content: counter(step, decimal-leading-zero); }
.process-item h3 { font-size: 20px; margin-bottom: 8px; }
.process-item p { margin: 0; font-size: 15px; }

/* Countries gallery */
.countries-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.country-card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.country-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(11,26,51,.14); }
.country-card .photo { aspect-ratio: 4 / 3; overflow: hidden; }
.country-card .photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.country-card:hover .photo img { transform: scale(1.06); }
.country-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.country-card .tag { align-self: flex-start; background: var(--bg-alt); color: var(--gold-text); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; margin-bottom: 10px; }
.country-card .body strong { display: block; font-family: "Playfair Display", serif; font-size: 19px; color: var(--navy-900); margin-bottom: 8px; }
.country-card .body p { font-size: 14px; color: var(--muted); margin: 0 0 16px; flex: 1; }
.country-card .cta { font-size: 13.5px; font-weight: 700; color: var(--gold-text); display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; }
.country-card .cta svg { transition: transform .2s ease; }
.country-card:hover .cta svg { transform: translateX(3px); }

/* Country detail modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(11,26,51,.6); backdrop-filter: blur(3px);
  padding: 24px; overflow-y: auto;
  align-items: flex-start; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: #fff; border-radius: 20px; max-width: 560px; width: 100%;
  margin: 40px auto; box-shadow: 0 30px 70px rgba(0,0,0,.35);
  position: relative; overflow: hidden;
  animation: modal-in .22s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(11,26,51,.55); color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(11,26,51,.8); }
.modal-photo { aspect-ratio: 16 / 9; overflow: hidden; }
.modal-photo img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: 26px 28px 30px; }
.modal-body h3 { font-size: 24px; margin-bottom: 14px; }
.modal-body ul { margin: 0 0 18px; padding-left: 20px; }
.modal-body li { font-size: 15px; color: var(--muted); margin-bottom: 9px; }
.modal-body .price-note { font-size: 13.5px; color: var(--gold-text); font-weight: 700; margin-bottom: 18px; }
.modal-body #modal-telegram { margin-top: 10px; }
body.modal-open { overflow: hidden; }
@media (max-width: 640px) {
  .modal-overlay { padding: 0; }
  .modal-card { margin: 0; border-radius: 0; min-height: 100%; }
}

/* FAQ */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; text-align: left; background: none; border: none; padding: 22px 0; font-size: 17px; font-weight: 700; color: var(--navy-900); display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-family: inherit; }
.faq-q .plus { font-size: 22px; color: var(--gold-text); transition: transform .2s ease; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-a p { padding-bottom: 20px; font-size: 15px; }

/* CTA band */
.cta-band {
  position: relative;
  background:
    linear-gradient(160deg, rgba(9,20,40,.93), rgba(11,26,51,.96)),
    url('/assets/img/cta-oldtown.jpg') center 35%/cover no-repeat;
  color: #fff; text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.75); max-width: 600px; margin: 0 auto 30px; }
@media (max-width: 760px) {
  .cta-band {
    background:
      linear-gradient(160deg, rgba(9,20,40,.93), rgba(11,26,51,.96)),
      url('/assets/img/cta-oldtown-mobile.jpg') center 35%/cover no-repeat;
  }
}

/* Contacts */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.contact-list { display: grid; gap: 16px; }
.contact-item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-item .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--gold-grad); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-item strong { display: block; font-size: 15px; color: var(--navy-900); }
.contact-item span { font-size: 13.5px; color: var(--muted); }

/* Footer */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 50px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 34px; }
.footer-grid h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--navy-900); margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer-grid a { font-size: 14px; color: var(--muted); }
.footer-grid a:hover, .footer-grid a:focus-visible { color: var(--gold-text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--muted); }

/* Sticky mobile CTA */
.mobile-cta { display: none; }

/* Responsive */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; }
  .trust-layout { grid-template-columns: 1fr; }
  .trust-image { aspect-ratio: 16 / 9; }
  .process-layout { grid-template-columns: 1fr; }
  .process-image { position: static; aspect-ratio: 16 / 9; }
  .countries-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .main-nav, .header-actions .lang-switch, .header-actions .btn-dark { display: none; }
  .nav-toggle { display: block; }
  .brand-text strong { font-size: 16px; }
  .brand img { height: 36px; }
  .section { padding: 60px 0; }
  .trust-grid, .countries-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .process-item { grid-template-columns: 50px 1fr; }
  .mobile-cta {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    padding: 12px 16px; background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(0,0,0,.08);
  }
  body { padding-bottom: 70px; }
}

.site-nav-mobile {
  display: none;
  position: fixed; inset: 84px 0 0 0; background: #fff; z-index: 49;
  padding: 24px 20px; overflow-y: auto;
}
.site-nav-mobile.open { display: block; }
.site-nav-mobile a { display: block; padding: 14px 0; font-size: 17px; font-weight: 700; border-bottom: 1px solid var(--border); }
