/* ==========================================================================
   DoorLock.kz — mobile-first styles
   ========================================================================== */

:root {
  --color-navy: #0b2545;
  --color-navy-2: #13315c;
  --color-blue: #1d5bbf;
  --color-blue-light: #e8f0fc;
  --color-accent: #f5a524;
  --color-accent-dark: #d98b0b;
  --color-whatsapp: #25d366;
  --color-whatsapp-dark: #1da851;
  --color-text: #1b2533;
  --color-muted: #5b6778;
  --color-bg: #ffffff;
  --color-bg-alt: #f3f6fb;
  --color-border: #dde4ee;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(11, 37, 69, 0.08);
  --container: 1120px;
  --header-h: 64px;
  --callbar-h: 72px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  padding-bottom: var(--callbar-h);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0.75em 1.25em;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.btn:active {
  transform: translateY(1px);
}

.btn--lg {
  min-height: 56px;
  font-size: 1.0625rem;
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-navy);
}

.btn--accent:hover {
  background: var(--color-accent-dark);
}

.btn--whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
}

.btn--whatsapp:hover {
  background: var(--color-whatsapp-dark);
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-navy);
  color: #fff;
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  text-decoration: none;
  margin-right: auto;
}

.logo b {
  color: var(--color-accent);
}

.logo__icon {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
}

.nav-toggle {
  display: inline-flex;
  padding: 8px;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
}

.nav-toggle .icon {
  width: 28px;
  height: 28px;
}

.nav {
  display: none;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  flex-direction: column;
  background: var(--color-navy-2);
  padding: 8px 16px 16px;
}

.nav.is-open {
  display: flex;
}

.nav a {
  padding: 12px 0;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav a:hover {
  color: var(--color-accent);
}

.header__phone {
  display: none;
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(29, 91, 191, 0.55), transparent 55%),
    linear-gradient(160deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  color: #fff;
  padding: 48px 0 56px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  font-weight: 600;
}

.hero__badge .icon {
  color: var(--color-accent);
}

.hero__title {
  font-size: clamp(1.75rem, 6vw, 3rem);
  margin-top: 16px;
  max-width: 18em;
}

.hero__subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 34em;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 28px 0 32px;
}

.hero__facts {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero__facts li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
}

.hero__facts .icon {
  color: var(--color-accent);
}

/* ---------- Sections ---------- */

.section {
  padding: 56px 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section--dark {
  background: var(--color-navy);
  color: #fff;
}

.section__title {
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  color: var(--color-navy);
}

.section--dark .section__title {
  color: #fff;
}

.section__lead {
  color: rgba(255, 255, 255, 0.85);
  max-width: 40em;
}

.section__note {
  color: var(--color-muted);
  font-size: 0.9375rem;
  margin-top: 16px;
}

/* ---------- Services ---------- */

.services {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.card {
  padding: 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card__icon {
  display: inline-flex;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--color-blue-light);
  color: var(--color-blue);
}

.card__icon .icon {
  width: 28px;
  height: 28px;
}

.card__title {
  font-size: 1.1875rem;
  color: var(--color-navy);
}

.card p {
  margin: 0;
  color: var(--color-muted);
}

/* ---------- About ---------- */

.about {
  display: grid;
  gap: 32px;
  align-items: center;
}

.about__visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  max-width: 280px;
  width: 100%;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--color-blue), var(--color-navy));
  color: #fff;
  box-shadow: var(--shadow);
}

.about__visual .icon {
  position: absolute;
  inset: 18%;
  width: 64%;
  height: 64%;
  opacity: 0.12;
}

.about__years {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-accent);
}

.about__years-label {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.about__text p {
  font-size: 1.0625rem;
}

/* ---------- Prices (draft) ---------- */

.price-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.price-list__item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.price-list__item + .price-list__item {
  border-top: 1px solid var(--color-border);
}

.price-list__value {
  font-weight: 700;
  color: var(--color-blue);
  white-space: nowrap;
}

/* ---------- Reviews (draft) ---------- */

.reviews {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.review {
  margin: 0;
  padding: 24px;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.review__stars {
  display: flex;
  gap: 2px;
  color: var(--color-accent);
}

.review__text {
  margin: 12px 0;
}

.review__author {
  color: var(--color-muted);
  font-size: 0.9375rem;
  font-weight: 600;
}

.review__stars .icon.is-empty {
  color: var(--color-border);
}

.review__text {
  white-space: pre-line;
}

.reviews:empty {
  display: none;
}

.reviews__empty {
  color: var(--color-muted);
  margin: 16px 0 0;
}

/* ---------- Review form ---------- */

.review-form-wrap {
  margin-top: 32px;
}

.review-form-wrap > summary {
  list-style: none;
}

.review-form-wrap > summary::-webkit-details-marker {
  display: none;
}

.review-form-wrap[open] > summary {
  display: none;
}

.review-form {
  display: grid;
  gap: 16px;
  max-width: 560px;
  padding: 24px;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field__label {
  padding: 0;
  font-weight: 600;
  color: var(--color-navy);
}

.field__input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: inherit;
  background: var(--color-bg);
}

.field__input:focus {
  border-color: var(--color-blue);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-blue-light);
}

textarea.field__input {
  resize: vertical;
  min-height: 120px;
}

/* Stars are in reverse DOM order (5..1) so "~" can highlight lower ratings */
.rating-input__stars {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}

.rating-input__stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-input__stars label {
  cursor: pointer;
  color: var(--color-border);
  transition: color 0.15s;
}

.rating-input__stars .icon {
  width: 36px;
  height: 36px;
}

.rating-input__stars label:hover,
.rating-input__stars label:hover ~ label,
.rating-input__stars input:checked ~ label {
  color: var(--color-accent);
}

.rating-input__stars input:focus-visible + label {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.form-status {
  margin: 0;
  font-weight: 600;
}

.form-status:empty {
  display: none;
}

.form-status[data-type="success"] {
  color: #1a7f45;
}

.form-status[data-type="error"] {
  color: #c62828;
}

.review-form .section__note {
  margin: 0;
}

.btn--primary {
  background: var(--color-blue);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-navy-2);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

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

/* ---------- Contacts ---------- */

.contacts {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.contact {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s;
}

a.contact:hover {
  background: rgba(255, 255, 255, 0.12);
}

.contact .icon {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
}

.contact small,
.contact em {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  font-style: normal;
  color: rgba(255, 255, 255, 0.7);
}

.contacts__area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.85);
}

.contacts__area .icon {
  color: var(--color-accent);
}

/* ---------- Footer ---------- */

.footer {
  padding: 24px 0;
  background: #071a33;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer a {
  text-decoration: none;
  color: #fff;
}

/* ---------- Mobile call bar ---------- */

.callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -4px 20px rgba(11, 37, 69, 0.12);
}

/* ==========================================================================
   Tablet
   ========================================================================== */

@media (min-width: 600px) {
  .hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

/* ==========================================================================
   Desktop
   ========================================================================== */

@media (min-width: 960px) {
  :root {
    --header-h: 72px;
  }

  body {
    padding-bottom: 0;
  }

  .callbar,
  .nav-toggle {
    display: none;
  }

  .logo {
    margin-right: 0;
  }

  .nav,
  .nav.is-open {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 28px;
    margin: 0 auto;
    padding: 0;
    background: none;
  }

  .nav a {
    padding: 0;
    border: 0;
  }

  .header__phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-decoration: none;
  }

  .header__phone .icon {
    color: var(--color-accent);
  }

  .hero {
    padding: 96px 0 104px;
  }

  .hero__facts {
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 32px;
  }

  .section {
    padding: 88px 0;
  }

  .services {
    grid-template-columns: repeat(4, 1fr);
  }

  .about {
    grid-template-columns: 1fr 1.4fr;
    gap: 64px;
  }

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

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

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

  * {
    transition: none !important;
  }
}

.page-404 {
  padding-bottom: 0;
}
