/* ============================================================
   PerfectRent — Базовая типографика, кнопки, поля, утилиты
   ============================================================ */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* ---------- Пропуск к контенту ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--r-md);
  font-weight: 600;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 16px;
}

/* ---------- Контейнер и секции ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.section {
  padding-block: clamp(64px, 9vw, 112px);
}

.section--tint {
  background: var(--bg-soft);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head__title {
  font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.6rem);
  margin-top: 14px;
}

.section-head__sub {
  margin-top: 14px;
  font-size: 1.075rem;
  color: var(--text-2);
  max-width: 60ch;
}

/* ---------- Кикер ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-text);
}
.kicker::before {
  content: '';
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
}

.text-accent {
  color: var(--accent);
}

.req {
  color: var(--danger);
}

/* ---------- Кнопки ---------- */
.btn {
  --btn-bg: var(--accent);
  --btn-color: var(--accent-contrast);
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--btn-border);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  --btn-bg: var(--card);
  --btn-color: var(--text);
  --btn-border: var(--border-2);
  box-shadow: var(--shadow-sm);
}
.btn--secondary:hover {
  border-color: var(--blue);
  color: var(--blue-text);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-color: var(--text-2);
  --btn-border: transparent;
}
.btn--ghost:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.btn--lg {
  padding: 15px 28px;
  font-size: 1rem;
  border-radius: var(--r-lg);
}
.btn--sm {
  padding: 9px 16px;
  font-size: 0.875rem;
}

.btn__icon {
  display: inline-flex;
  flex: none;
}

/* ---------- Ссылка-кнопка (для кнопок в тексте) ---------- */
.link-button {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: var(--blue-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover {
  color: var(--blue-hover);
}

/* ---------- Поля форм ---------- */
.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  appearance: none;
}
.input::placeholder {
  color: var(--text-3);
}
.input:hover,
.select:hover {
  border-color: var(--text-3);
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--ring);
}

.input--textarea {
  resize: vertical;
  min-height: 108px;
}

.select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b98a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.field__hint {
  font-weight: 400;
  color: var(--text-3);
  font-size: 0.8rem;
}

.field__error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: -2px;
}

.field.has-error .input,
.field.has-error .select {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

/* ---------- Бейджи ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}

.tag--demo {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}

.tag--accent {
  background: var(--blue-soft);
  color: var(--blue-text);
  border-color: transparent;
}

.tag--request {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}

/* ---------- Утилиты ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Появление секций при прокрутке */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
