/* Общи размери и четимост */
html, body {
  width: auto;
  overflow-x: visible;
}

html {
  scroll-padding-top: 160px;
}

:root {
  --gutter: clamp(16px, 3vw, 48px);
  --typeface: Verdana, Arial, Helvetica, sans-serif;
}

body, h1, h2, h3, h4, h5, .cm, .eyebrow, .btn,
nav, .logo-txt b, .logo-txt small, .navy-quote p {
  font-family: var(--typeface);
}

.wrap {
  width: min(calc(100% - 2 * var(--gutter)), 1440px);
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-head header {
  box-shadow: 0 4px 18px rgb(11 37 69 / 7%);
}

.mobile-nav, .mobile-lang {
  display: none;
}

.logo-mark--legacy {
  display: inline-block;
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background: url("../images/banner.jpg") -27px -2px / 374px auto no-repeat;
}

:where(a, button, input, textarea, summary):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.topbar :focus-visible, footer :focus-visible, .apply :focus-visible {
  outline-color: var(--amber);
}

.skip-link {
  position: fixed;
  z-index: 30;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: white;
  color: var(--navy);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.btn {
  min-height: 48px;
  height: auto;
  padding-block: 10px;
  justify-content: center;
  text-align: center;
}

.hero .wrap {
  grid-template-columns: minmax(0, 820px) minmax(0, 1fr);
}

.about .wrap, .apply .wrap, .two, .form-grid, .contact-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 96px);
}

.form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 440px);
  gap: clamp(24px, 3vw, 48px);
}

.sec-head {
  gap: 24px;
}

.contact .cbox, .contact-grid .citem, .f-top > *,
.doc, .sec-head > *, .dirs > *, .two > *, .form-grid > * {
  min-width: 0;
}

.contact, .contact-grid, footer, .topbar, .side, .tiles, .facts {
  overflow-wrap: anywhere;
}

.side {
  position: static;
  grid-template-columns: minmax(0, 1fr);
}

.side .row svg {
  flex: none;
}

.fact > div:last-child, .tile {
  min-width: 0;
}

.cta-strip .btn-primary {
  color: white;
  background: var(--blue);
  box-shadow: 0 10px 24px -10px rgb(31 95 174 / 70%);
}

.f-top ul a:hover, .f-bot a:hover, .topbar a:hover {
  text-decoration: underline;
}

/* Документите остават цели, с връзка към оригиналния скан */
.doc .paper {
  padding: 12px;
  display: grid;
  place-items: center;
  background: var(--paper);
}

.doc .paper img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.doc .cap {
  gap: 12px;
  color: var(--navy);
}

.table-scroll {
  overflow-x: auto;
}

.scope-table {
  min-width: 620px;
}

/* Действителни полета в безопасното локално превю */
.fld input.in, .fld textarea.in {
  display: block;
  width: 100%;
  min-width: 0;
  font: inherit;
  color: var(--ink);
}

.fld textarea.in {
  height: auto;
  min-height: 110px;
  padding-block: 12px;
  resize: vertical;
}

.fsubmit [disabled] {
  cursor: not-allowed;
  opacity: .74;
}

.preview-note {
  color: var(--muted);
  font-size: 15px;
}

.legal {
  padding-block: 56px;
}

.legal .wrap {
  max-width: 860px;
}

.legal h1, .legal h2, .legal p, .legal li {
  margin-block-end: 1em;
}

/* Подредба за лаптоп и таблет */
@media (max-width: 1440px) {
  .site-head nav { gap: clamp(14px, 2.35vw, 40px); }
  .hero .wrap { height: auto; min-height: 560px; padding-block: 70px; }
  .hero .wrap > :first-child { max-width: 760px; }
  .hero h1 { font-size: clamp(42px, 4.2vw, 64px); }
  .nb-card { right: 0; width: min(30vw, 400px); }
  .fact { padding-inline: clamp(14px, 2.4vw, 36px); }
}

@media (max-width: 1240px) {
  .site-head header .wrap { height: 80px; }
  .site-head header > .wrap > .btn { display: none; }
  .topbar .contacts { gap: 16px; }
  .topbar .contacts span:first-child { display: none; }
  .hero .wrap { display: block; min-height: 0; }
  .hero .wrap > :first-child { max-width: min(70%, 760px); }
  .nb-card { position: relative; inset: auto; width: min(100%, 400px); margin-top: 26px; }
  .dirs, .docs, .contact .wrap, .steps, .tiles { gap: 20px; }
  .f-top { gap: 28px; }
}

@media (max-width: 980px) {
  html { scroll-padding-top: 110px; }
  .topbar .contacts { display: none; }
  .topbar .wrap { height: 32px; font-size: 12px; }
  .site-head header .wrap { height: 64px; gap: 12px; }
  .site-head header > .wrap > nav { display: none; }
  .logo-mark--legacy { width: 40px; height: 40px; background-size: 252px auto; background-position: -18px -1px; }
  .site-head .logo { gap: 8px; }
  .site-head .logo-txt b { font-size: 16px; }
  .site-head .logo-txt small { font-size: 9px; letter-spacing: .12em; }
  .mobile-lang { display: flex; gap: 2px; margin-left: auto; }
  .mobile-lang a { display: grid; place-items: center; min-width: 33px; min-height: 44px; color: var(--navy); font-size: 12px; }
  .mobile-lang [aria-current] { color: var(--blue); font-weight: bold; text-decoration: underline; }
  .mobile-nav { display: block; }
  .mobile-nav summary { list-style: none; color: var(--navy); cursor: pointer; min-height: 44px; display: grid; place-items: center; padding-inline: 8px; font-size: 14px; }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav nav { position: absolute; top: 100%; inset-inline: 0; margin: 0; padding: 12px var(--gutter); display: grid; gap: 0; background: white; box-shadow: 0 10px 20px rgb(11 37 69 / 15%); max-height: calc(100dvh - 96px); overflow-y: auto; }
  .mobile-nav:not([open]) nav { display: none; }
  .mobile-nav nav a { padding: 12px 4px; min-height: 44px; }
  .mobile-nav nav a::after { display: none; }
  .hero .wrap > :first-child { max-width: 100%; }
  .hero-art { right: 0; opacity: .23; mask-image: linear-gradient(90deg, transparent 35%, black); }
  .sec-head { display: grid; align-items: start; gap: 12px; margin-bottom: 28px; }
  .facts .wrap, .tiles, .steps, .f-top, .contact .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact { border: 0; border-bottom: 1px solid var(--line); }
  .steps::before { display: none; }
  .about .wrap, .apply .wrap, .contact-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .apply .wrap { padding-block: 56px; }
  .nando { grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
  .nando > :last-child { grid-column: 1 / -1; justify-self: start; }
  .cta-strip .wrap, .f-bot { flex-wrap: wrap; gap: 18px; }
  .map { min-height: 280px; }
}

/* Една колона и големи контроли на телефон */
@media (max-width: 650px) {
  body { font-size: 16px; }
  .topbar .nb { display: block; font-size: clamp(10px, 2.8vw, 12px); }
  .topbar .nb svg { display: none; }
  .hero .wrap, .page-hero .wrap { padding-block: 32px; }
  .hero h1, .page-hero h1 { font-size: clamp(28px, 7vw, 42px); line-height: 1.16; }
  .hero p.lead, .page-hero p { font-size: 17px; }
  .hero .actions, .apply .actions, .cta-strip .actions { display: grid; gap: 12px; }
  .hero .actions, .apply .actions { margin-top: 24px; }
  .hero .art, .page-hero .art { opacity: .48; }
  .hero-art { right: -60px; top: auto; bottom: 0; width: 620px; height: 350px; opacity: .19; mask-image: linear-gradient(180deg, transparent, black); }
  .nb-card { padding: 14px; gap: 12px; }
  .sec { padding-block: 44px !important; }
  .sec-head h2, .about h2, .prose h2, .apply h2 { font-size: clamp(25px, 6.6vw, 36px); }
  .dirs, .two, .docs, .steps, .two-cards, .contact .wrap, .frow, .opts { grid-template-columns: minmax(0, 1fr); }
  .dir, .fcard, .card, .cbox, .need, .navy-quote, .citem, .link-card { padding: 20px; }
  .dir-top { align-items: flex-start; gap: 12px; }
  .dir h3, .card h3 { font-size: 22px; }
  .dir dl { grid-template-columns: minmax(0, 1fr); gap: 8px; font-size: 16px; }
  .dir dd { margin-bottom: 8px; }
  .fact { min-width: 0; padding: 14px 6px; gap: 8px; align-items: flex-start; }
  .fact strong, .fact b { font-size: 16px; }
  .fact svg { width: 25px; height: 25px; }
  .fact .ic { width: 38px; height: 38px; }
  .fact span { font-size: 14px; }
  .tile { padding: 18px 14px; }
  .side .card { padding: 20px; }
  .need ul { grid-template-columns: minmax(0, 1fr); }
  .nando { padding: 20px; grid-template-columns: minmax(0, 1fr); }
  .nando > :last-child { justify-self: stretch; }
  .fsubmit { align-items: stretch; flex-direction: column; gap: 12px; }
  .f-top { gap: 24px 16px; padding-block: 36px; }
  .f-top > :first-child, .f-top > :last-child { grid-column: 1 / -1; }
  .f-bot .r { flex-wrap: wrap; gap: 12px 20px; }
  .f-top ul a, .f-bot a { display: inline-flex; align-items: center; min-height: 44px; }
  .doc .paper { max-height: 445px; }
}

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