:root {
    --bg: #F5F3F0;
    --card: #ffffff;
    --text: #34343D;
    --muted: #9C9C9C;
    --brand: #55BD89;
    --brand-dark: #4AA77A;
    --danger: #b91c1c;
    --line: #E7E6E5;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", "Noto Sans", sans-serif;
    background: #F5F3F0;
    color: var(--text);
}

.wrap {
    max-width: 375px;
    margin: 0 auto 40px;
    padding: 0 16px;
}

.brand-hero {
    position: relative;
    width: calc(100% + 32px);
    height: 100px;
    border-radius: 0;
    margin: 0 -16px 10px;
    overflow: hidden;
    background-color: #1f2937;
    background-size: cover;
    background-position: center;
}

.brand-hero.no-image {
    background-image:
        radial-gradient(circle at 15% 20%, rgba(45, 212, 191, 0.35) 0%, rgba(45, 212, 191, 0) 40%),
        radial-gradient(circle at 85% 80%, rgba(14, 165, 233, 0.28) 0%, rgba(14, 165, 233, 0) 45%),
        linear-gradient(135deg, #0f172a 0%, #134e4a 55%, #1d4ed8 100%);
}

.brand-hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
}

.brand-hero__content {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 12px 32px;
}

.brand-hero__title {
    color: #f8fafc;
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 29px;
    text-align: left;
    text-shadow: none;
}

h1 { margin: 0 0 8px; }
.subtitle { color: var(--muted); margin-bottom: 16px; }

.card {
    background: #FFFFFF;
    border: 0;
    border-radius: 0;
    padding: 20px 16px;
    margin-bottom: 0;
    border-top: 1px solid var(--line);
}

.card.card-first {
    margin-top: 17px;
    border-top: 0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0px 4px 7px rgba(103, 103, 103, 0.1);
}

.card.card-last {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    margin-bottom: 12px;
    box-shadow: 0px 4px 7px rgba(103, 103, 103, 0.1);
}

.card.card-first.card-last {
    border-radius: 20px;
}

.card h2 {
    color: #34343D;
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 24px;
    line-height: 29px;
    letter-spacing: -0.31px;
    margin: 0 0 14px;
}

.payment-summary-card {
    padding: 20px 16px;
}

.pay-summary-title {
    color: #34343D;
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 24px;
    line-height: 29px;
    letter-spacing: -0.31px;
    text-align: left;
}

.pay-summary-amount {
    color: #34343D;
    font-family: 'Cannonade Medium', 'Segoe UI', 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 24px;
    line-height: 29px;
    margin-top: 8px;
    letter-spacing: 0.3px;
    text-align: left;
}

.pay-summary-amount .rub {
    line-height: 9px;
    width: 0.4em;
    border-bottom: 2px solid #000;
    display: inline-block;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.row { display: flex; gap: 8px; flex-wrap: wrap; }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #34343D;
    font-family: 'Cannonade Medium', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 500;
}

input {
    height: 40px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
}

button {
    margin-top: 20px;
    border: 0;
    border-radius: 100px;
    padding: 16px 12px;
    width: 100%;
    cursor: pointer;
    background: var(--brand);
    color: white;
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 19px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}
button:hover { background: var(--brand-dark); }

.pay-btn {
    background: #55BD89;
    width: 100%;
}

.license-text {
    margin-top: 12px;
    color: #B8B8B8;
    font-family: 'Cannonade Medium', 'Segoe UI', 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    line-height: 120%;
    letter-spacing: -0.24px;
    text-align: justify;
}

.license-text-link {
    color: #55BD89;
    font-family: 'Cannonade Medium', 'Segoe UI', 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    line-height: 120%;
    letter-spacing: -0.24px;
}

.info {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #d1e3ff;
    background: #f0f6ff;
    border-radius: 8px;
}

.info.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--danger);
}

.status {
    position: sticky;
    bottom: 8px;
    background: #ecfeff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 10px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.status.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

.status.checking {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

.hidden { display: none; }
.muted { color: var(--muted); }

.coupon-list {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.coupon-item {
    border: 2px solid #48bd88;
    border-radius: 18px;
    padding: 10px 8px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: stretch;
    background: #FFFFFF;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.coupon-item:hover {
    box-shadow: 0 3px 12px rgba(73, 109, 90, 0.1);
}

.coupon-item:has(.coupon-checkbox:checked) {
    border-color: #48bd88;
    box-shadow: 0 0 0 3px rgba(85, 189, 137, 0.16);
}

.coupon-item.disabled {
    opacity: 0.6;
    background: #fafafa;
    cursor: not-allowed;
}

.coupon-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.coupon-left {
    width: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 24px;
}

.coupon-checkmark {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #66a74d;
    position: relative;
    background: #fff;
}

.coupon-checkmark::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -58%) rotate(45deg) scale(0);
    transition: transform 0.12s ease;
}

.coupon-checkbox:checked + .coupon-left .coupon-checkmark {
    border-color: #66a74d;
    background: #66a74d;
}

.coupon-checkbox:checked + .coupon-left .coupon-checkmark::after {
    transform: translate(-50%, -58%) rotate(45deg) scale(1);
}

.coupon-divider {
    width: 1px;
    align-self: stretch;
    background: #d8d8d8;
    flex: 0 0 1px;
}

.coupon-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.coupon-title {
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-size: 16px;
    line-height: 20px;
    color: #34343D;
    font-weight: 700;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coupon-meta {
    font-size: 10px;
    line-height: 13px;
    color: #8C8C8C;
    margin-top: 2px;
}

.coupon-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.coupon-row {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
    min-height: 52px;
}

.coupon-main-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 52px;
}

.coupon-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 56px;
    flex: 0 0 auto;
    min-height: 100%;
}

.coupon-description {
    font-size: 12px;
    line-height: 15px;
    color: #1f1f1f;
    margin-top: auto;
    padding-top: 6px;
    padding-bottom: 1px;
}

.coupon-discount-badge {
    flex: 0 0 auto;
    font-size: 14px;
    line-height: 16px;
    color: #000;
    background: #F8C61E;
    border-radius: 8px;
    padding: 6px 8px;
    white-space: nowrap;
    font-weight: 700;
}

.coupon-type-tag {
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-size: 12px;
    line-height: 14px;
    color: #000;
    font-weight: 700;
    text-align: right;
    margin-top: auto;
    padding-bottom: 1px;
}

.coupon-deny {
    margin-top: 2px;
    font-size: 13px;
    line-height: 16px;
    color: #B42318;
}

.buyer-card {
    padding: 20px 16px;
}

.buyer-line {
    color: #34343D;
    font-family: 'Cannonade Medium', 'Segoe UI', 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 0.3px;
    text-align: left;
}

.buyer-card .pay-summary-title {
    margin-bottom: 12px;
}

.buyer-line + .buyer-line {
    margin-top: 8px;
}

.pay-actions-card {
    border-top: 0;
    padding-top: 8px;
}

.pay-actions-card .pay-btn {
    margin-top: 8px;
}

.bonus-box {
    margin-top: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 12px;
}

.discount-card-box {
    margin-top: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 12px;
}

.actions-box {
    margin-top: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 12px;
}

.action-list .coupon-item {
    cursor: default;
}

.action-list .coupon-item:hover {
    box-shadow: none;
}

.action-list .coupon-left {
    width: 24px;
    flex: 0 0 24px;
}

.action-list .coupon-checkmark {
    width: 0;
    height: 0;
    border: 0;
    background: transparent;
}

.discount-card-title {
    color: #34343D;
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    margin-bottom: 12px;
}

.discount-card-value {
    color: #111111;
    font-family: 'Cannonade Medium', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 500;
    font-size: 22px;
    line-height: 28px;
}

.bonus-title {
    color: #34343D;
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    margin-bottom: 10px;
}

#couponSection .bonus-box .bonus-title {
    margin-bottom: 16px;
}

.bonus-balance {
    color: #111111;
    font-family: 'Cannonade Medium', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 28px;
    margin-bottom: 8px;
}

.bonus-cashback {
    color: #111111;
    font-family: 'Cannonade Medium', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 28px;
    margin-bottom: 10px;
}

.bonus-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}

.bonus-action {
    margin-top: 0;
    height: 48px;
    border-radius: 12px;
    font-family: 'Cannonade Medium', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 19px;
    letter-spacing: 0.3px;
}

.bonus-action-spend {
    background: #66A74D;
}

.bonus-action-collect {
    background: #FF5F3F;
}

.bonus-action.active {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.bonus-use-hint {
    color: #42A8D6;
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 24px;
}

.bonus-hidden-input {
    display: none;
}

#couponSection {
    padding-top: 10px;
}


.pay-discount-line {
    color: #55BD89;
    font-family: 'Cannonade Bold', 'Segoe UI', 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
    margin-bottom: 8px;
}

