:root {
    --primary: #4bb526;
    --primary-dark: #168829;
    --text-color: #1e2632;
    --accent-alert: #ff0000;
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    height: 100%;
    line-height: 1.42;
    font-family: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    color: var(--text-color);
}

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

ul {
    padding: 0;
    margin: 0;
}

ul li {
    padding: 0;
    list-style: none;
}

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

button {
    cursor: pointer;
    border: none;
    font-size: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
}

input[type="text"] input[type="tel"],
input[type="text"],
input[type="date"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea {
    font-size: 16px;
}

.container {
    max-width: 1200px;
    width: 95%;
    margin: 0 auto;
}

.wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main {
    flex: 1;
}

.radio {
    display: none;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

.error {
    display: none;
    color: var(--accent-alert);
}

.error.active {
    display: block;
    font-size: 13px;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.about-us-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: #fff;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.45);
    transition: background-color 0.15s ease;
}

.about-us-link:hover {
    background: rgba(255, 255, 255, 0.28);
}

.sbp-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    padding: 8px 12px;
    flex: 1;
    background: #1d1346;
    color: #fff;
}

.sbp-link .text {
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
}

.sbp-logo-pay {
    width: 40px;
    height: 40px;
}

.form.hidden {
    display: none;
}

.redirect-header-wrapper {
    display: none;
    margin-top: 32px;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.redirect-header-wrapper.active {
    display: flex;
}

.loader-overlay {
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    z-index: 9999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.loader-overlay.active {
    display: flex;
}

.lds-ellipsis {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.lds-ellipsis div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) {
    left: 8px;
    animation: lds-ellipsis1 0.6s infinite;
}
.lds-ellipsis div:nth-child(2) {
    left: 8px;
    animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(3) {
    left: 32px;
    animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(4) {
    left: 56px;
    animation: lds-ellipsis3 0.6s infinite;
}

@keyframes lds-ellipsis1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}
@keyframes lds-ellipsis3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}
@keyframes lds-ellipsis2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

.input-phone-wrapper {
    margin-bottom: 16px;
    flex-direction: column;
    display: none;
}

.input-phone-wrapper.active {
    display: flex;
}

/* ───────── Блок оплаты: две крупные кнопки-карточки (карта / СБП) ───────── */

.pay-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 2px 0 16px;
    text-align: left;
}

.pay-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.pay-option:active {
    transform: scale(0.99);
}

.pay-option:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.pay-option:disabled,
.pay-option.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

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

.pay-option__title {
    font-size: 15px;
    font-weight: 600;
}

.pay-option__amount {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.pay-option__hint {
    font-size: 13px;
    opacity: 0.8;
}

/* Карта — белая карточка с зелёной рамкой */
.pay-option--card {
    background: #fff;
    color: var(--text-color);
    border: 2px solid var(--primary);
    box-shadow: 0 2px 10px rgba(75, 181, 38, 0.12);
}

.pay-option--card:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(75, 181, 38, 0.25);
}

.pay-option__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eaf6e4;
    color: var(--primary-dark);
}

.pay-option__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    align-self: stretch;
    gap: 12px;
}

.pay-option__arrow {
    color: var(--primary-dark);
}

.pay-option__brands {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pay-option__brands img {
    height: 18px;
    width: auto;
}

/* СБП — тёмно-фиолетовая карточка */
.pay-option--sbp {
    background: linear-gradient(120deg, #2b1a5e 0%, #1d1346 70%);
    color: #fff;
    border: 2px solid transparent;
    box-shadow: 0 2px 12px rgba(29, 19, 70, 0.3);
}

.pay-option__sbp-logo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.pay-option__round-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: #1d1346;
}

/* Идёт создание платежа — у нажатой кнопки вместо стрелки крутится индикатор */
.pay-option.is-loading .pay-option__arrow,
.pay-option.is-loading .pay-option__round-arrow svg {
    visibility: hidden;
}

.pay-option.is-loading {
    opacity: 1;
    cursor: progress;
    position: relative;
}

.pay-option.is-loading::after {
    content: "";
    position: absolute;
    right: 28px;
    top: 50%;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    border-radius: 50%;
    border: 3px solid currentColor;
    border-right-color: transparent;
    animation: pay-spin 0.8s linear infinite;
}

.pay-option--sbp.is-loading::after {
    right: 29px;
    border-color: #1d1346;
    border-right-color: transparent;
}

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

@media (prefers-reduced-motion: reduce) {
    .pay-option.is-loading::after {
        animation-duration: 2.4s;
    }
}

.pay-error {
    display: none;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fdecec;
    color: #b42318;
    font-size: 14px;
}

.pay-error.active {
    display: block;
}

.pay-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f1f2f7;
    color: #4a5263;
}

.pay-note svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.pay-note p {
    font-size: 13px;
}

@media (max-width: 380px) {
    .pay-option {
        gap: 10px;
        padding: 10px 12px;
    }

    .pay-option__icon,
    .pay-option__sbp-logo {
        width: 40px;
        height: 40px;
    }

    .pay-option__amount {
        font-size: 20px;
    }
}

/* ───────── Страница оплаты: общий стиль карточек (тип шин, количество, галочки, кнопки оплаты) ───────── */

:root {
    --page-bg: #f4f8f1;
    --card-bg: #ffffff;
    --card-border: #e3eadf;
    --card-radius: 16px;
    --accent-soft: #eaf6e4;
    --text-muted: #6b7280;
    --shadow-soft: 0 2px 10px rgba(30, 38, 50, 0.05);
}

body {
    background: var(--page-bg);
}

.pay-page {
    max-width: 560px;
    margin: 0 auto;
    padding-bottom: 24px;
}

.pay-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.pay-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 2px;
}

.pay-place {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.pay-place svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--primary-dark);
}

.pay-place--muted {
    font-weight: 400;
    color: var(--text-muted);
}

.pay-place--muted svg {
    color: #9ca3af;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Тип шин */
.tire-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tire-type__card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 8px 12px;
    border-radius: 14px;
    border: 2px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tire-type__image {
    width: 32px;
    height: 24px;
    object-fit: contain;
    opacity: 0.6;
}

.tire-type__text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
}

.radio:checked ~ .tire-type__card {
    border-color: var(--primary);
    background: var(--accent-soft);
}

.radio:checked ~ .tire-type__card .tire-type__image {
    opacity: 1;
}

.radio:checked ~ .tire-type__card .tire-type__text {
    font-weight: 700;
    color: var(--text-color);
}

.radio:focus-visible ~ .tire-type__card {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Количество и итог */
.quantity-row {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 12px;
}

.quantity-card,
.total-card,
.checks-card {
    border-radius: var(--card-radius);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    padding: 0 14px;
}

.quantity-card {
    padding: 10px 12px;
}

.quantity-card__label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.quantity-card .controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.step-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 3px 8px rgba(22, 136, 41, 0.3);
    transition: transform 0.1s ease, opacity 0.15s ease;
}

.step-button:active {
    transform: scale(0.94);
}

.step-button:disabled {
    opacity: 0.35;
    box-shadow: none;
    cursor: not-allowed;
}

.step-button:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.quantity-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.quantity-value .quantity-input {
    width: 3ch;
    padding: 0;
    border: none;
    background: transparent;
    text-align: right;
    font: inherit;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}

.quantity-value .quantity-input::-webkit-outer-spin-button,
.quantity-value .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-unit {
    font-size: 17px;
    font-weight: 600;
}

.total-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 14px;
    background: var(--accent-soft);
    border-color: transparent;
    box-shadow: none;
}

.total-card__price {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.total-card__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
}

.total-card__sum {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
}

/* Галочки «Получить чек» / «Согласен с офертой» и поле для чека */
.checks-card {
    padding: 4px 16px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    cursor: pointer;
}

/* Разделитель между «Получить чек» (вместе с полем) и «Согласен с офертой» */
.checks-card #checkbox-wrapper {
    border-top: 1px solid var(--card-border);
}

.check-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.check-box {
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #c9d3c4;
    background: #fff;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check-row input:checked + .check-box {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.check-row input:checked + .check-box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.check-row input:focus-visible + .check-box {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.check-row__text {
    display: flex;
    flex-direction: column;
    font-size: 15px;
    font-weight: 500;
}

.check-row__text a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.check-row__hint {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
}

/* Поле для чека — раскрывается внутри карточки под «Получить чек» */
.checks-card .input-phone-wrapper {
    margin: 0 0 10px 34px;
    gap: 4px;
}

.checks-card .phone-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px solid var(--card-border);
    background: #fafcf9;
    color: var(--text-color);
    font: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.checks-card .phone-input::placeholder {
    color: #a3aab4;
}

.checks-card .phone-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(75, 181, 38, 0.15);
}

.checks-card .input-phone-wrapper:has(.error.active) .phone-input {
    border-color: #e5484d;
    box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.12);
}

.checks-card .error.active {
    font-size: 13px;
    color: #c4262b;
}

.checks-card .privacy-error.active {
    margin: -4px 0 10px 34px;
}

@media (max-width: 400px) {
    .pay-title {
        font-size: 22px;
    }

    /* «Количество» и «Итого» остаются в одной строке — так блок ниже */
    .quantity-row {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        gap: 8px;
    }

    .step-button {
        width: 38px;
        height: 38px;
    }

    .quantity-value .quantity-input {
        font-size: 22px;
    }

    .total-card__sum {
        font-size: 22px;
    }
}

/* ───────── Страница «О нас»: те же карточки, что на странице оплаты ───────── */

.about-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-page .pay-heading {
    margin-bottom: 8px;
}

.about-card {
    padding: 18px 20px;
    border-radius: var(--card-radius);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
}

.about-card--soft {
    background: var(--accent-soft);
    border-color: transparent;
    box-shadow: none;
}

.about-card__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.services-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    line-height: 1.4;
}

.services-check {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--primary-dark);
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.info-list-item dt {
    font-size: 13px;
    color: var(--text-muted);
}

.info-list-item dd {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ───────── Карточка результата оплаты (_ResultCard): страница оплаты, возврат из банка, ошибки ───────── */

.result-page {
    padding-top: 8px;
}

.redirect-header-wrapper.active {
    display: block;
    margin-top: 8px;
    /* Карточка остаётся видна поверх затемнения, пока ждём ответ банка */
    position: relative;
    z-index: 10000;
}

.result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 22px;
    border-radius: var(--card-radius);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.result-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    margin-bottom: 4px;
    border-radius: 50%;
}

.result-icon {
    display: none;
}

.result-card[data-state="success"] .result-card__icon {
    background: var(--accent-soft);
    color: var(--primary-dark);
}

.result-card[data-state="error"] .result-card__icon {
    background: #fdecec;
    color: #c4262b;
}

.result-card[data-state="pending"] .result-card__icon {
    background: #fff4e0;
    color: #b76e00;
}

.result-card[data-state="success"] .result-icon--success,
.result-card[data-state="error"] .result-icon--error,
.result-card[data-state="pending"] .result-icon--pending {
    display: block;
}

.result-card__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.result-card__title:empty {
    display: none;
}

.result-card__text {
    max-width: 40ch;
    font-size: 15px;
    color: var(--text-muted);
}

.result-card__action {
    margin-top: 10px;
}

.result-page__request {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Ожидание банка: светлое затемнение, зелёные точки снизу — не перекрывают карточку */
.loader-overlay {
    background: rgba(244, 248, 241, 0.75);
    justify-content: flex-end;
    padding-bottom: 18vh;
    box-sizing: border-box;
}

.lds-ellipsis div {
    background: var(--primary-dark);
}

/* ───────── Политика конфиденциальности: разделы — карточки ───────── */

.privacy-page {
    max-width: 760px;
}

.privacy-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.privacy-list-item {
    padding: 18px 20px;
    border-radius: var(--card-radius);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
}

.privacy-list-header {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
}

.privacy-list-text {
    font-size: 14px;
    line-height: 1.55;
    color: #374151;
}

.privacy-list-text + .privacy-list-text {
    margin-top: 6px;
}
