/* Homepage coupon popup — ported from a2b-coupon-popup.html.
   Variables are scoped to the overlay so they cannot clash with the homepage's own tokens. */

.a2b-overlay {
    --p-navy: #0b1d33;
    --p-red: #d3141f;
    --p-red-dark: #a80e17;
    --p-yellow: #f6c92b;
    --p-text: #0b1d33;
    --p-muted: #5f6f82;
    --p-field: #f3f6f9;
    --p-line: #e3e9ef;
    --p-green: #1ca55e;
    --p-radius: 18px;
    --p-radius-sm: 10px;
    --p-font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(6, 16, 29, .7);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    font-family: var(--p-font);
    animation: a2bFade .3s ease both;
}

.a2b-overlay[hidden] {
    display: none;
}

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

html.a2b-popup-open {
    overflow: hidden;
}

@keyframes a2bFade {
    from { opacity: 0 }
    to { opacity: 1 }
}

.a2b-popup {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 860px;
    margin: auto;
    border-radius: var(--p-radius);
    overflow: hidden;
    background: #fff;
    color: var(--p-text);
    font-family: var(--p-font);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    animation: a2bIn .4s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes a2bIn {
    from { opacity: 0; transform: translateY(14px) }
    to { opacity: 1; transform: none }
}

@media (prefers-reduced-motion: reduce) {
    .a2b-popup,
    .a2b-overlay {
        animation: none;
    }
}

.a2b-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--p-field);
    color: var(--p-navy);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s;
}

.a2b-close:hover {
    background: var(--p-line);
}

.a2b-close:focus-visible,
.a2b-btn:focus-visible,
.a2b-coupon-copy:focus-visible {
    outline: 3px solid var(--p-navy);
    outline-offset: 2px;
}

.a2b-preview-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 6;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--p-red);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* ===== visual (road photo) ===== */
.a2b-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 580px;
    padding: 30px 26px 26px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(6, 16, 29, .72) 0%, rgba(6, 16, 29, .18) 42%, rgba(6, 16, 29, .62) 100%),
        var(--a2b-bg, #06101d) center/cover no-repeat;
}

.b-offer {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    backdrop-filter: blur(6px);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.a2b-preview-tag + .a2b-visual .b-offer,
.a2b-popup.is-preview .b-offer {
    margin-top: 30px;
}

.b-offer svg {
    width: 18px;
    height: 18px;
}

/* badge */
.a2b-badge {
    position: relative;
    width: 100%;
    max-width: 330px;
    margin: 26px auto 0;
    transform: rotate(-3deg);
}

.b-save {
    position: relative;
    z-index: 3;
    width: 58%;
    margin: 0 0 -14px 14%;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--p-yellow);
    color: var(--p-navy);
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.1;
    transform: skewX(-8deg);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .28);
}

.b-save span {
    display: inline-block;
    transform: skewX(8deg);
}

.b-red {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    column-gap: 10px;
    padding: 24px 22px 12px;
    border-radius: 30px;
    background: linear-gradient(135deg, #e5202a, #9a0b14);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .38), inset 0 2px 0 rgba(255, 255, 255, .16);
}

.b-red strong {
    font-style: italic;
    font-weight: 900;
    font-size: 86px;
    line-height: .9;
    letter-spacing: -.04em;
    color: #fff;
}

.b-red .with {
    margin-top: 12px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.b-red em {
    grid-column: 1 / -1;
    margin-top: 6px;
    text-align: center;
    font-style: normal;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .08em;
}

.b-sale {
    position: relative;
    z-index: 1;
    width: 82%;
    margin: -8px 0 0 16%;
    padding: 11px 16px;
    border-radius: 24px;
    background: var(--p-yellow);
    color: var(--p-navy);
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .02em;
    box-shadow: 8px 8px 0 #b30f19;
}

/* car: fully inside the panel, never cropped */
.a2b-car {
    display: block;
    width: 92%;
    max-width: 100%;
    height: auto;
    margin: auto auto 0;
    padding-top: 18px;
    object-fit: contain;
    filter: drop-shadow(0 16px 14px rgba(0, 0, 0, .5));
}

/* ===== form ===== */
.a2b-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 40px 36px;
}

.a2b-form h2 {
    margin: 0;
    font-family: var(--p-font);
    font-size: 27px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--p-navy);
}

.a2b-form h2 b {
    color: var(--p-red);
    font-weight: 800;
}

.a2b-form > .a2b-lead,
.a2b-form .a2b-lead {
    margin: 10px 0 24px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--p-muted);
}

.a2b-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.a2b-field {
    display: flex;
    flex-direction: column;
}

.a2b-field.full {
    margin-bottom: 16px;
}

.a2b-field label {
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--p-navy);
}

.a2b-field input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    font: inherit;
    font-size: 15px;
    color: var(--p-text);
    background: #e9eef3;
    border: 1.5px solid transparent;
    border-radius: var(--p-radius-sm);
    outline: 0;
    transition: .2s;
}

.a2b-field input::placeholder {
    color: #9aa6b4;
}

.a2b-field input:focus {
    background: #fff;
    border-color: var(--p-navy);
    box-shadow: 0 0 0 4px rgba(11, 29, 51, .09);
}

.a2b-field input[aria-invalid="true"] {
    border-color: var(--p-red);
    background: #fff6f6;
}

.a2b-error {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: var(--p-radius-sm);
    background: #fff1f1;
    color: var(--p-red-dark);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
}

.a2b-error[hidden] {
    display: none;
}

.a2b-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--p-radius-sm);
    cursor: pointer;
    background: var(--p-red);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    transition: background .2s, transform .1s;
}

.a2b-btn:hover {
    background: var(--p-red-dark);
}

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

.a2b-btn[disabled] {
    opacity: .75;
    cursor: progress;
}

.a2b-btn .a2b-spin {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: a2bSpin .7s linear infinite;
}

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

.a2b-note {
    margin: 14px 0 0;
    text-align: center;
    font-size: 12px;
    color: #8a97a6;
}

.a2b-note a {
    color: var(--p-navy);
    text-decoration: underline;
}

/* ===== success ===== */
.a2b-success[hidden],
.a2b-form-view[hidden] {
    display: none;
}

.a2b-success {
    text-align: center;
}

.a2b-tick {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(28, 165, 94, .12);
    color: var(--p-green);
}

.a2b-tick svg {
    width: 28px;
    height: 28px;
}

.a2b-coupon {
    margin: 4px 0 20px;
    padding: 16px 18px;
    border: 2px dashed #c9d3df;
    border-radius: 14px;
    background: var(--p-field);
    text-align: center;
}

.a2b-coupon small {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--p-muted);
}

.a2b-coupon-code {
    display: block;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: .12em;
    color: var(--p-navy);
    word-break: break-all;
}

.a2b-coupon-copy {
    margin-top: 10px;
    padding: 7px 16px;
    border: 1.5px solid var(--p-navy);
    border-radius: 999px;
    background: transparent;
    color: var(--p-navy);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.a2b-coupon-copy:hover {
    background: var(--p-navy);
    color: #fff;
}

/* ===== responsive ===== */
@media (max-width: 800px) {
    .a2b-overlay { padding: 14px }
    .a2b-popup { grid-template-columns: 1fr; max-width: 430px }
    .a2b-visual { min-height: 0; padding: 22px 20px 18px }
    .a2b-badge { margin-top: 18px }
    .b-red strong { font-size: 72px }
    .a2b-car { width: 80%; padding-top: 14px }
    .a2b-form { padding: 26px 22px 24px }
    .a2b-form h2 { font-size: 22px }
    .a2b-close { background: rgba(255, 255, 255, .2); color: #fff }
    .a2b-coupon-code { font-size: 26px }
}

@media (max-width: 480px) {
    .a2b-row { grid-template-columns: 1fr; gap: 0 }
    .a2b-row .a2b-field { margin-bottom: 12px }
}
