/* StageUP Service: стилі клієнтського сайту.
   Значення взято з брендбуку (tokens.json). Верстка спершу під телефон, далі розширюється.
   Єдиний колір поза брендбуком: --error для помилок у формах. */

:root {
  --black: #000000;
  --carbon: #141414;
  --graphite: #2a2a2a;
  --white: #f8f8f8;
  --silver: #b0b0b0;
  --steel: #989898;
  --lime: #c8f800;
  --lime-deep: #a8f800;
  --on-lime: #000000;
  --error: #ff8a80;

  --font-display: "Exo 2", "Arial Narrow", sans-serif;
  --font-text: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --space-4: 4px;
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-40: 40px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-full: 999px;
  --slant: 15deg;

  --gutter: var(--space-24);
  --header-height: 64px;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-16));
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--black);
  color: var(--white);
  font: 400 16px/24px var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--lime);
}

p {
  margin: 0 0 var(--space-16);
}

[hidden] {
  display: none !important;
}

/* Видимий фокус для клавіатури на всіх інтерактивних елементах. */
:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  left: var(--space-16);
  top: -120px;
  z-index: 100;
  padding: 12px var(--space-16);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--black);
  font-weight: 700;
}

.skip-link:focus {
  top: var(--space-16);
  color: var(--black);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Сітка сторінки ---------- */

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.wrap--narrow {
  max-width: 720px;
}

.section {
  padding: var(--space-40) 0;
}

.section + .section {
  border-top: 1px solid var(--graphite);
}

/* ---------- Типографіка ---------- */

.display {
  margin: 0 0 var(--space-16);
  font: italic 800 clamp(34px, 9.5vw, 56px) / 1 var(--font-display);
}

.h1 {
  margin: 0 0 var(--space-24);
  font: italic 800 clamp(28px, 7.5vw, 36px) / 1.1 var(--font-display);
}

.h2 {
  margin: 0;
  font: italic 700 clamp(20px, 5.6vw, 24px) / 1.2 var(--font-display);
}

.price {
  font: italic 700 28px/1 var(--font-display);
  color: var(--lime);
  white-space: nowrap;
}

.small {
  font: 500 13px/18px var(--font-text);
}

.label {
  margin: 0 0 var(--space-4);
  font: 700 12px/16px var(--font-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
}

.lead {
  max-width: 60ch;
  font-size: 18px;
  line-height: 28px;
  color: var(--silver);
}

.muted {
  color: var(--silver);
}

.prose p {
  max-width: 65ch;
  color: var(--silver);
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-24);
  border: 1.5px solid var(--lime);
  border-radius: var(--radius-md);
  background: var(--lime);
  color: var(--on-lime);
  font: italic 700 16px/1.1 var(--font-display);
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:hover {
  background: var(--lime-deep);
  border-color: var(--lime-deep);
  color: var(--on-lime);
}

.btn:active {
  background: var(--lime-deep);
  border-color: var(--lime-deep);
}

.btn--quiet {
  background: none;
  border-color: var(--steel);
  color: var(--white);
}

.btn--quiet:hover {
  background: var(--carbon);
  border-color: var(--white);
  color: var(--white);
}

.btn--sm {
  min-height: 44px;
  padding: 0 var(--space-16);
  font-size: 14px;
}

.btn--wide {
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  background: var(--carbon);
  border-color: var(--carbon);
  color: var(--steel);
  cursor: default;
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--graphite);
  background: var(--black);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}

.brand img {
  display: block;
  width: auto;
  height: 46px;
}

.nav-desktop {
  display: none;
  gap: var(--space-24);
}

.nav-desktop a,
.site-footer__nav a {
  text-decoration: none;
  color: var(--silver);
}

.nav-desktop a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}

.nav-desktop a:hover,
.site-footer__nav a:hover {
  color: var(--white);
}

.nav-mobile summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--steel);
  border-radius: var(--radius-md);
  list-style: none;
  cursor: pointer;
}

.nav-mobile summary::-webkit-details-marker {
  display: none;
}

.burger,
.burger::before,
.burger::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
}

.burger {
  position: relative;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
}

.burger::before {
  top: -6px;
}

.burger::after {
  top: 6px;
}

.nav-mobile nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--space-8) max(var(--gutter), env(safe-area-inset-right)) var(--space-16) max(var(--gutter), env(safe-area-inset-left));
  border-bottom: 1px solid var(--graphite);
  background: var(--carbon);
}

.nav-mobile nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- Перший екран ---------- */

.hero {
  padding: var(--space-40) 0;
}

.stripes {
  display: flex;
  gap: var(--space-8);
  margin: 0 0 var(--space-24) var(--space-8);
  transform: skewX(calc(-1 * var(--slant)));
  transform-origin: left bottom;
}

.stripes i {
  display: block;
  width: var(--space-8);
  height: var(--space-40);
  background: var(--steel);
}

.stripes i:first-child {
  background: var(--lime);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  margin-top: var(--space-24);
}

.hero__actions .btn {
  flex: 1 1 220px;
}

/* ---------- Картки послуг ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-16);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-24);
  border-radius: var(--radius-md);
  background: var(--carbon);
}

.card .h2 {
  margin-bottom: var(--space-8);
}

.card .h2 a {
  text-decoration: none;
}

.card .h2 a:hover {
  text-decoration: underline;
}

.card__text {
  margin-bottom: var(--space-16);
}

.card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-8) var(--space-16);
  margin: auto 0 var(--space-16);
}

/* ---------- Як це працює, умови, питання, контакти ---------- */

.steps-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-24);
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps-list .h2 {
  margin-bottom: var(--space-8);
}

.steps-list p {
  margin: 0;
}

.steps-list__num {
  display: block;
  margin-bottom: var(--space-8);
  font: italic 800 36px/1 var(--font-display);
  color: var(--lime);
}

.terms {
  margin: 0;
  padding: 0;
  list-style: none;
}

.terms li {
  position: relative;
  max-width: 65ch;
  margin-bottom: var(--space-16);
  padding-left: var(--space-24);
  color: var(--silver);
}

.terms li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 4px;
  height: 16px;
  background: var(--lime);
  transform: skewX(calc(-1 * var(--slant)));
}

.faq details {
  border-bottom: 1px solid var(--graphite);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  min-height: 56px;
  padding: var(--space-8) 0;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font: 700 24px/1 var(--font-text);
  color: var(--lime);
}

.faq details[open] summary::after {
  content: "−";
}

.faq p {
  max-width: 65ch;
  padding-bottom: var(--space-8);
}

.contacts {
  display: grid;
  gap: var(--space-16);
  margin: var(--space-24) 0;
  padding: 0;
  list-style: none;
}

.contacts li {
  display: flex;
  flex-direction: column;
}

.contacts a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: italic 700 22px/1.2 var(--font-display);
  text-decoration: none;
}

/* ---------- Сторінка послуги ---------- */

.service-page__grid {
  display: grid;
  gap: var(--space-24);
}

.service-page__aside {
  gap: var(--space-8);
  align-self: start;
}

.service-page__aside .btn {
  margin-top: var(--space-8);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--silver);
  text-decoration: none;
}

/* ---------- Форма запису ---------- */

.form__step {
  min-width: 0;
  margin: 0 0 var(--space-40);
  padding: 0;
  border: 0;
}

.form__step legend {
  margin-bottom: var(--space-16);
  padding: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-bottom: var(--space-24);
}

.field label,
.field .field__label {
  font-weight: 700;
}

.field label .muted {
  font-weight: 400;
}

input[type="text"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1.5px solid var(--steel);
  border-radius: var(--radius-md);
  background: var(--carbon);
  color: var(--white);
  /* 16px і більше: інакше iPhone збільшує сторінку під час введення. */
  font: 400 16px/24px var(--font-text);
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--steel);
  opacity: 1;
}

input[type="file"] {
  max-width: 100%;
  font: 400 16px/24px var(--font-text);
  color: var(--silver);
}

input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: var(--space-16);
  padding: 0 var(--space-16);
  border: 1.5px solid var(--steel);
  border-radius: var(--radius-md);
  background: none;
  color: var(--white);
  font: 700 14px/1 var(--font-text);
  cursor: pointer;
}

[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  margin: 0;
  font-weight: 500;
  color: var(--error);
}

.field-error:empty {
  display: none;
}

.notice {
  padding: var(--space-16);
  border: 1.5px solid var(--steel);
  border-radius: var(--radius-md);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.options {
  display: grid;
  gap: var(--space-8);
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px var(--space-16);
  border: 1.5px solid var(--graphite);
  border-radius: var(--radius-md);
  background: var(--carbon);
  cursor: pointer;
}

.option input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--lime);
}

.option__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.option__title {
  font-weight: 700;
}

.option__price {
  flex: none;
  font: italic 700 18px/1 var(--font-display);
  white-space: nowrap;
}

.option.is-checked,
.option:has(input:checked) {
  border-color: var(--lime);
}

.option.is-checked .option__price,
.option:has(input:checked) .option__price {
  color: var(--lime);
}

.option:has(input:focus-visible) {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.calendar {
  margin-bottom: var(--space-24);
}

.calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.calendar__title {
  margin: 0;
  font: italic 700 20px/1.2 var(--font-display);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--steel);
  border-radius: var(--radius-md);
  background: none;
  color: var(--white);
  font: 700 24px/1 var(--font-text);
  cursor: pointer;
  touch-action: manipulation;
}

.icon-btn[disabled] {
  border-color: var(--graphite);
  color: var(--graphite);
  cursor: default;
}

.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar__weekdays {
  margin-bottom: 6px;
  font: 700 12px/16px var(--font-text);
  text-align: center;
  text-transform: uppercase;
  color: var(--steel);
}

.calendar__grid button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  aspect-ratio: 1;
  padding: 0;
  border: 1.5px solid var(--steel);
  border-radius: var(--radius-md);
  background: var(--carbon);
  color: var(--white);
  font: 700 16px/1 var(--font-text);
  cursor: pointer;
  touch-action: manipulation;
}

.calendar__grid button[disabled] {
  border-color: transparent;
  background: none;
  color: var(--steel);
  font-weight: 400;
  opacity: 0.55;
  cursor: default;
}

.calendar__grid button[aria-pressed="true"] {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--on-lime);
}

.calendar__grid button.is-today {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin: var(--space-8) 0 var(--space-16);
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 48px;
  padding: 0 var(--space-16);
  border: 1.5px solid var(--steel);
  border-radius: var(--radius-md);
  background: var(--carbon);
  font-weight: 700;
  cursor: pointer;
}

.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip.is-checked,
.chip:has(input:checked) {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--on-lime);
}

.chip:has(input:focus-visible) {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.photo-preview {
  display: block;
  max-width: 200px;
  border-radius: var(--radius-md);
}

.summary {
  margin-bottom: var(--space-16);
  padding: var(--space-16) var(--space-24);
  border-radius: var(--radius-md);
  background: var(--carbon);
}

.summary p:last-child {
  margin: 0;
}

.summary strong {
  color: var(--white);
}

.booking .btn--wide {
  margin-bottom: var(--space-16);
}

/* ---------- Статус заявки ---------- */

.status-card {
  margin: var(--space-24) 0;
}

.facts {
  display: grid;
  gap: var(--space-16);
  margin: 0;
}

.facts dt {
  font: 700 12px/16px var(--font-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
}

.facts dd {
  margin: var(--space-4) 0 0;
}

.status-card__actions {
  margin-top: var(--space-24);
}

.status-card__actions .btn {
  margin: 0 var(--space-8) var(--space-8) 0;
}

/* ---------- Підвал ---------- */

.site-footer {
  margin-top: var(--space-40);
  padding: var(--space-40) 0 calc(var(--space-40) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--graphite);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-24);
}

.site-footer__logo {
  display: block;
  width: 160px;
  margin: 0 0 var(--space-8) -4px;
}

.site-footer__nav {
  display: flex;
  flex-direction: column;
}

.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-footer__contacts p {
  margin-bottom: var(--space-8);
}

.site-footer__contacts a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

/* ---------- Вузькі телефони ---------- */

@media (max-width: 380px) {
  :root {
    --gutter: var(--space-16);
  }

  .card {
    padding: var(--space-16);
  }

  .site-header__bar {
    gap: var(--space-8);
  }

  .brand img {
    height: 40px;
  }

  .calendar__weekdays,
  .calendar__grid {
    gap: 4px;
  }
}

/* ---------- Планшети ---------- */

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding: 64px 0 56px;
  }

  .hero__actions .btn {
    flex: 0 0 auto;
  }

  .steps-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contacts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .btn--wide {
    width: auto;
    min-width: 280px;
  }

  .calendar {
    max-width: 440px;
  }
}

/* ---------- Компʼютери ---------- */

@media (min-width: 960px) {
  .brand img {
    height: 54px;
  }

  .nav-desktop {
    display: flex;
  }

  .nav-mobile {
    display: none;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section {
    padding: 64px 0;
  }

  .service-page__grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--space-40);
  }

  .service-page__aside {
    position: sticky;
    top: calc(var(--header-height) + var(--space-24));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Режим високого контрасту Windows: рамки й стани лишаються видимими. */
@media (forced-colors: active) {
  .btn,
  .option,
  .chip,
  .calendar__grid button {
    border: 2px solid ButtonText;
  }

  .calendar__grid button[aria-pressed="true"],
  .chip:has(input:checked) {
    outline: 3px solid Highlight;
  }
}

@media print {
  .site-header,
  .site-footer,
  .btn {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
