/* Canon Service Center — clean stack, mobile first */

:root {
  --color-canon-red: #cc0000;
  --color-canon-red-hover: #a30000;
  --color-cyan: #149dcc;
  --color-cyan-hover: #0d6786;
  --color-pink: #ff3366;
  --color-pink-hover: #e50039;
  --color-primary: #149dcc;
  --color-primary-hover: #0d6786;
  --color-dark: #232323;
  --color-header: #ffffff;
  --color-gray: #767676;
  --color-muted: #767676;
  --color-border: #e8e8e8;
  --color-bg: #ffffff;
  --color-bg-alt: #efefef;
  --color-white: #ffffff;
  --color-focus: #149dcc;
  --color-input: #f5f5f5;
  --color-footer: #2e2e2e;
  --color-overlay: rgba(20, 157, 204, 0.72);

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;

  --radius: 3px;
  --header-h: 80px;
  --container: 72rem;
  --shadow: 0 7px 20px rgba(0, 0, 0, 0.08);

  --font-sans: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3rem;
  --leading: 1.6;
}

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

html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 80px;
}

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--color-dark);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
summary:focus,
summary:focus-visible,
.btn:focus,
.btn:focus-visible,
.form-input:focus,
.form-checkbox:focus,
.nav__toggle:focus,
.nav__link:focus,
.nav__phone:focus {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -100%;
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-dark);
  color: var(--color-white);
}

.skip-link:focus {
  top: var(--space-md);
  color: var(--color-white);
}

/* Layout */

.section {
  padding: var(--space-2xl) var(--space-md);
}

.section__inner {
  max-width: var(--container);
  margin-inline: auto;
}

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

.section__title {
  font-size: var(--text-2xl);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.section__title--light {
  color: var(--color-white);
  text-align: center;
  width: 100%;
}

.section__lead {
  color: var(--color-gray);
  margin-bottom: var(--space-xl);
  max-width: 40rem;
}

#top {
  scroll-margin-top: 80px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 48px;
  min-width: 48px;
  padding: 1rem 3rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
  letter-spacing: 1px;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

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

.btn--primary {
  background: var(--color-pink);
  color: var(--color-white);
  border-color: var(--color-pink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn--primary:hover {
  background: var(--color-pink-hover);
  border-color: var(--color-pink-hover);
  color: var(--color-white);
}

.btn--ghost {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

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

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

.btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn__spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn__spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-sm) var(--space-md);
}

.header__logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-dark);
  min-height: 48px;
}

.header__logo:hover {
  color: var(--color-dark);
}

.header__logo-img {
  height: 3.2rem;
  width: auto;
  max-width: 10rem;
}

.header__logo-text {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-dark);
  line-height: 1.2;
}

.nav {
  position: relative;
}

.nav__toggle {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 0.85rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
}

.nav__toggle::-webkit-details-marker {
  display: none;
}

.nav__toggle-bar {
  display: block;
  height: 2px;
  background: var(--color-dark);
  border-radius: 1px;
}

.nav__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 16rem;
  padding: var(--space-md);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--space-sm);
  color: var(--color-dark);
  text-decoration: none;
  border-radius: var(--radius);
}

.nav__link:hover {
  background: var(--color-bg-alt);
  color: var(--color-cyan);
}

.nav__phone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.5rem 1.25rem;
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius);
}

.nav__phone:hover {
  background: var(--color-primary-hover);
  color: var(--color-white);
}

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  color: var(--color-white);
  min-height: calc(100vh - var(--header-h));
  padding: 5rem var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0d6786;
  background-image:
    linear-gradient(rgba(20, 157, 204, 0.72), rgba(20, 157, 204, 0.72)),
    url("../assets/img/canon-ofis.jpg");
  background-size: cover;
  background-position: center;
  text-align: center;
}

.hero__overlay {
  display: none;
}

.hero__inner {
  max-width: 56rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
}

.hero__lead {
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 300;
  max-width: 38rem;
  color: var(--color-white);
}

.hero__note {
  font-size: var(--text-lg);
  font-weight: 400;
}

.hero__actions {
  margin-top: 0.75rem;
}

/* Benefits */

.benefits {
  background: var(--color-white);
  padding-top: var(--space-2xl);
}

.benefits__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.benefit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  transition: all 0.2s ease;
}

.benefit-card:hover {
  transform: translateY(-4px);
}

.benefit-card__icon {
  display: flex;
  width: 5.5rem;
  height: 5.5rem;
  color: var(--color-cyan);
}

.benefit-card__icon svg {
  width: 100%;
  height: 100%;
}

.benefit-card__title {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-cyan);
}

.benefit-card__text {
  color: var(--color-gray);
  max-width: 18rem;
}

/* Services */

.services {
  background: #232323;
  background-image: linear-gradient(rgba(35, 35, 35, 0.82), rgba(35, 35, 35, 0.88));
}

.tabs__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: var(--space-xl);
}

.tabs__btn {
  min-height: 48px;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--color-white);
  background: transparent;
  color: var(--color-white);
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.tabs__btn:hover,
.tabs__btn[aria-selected="true"] {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
  color: var(--color-white);
}

.tabs__panel {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
  color: var(--color-white);
  font-size: var(--text-lg);
  font-weight: 300;
}

/* Process — B2B: смета → счёт/оплата → ремонт */

.process {
  background: var(--color-white);
}

.process__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: process-step;
}

.process-step {
  display: flex;
  min-width: 0;
  counter-increment: process-step;
}

.process-step__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  height: 100%;
  padding: var(--space-lg);
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  border: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.process-step__card:hover {
  border-color: var(--color-canon-red);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.process-step__card:active {
  transform: translateY(-1px);
}

.process-step__card:focus-within {
  border-color: var(--color-canon-red);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.25);
}

.process-step__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.process-step__num {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  border-radius: 50%;
  font-size: var(--text-sm);
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.process-step__num::before {
  content: counter(process-step);
}

.process-step__card:hover .process-step__num {
  transform: scale(1.06);
  background: var(--color-primary-hover);
}

.process-step__title {
  font-size: var(--text-lg);
  line-height: 1.3;
  padding-top: 0.25rem;
}

.process-step__text {
  color: var(--color-gray);
}

/* Form */

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

.request__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.request__map {
  width: 100%;
  min-height: 24rem;
  height: 24rem;
  background: #e9e5dc;
}

.request__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.request__form-wrap {
  min-width: 0;
}

.request-form {
  position: relative;
  max-width: none;
}

.request-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field--check {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-sm);
  margin: var(--space-lg) 0 var(--space-xs);
}

.form-field__label {
  font-weight: 600;
  font-size: var(--text-sm);
}

.form-field__label--check {
  font-weight: 400;
  color: var(--color-gray);
}

.form-field__required {
  color: var(--color-canon-red);
}

.form-field__hint {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.form-field__error {
  font-size: var(--text-sm);
  color: var(--color-canon-red);
}

.form-input {
  width: 100%;
  min-height: 3.5em;
  padding: 1.07em 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-input);
  color: #565656;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:hover {
  border-color: #bdbdbd;
}

.form-input:focus {
  border-color: var(--color-canon-red);
  outline: 3px solid rgba(204, 0, 0, 0.28);
  outline-offset: 2px;
  box-shadow: none;
  background: var(--color-white);
}

.form-input:user-invalid,
.form-input.is-invalid,
.request-form.is-validated .form-input:invalid {
  border-color: #cc0000;
}

.form-input:invalid {
  box-shadow: none;
}

.form-input--area {
  min-height: 7rem;
}

.form-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

.form-checkbox:focus {
  outline: 3px solid rgba(204, 0, 0, 0.28);
  outline-offset: 2px;
}

.form-checkbox.is-invalid {
  outline: 2px solid #cc0000;
  outline-offset: 2px;
}

.form-status {
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
}

.form-status.is-success {
  background: #e8f6ec;
  color: #14532d;
}

.form-status.is-error {
  background: #fde8e8;
  color: #7f1d1d;
}

/* Footer */

.footer {
  background: var(--color-footer);
  color: #e8e8e8;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
}

.footer__logo {
  display: inline-block;
  margin-bottom: var(--space-sm);
}

.footer__logo img {
  height: 3rem;
  width: auto;
  background: var(--color-white);
  padding: 0.35rem 0.5rem;
  border-radius: 2px;
}

.footer__link:hover {
  color: #b8e7f5;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  max-width: var(--container);
  margin-inline: auto;
}

.footer__brand {
  font-weight: 700;
  color: var(--color-white);
}

.footer__legal,
.footer__address {
  font-style: normal;
  color: #cfcfcf;
}

.footer__heading {
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-xs);
}

.footer__link {
  color: var(--color-white);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.footer__link:hover {
  color: #ffd6d6;
}

.footer__copy {
  max-width: var(--container);
  margin: var(--space-xl) auto 0;
  padding-top: var(--space-lg);
  border-top: 1px solid #333;
  font-size: var(--text-sm);
  color: #b0b0b0;
}

/* Tablet+ */

@media (min-width: 48rem) {
  :root {
    --text-2xl: 2rem;
    --text-3xl: 2.5rem;
  }

  .hero__title {
    font-size: var(--text-3xl);
  }

  .hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .request__layout {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

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

  .benefits__grid,
  .process__list {
    grid-template-columns: repeat(2, 1fr);
  }

  .request-form__grid {
    grid-template-columns: 1fr 1fr;
  }

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

/* Desktop: open nav inline */

@media (min-width: 64rem) {
  .benefits__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .process__list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }

  .nav {
    display: flex;
    align-items: center;
  }

  .nav__toggle {
    display: none;
  }

  .nav[open] .nav__panel,
  .nav .nav__panel {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .nav:not([open]) .nav__panel {
    display: flex;
  }

  .nav__list {
    flex-direction: row;
    gap: var(--space-xs);
    display: none;
  }
}

.legal-page {
  background: var(--color-white);
  color: var(--color-dark);
}

.legal {
  max-width: 48rem;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md) var(--space-3xl);
}

.legal h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: var(--space-lg);
  text-transform: uppercase;
}

.legal h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: var(--space-xl) 0 var(--space-sm);
}

.legal p,
.legal li {
  margin-bottom: var(--space-sm);
  text-align: justify;
}

.legal__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  color: var(--color-gray);
}

.legal ul {
  padding-left: 1.25rem;
  margin: 0 0 var(--space-md);
}

.legal a {
  color: var(--color-cyan);
}

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

  .btn,
  .service-card,
  .benefit-card,
  .tabs__btn {
    transition: none;
  }

  .service-card:hover,
  .benefit-card:hover {
    transform: none;
  }
}
