/* EV MANTRA - Welcome Offer | brand theme
   Palette taken from the logo: navy #243d78, blue #166eb5, sky #2caad8.
   Signature device: the three slanted "wing" stripes of the badge.
*/

:root {
    --navy: #243d78;
    --deep: #16264f;
    --blue: #166eb5;
    --sky: #2caad8;
    --mist: #eef3fa;
    --line: #d6e0ee;
    --ink: #14203f;
    --muted: #5b6988;
    --danger: #c4363b;
    --font: "Lexend", "Segoe UI", Arial, Helvetica, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    color: var(--ink);
    overflow-x: hidden;
    background: linear-gradient(
        174deg,
        var(--deep) 0 210px,
        var(--blue) 210px 222px,
        var(--sky) 222px 232px,
        var(--mist) 232px
    );
}

svg {
    display: block;
}

[hidden] {
    display: none !important;
}

.speedway,
.charge-flash,
.wing-line,
.full-charge,
.result-top,
.charge-tip,
.celebration {
    display: none !important;
}

/* Page */

.page,
.success-section {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 28px 16px 36px;
}

.success-section {
    display: none;
    flex-direction: column;
    align-items: center;
}

.success-section.show {
    display: flex;
}

/* Cards */

.offer-card,
.offer-result-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 2px 4px rgba(22, 38, 79, 0.08),
        0 22px 48px rgba(22, 38, 79, 0.22);
}

/* Header */

.brand {
    text-align: center;
    padding: 26px 24px 4px;
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 430px;
    height: auto;
    margin: 0 auto 6px;
}

.brand h1 {
    font-size: 21px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--navy);
}

.offer-pill {
    display: block;
    margin-top: 14px;
    padding: 11px 16px;
    border-radius: 8px;
    border-left: 5px solid var(--sky);
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: var(--navy);
}

/* Progress: four slanted segments */

.charge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 24px 0;
}

.charge-body {
    display: flex;
    gap: 5px;
    flex: 1;
}

.cell {
    flex: 1;
    height: 8px;
    background: var(--line);
    transform: skewX(-24deg);
    transition: background 0.3s;
}

.cell.on:nth-child(1) {
    background: var(--navy);
}

.cell.on:nth-child(2) {
    background: var(--blue);
}

.cell.on:nth-child(3) {
    background: var(--sky);
}

.cell.on:nth-child(4) {
    background: var(--blue);
}

.charge-text {
    min-width: 40px;
    text-align: right;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

/* Form */

#offerForm {
    padding: 20px 24px 0;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--navy);
}

.field label b {
    color: var(--blue);
    margin-left: -3px;
    font-weight: 600;
}

.ico {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.ico svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field input[type="text"],
.field input[type="tel"],
.field select {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    font: 500 16px var(--font);
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.field input::placeholder {
    color: #8f9bb5;
    font-weight: 400;
}

.field input:focus,
.field select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(22, 110, 181, 0.18);
}

.field.valid input,
.field.valid select {
    border-color: var(--navy);
}

.field.invalid input,
.field.invalid select {
    border-color: var(--danger);
}

.field.shake,
.terms.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(3px);
    }
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid var(--blue);
    border-bottom: 2px solid var(--blue);
    transform: rotate(45deg);
    pointer-events: none;
}

.field select {
    padding-right: 42px;
    cursor: pointer;
}

.field select:required:invalid {
    color: #8f9bb5;
    font-weight: 400;
}

.field select option {
    color: var(--ink);
}

/* =========================================
   CUSTOM RESPONSIVE DROPDOWN
========================================= */

.custom-select {
    position: relative;
    width: 100%;
    z-index: 20;
}

/* Main dropdown box */

.custom-select-btn {
    width: 100%;
    height: 50px;
    padding: 0 42px 0 15px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #8f9bb5;
    font: 500 16px var(--font);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    outline: none;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.custom-select-btn:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(22, 110, 181, 0.18);
}

/* Selected text */

.selected-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Arrow */

.select-arrow {
    position: absolute;
    right: 18px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--blue);
    border-bottom: 2px solid var(--blue);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    pointer-events: none;
}

/* Rotate arrow when open */

.custom-select.open .select-arrow {
    transform: rotate(225deg);
}

/* =========================================
   OPTIONS BOX
========================================= */

.custom-options {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    margin-top: 6px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(22, 38, 79, 0.16);
    overflow: hidden;
    display: none;
    z-index: 1000;
}

/* Show options */

.custom-select.open .custom-options {
    display: block;
}

/* =========================================
   EACH OPTION
========================================= */

.custom-options button {
    width: 100%;
    min-height: 46px;
    padding: 11px 15px;
    border: none;
    border-bottom: 1px solid #edf1f6;
    background: #fff;
    color: var(--ink);
    font: 500 15px var(--font);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Last option */

.custom-options button:last-child {
    border-bottom: none;
}

/* Hover */

.custom-options button:hover {
    background: var(--mist);
}

/* Touch */

.custom-options button:active {
    background: #e7f1fa;
}

/* =========================================
   SELECTED / VALID STATE
========================================= */

.field.valid .custom-select-btn .selected-text {
    color: var(--ink) !important;
    font-weight: 600 !important;
}

.field.valid .custom-select-btn {
    background: #e8f0fc !important;
    color: var(--ink) !important;
    border-color: var(--navy) !important;
}

.field.invalid .custom-select-btn {
    border-color: var(--danger);
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 520px) {

    .custom-select-btn {
        height: 50px;
        font-size: 15px;
    }

    .custom-options {
        max-height: none;
    }

    .custom-options button {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
    }
}

.msg {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--danger);
}

.msg:empty {
    display: none;
}

.msg:not(:empty) {
    margin-top: 6px;
}

.terms {
    margin: 2px 0 16px;
}

.terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--muted);
}

.terms-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.terms-label .box {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 1.5px solid #aab8d0;
    border-radius: 4px;
    display: grid;
    place-items: center;
    background: #fff;
}

.terms-label .box svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
}

.terms-label input:checked + .box {
    background: var(--navy);
    border-color: var(--navy);
}

.terms-label input:checked + .box svg {
    opacity: 1;
}

.terms-label input:focus-visible + .box {
    box-shadow: 0 0 0 3px rgba(22, 110, 181, 0.3);
}

.terms.invalid .box {
    border-color: var(--danger);
}

.terms-text a {
    color: var(--blue);
    font-weight: 500;
}

.form-alert {
    display: none;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #9c2227;
    background: #fdecec;
}

.form-alert.show {
    display: block;
}

.submit-btn {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: 600 16px var(--font);
    color: #fff;
    cursor: pointer;
    background: #9aa9c6;
    transition:
        background 0.25s,
        transform 0.12s;
}

.submit-btn.form-ready {
    background: var(--navy);
}

.submit-btn.form-ready:hover {
    background: var(--blue);
}

.submit-btn:active {
    transform: scale(0.985);
}

.submit-btn.loading {
    pointer-events: none;
    background: var(--blue);
}

.submit-btn:focus-visible,
.download-btn:focus-visible,
.back-btn:focus-visible,
.directions:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 2px;
}

.btn-bolt {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.privacy-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 0 22px;
    font-size: 12.5px;
    color: var(--muted);
}

.privacy-text svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Coupon (ticket) */

.offer-result-card {
    text-align: center;
    position: relative;
}

.result-head {
    padding: 26px 24px 2px;
}

.result-logo {
    display: block;
    width: 100%;
    max-width: 430px;
    height: auto;
    margin: 0 auto 10px;
}

.offer-result-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--navy);
}

.deal {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px 24px;
    text-align: left;
    color: #fff;
    background: linear-gradient(
        106deg,
        var(--navy) 0 80%,
        var(--blue) 80% 89%,
        var(--sky) 89% 100%
    );
}

.deal-amount {
    display: flex;
    align-items: baseline;
    gap: 3px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.deal-amount .rs {
    font-size: 30px;
}

.deal-amount #dealAmount {
    font-size: 64px;
    letter-spacing: -1px;
}

.deal-amount em {
    font-style: normal;
    font-size: 18px;
    font-weight: 500;
    margin-left: 6px;
}

.deal-text {
    flex: 1;
    min-width: 0;
    padding-right: 44px;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 300;
    color: #e3ebf8;
}

.deal-text strong {
    color: #fff;
    font-weight: 600;
}

.ticket-cut {
    position: relative;
    height: 0;
    border-top: 2px dashed var(--line);
}

.ticket-cut::before,
.ticket-cut::after {
    content: "";
    position: absolute;
    top: -13px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--mist);
}

.ticket-cut::before {
    left: -12px;
}

.ticket-cut::after {
    right: -12px;
}

.stub {
    padding: 22px 24px 22px;
}

.offer-code-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.offer-code {
    display: inline-block;
    max-width: 100%;
    padding: 13px 20px;
    margin-bottom: 18px;
    font-size: 29px;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
    color: var(--navy);
    background: var(--mist);
    border: 1.5px dashed var(--blue);
    border-radius: 8px;
}

.meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 16px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.meta-item {
    padding: 13px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.meta-item + .meta-item {
    border-left: 1px solid var(--line);
}

.meta-item span {
    font-size: 12px;
    color: var(--muted);
}

.meta-item strong {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--navy);
}

.profile {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.profile:empty {
    display: none;
}

.chip {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--navy);
    background: var(--mist);
}

.directions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 14px;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    text-decoration: none;
    color: var(--navy);
    border: 1.5px solid var(--navy);
}

.directions svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.offer-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.offer-footer svg {
    width: 14px;
    height: 14px;
    fill: var(--sky);
}

.result-actions {
    width: 100%;
    max-width: 460px;
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
}

.download-btn,
.back-btn {
    height: 52px;
    border-radius: 8px;
    font: 600 15px var(--font);
    cursor: pointer;
}

.download-btn {
    border: none;
    color: #fff;
    background: var(--navy);
}

.download-btn:hover {
    background: var(--blue);
}

.back-btn {
    color: var(--navy);
    background: #fff;
    border: 1.5px solid var(--line);
}

.download-btn:active,
.back-btn:active {
    transform: scale(0.98);
}

.download-btn:disabled {
    opacity: 0.7;
}

.download-mode,
.download-mode * {
    animation: none !important;
    transition: none !important;
}

.download-mode {
    box-shadow: none !important;
}

/* Terms modal */

.policy-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(22, 38, 79, 0.65);
}

.policy-modal.show {
    display: flex;
}

.policy-modal-content {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 84dvh;
    padding: 26px 22px 22px;
    overflow: hidden;
    background: #fff;
    border-radius: 14px;
    border-top: 6px solid var(--navy);
}

.policy-close {
    position: absolute;
    top: 14px;
    right: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    background: var(--navy);
}

.policy-scroll {
    max-height: calc(84dvh - 56px);
    overflow-y: auto;
    padding-right: 6px;
    font-size: 13.5px;
    line-height: 1.7;
    color: #44507a;
    -webkit-overflow-scrolling: touch;
}

.policy-scroll h2 {
    margin: 0 40px 14px 0;
    font-size: 19px;
    font-weight: 600;
    color: var(--navy);
}

.policy-scroll p {
    margin-bottom: 11px;
}

.policy-scroll strong {
    color: var(--navy);
    font-weight: 600;
}

.policy-section-title {
    margin-top: 24px !important;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

/* Mobile */

@media (max-width: 520px) {

    body {
        background: linear-gradient(
            174deg,
            var(--deep) 0 170px,
            var(--blue) 170px 180px,
            var(--sky) 180px 188px,
            var(--mist) 188px
        );
    }

    .page,
    .success-section {
        padding: 16px 12px 28px;
    }

    .offer-card,
    .offer-result-card,
    .result-actions {
        max-width: none;
    }

    .result-actions {
        grid-template-columns: 1fr;
    }

    .brand h1 {
        font-size: 19px;
    }

    .deal {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .deal-text {
        padding-right: 0;
    }

    .offer-code {
        font-size: 24px;
        padding: 12px 14px;
    }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

    * {
        animation: none !important;
        transition: none !important;
    }
}


/* =========================================
   SHOWROOM MESSAGE + LOCATION MAP
========================================= */

.showroom-section{
    display:flex;
    align-items:center;
    gap:12px;
    margin:20px 0 4px;
    padding:16px 12px;
    background:var(--mist);
    border-radius:10px;
}

.showroom-message{
    flex:1;
    min-width:0;
}

.showroom-title{
    font-size:13px;
    line-height:1.55;
    color:var(--ink);
    font-weight:400;
}

.showroom-title strong{
    color:var(--navy);
    font-weight:600;
}

.showroom-link{
    display:inline-block;
    margin-top:9px;
    color:var(--blue);
    font-size:12px;
    line-height:1.4;
    font-weight:600;
    text-decoration:none;
}

.showroom-link span{
    margin-left:3px;
    font-size:14px;
}

.location-route{
    flex:0 0 135px;
    width:135px;
    margin:0;
    padding:0;
    display:flex;
    justify-content:center;
}

.location-route svg{
    display:block;
    width:135px;
    height:auto;
}

/* Showroom + location section: brand navy / blue / sky design */
.showroom-section{
    padding:20px 34px 20px 18px;
    background:linear-gradient(106deg,
        var(--navy) 0 90%,
        var(--blue) 90% 95%,
        var(--sky) 95% 100%);
    border-radius:12px;
}
.showroom-title{ color:#e3ebf8; }
.showroom-title strong{ color:#fff; }
.showroom-link{ color:#8fd0f7; }
.location-route svg text{ fill:#fff; }
.location-route svg g path{ fill:var(--sky); }
.location-route svg g circle{ fill:var(--navy); }

/* Downloaded image only: sentence on top, map below, no "Tap to find" link */
.download-mode .showroom-section {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 22px 34px 18px 18px;
    text-align: center;
}

.download-mode .showroom-message {
    flex: none;
    width: 100%;
}

.download-mode .showroom-title {
    font-size: 15px;
}

.download-mode .showroom-link {
    display: none !important;
}

.download-mode .location-route {
    flex: none;
    width: 200px;
}

.download-mode .location-route svg {
    width: 200px;
}
/* Showroom text: left aligned so both lines start at the same left edge */
.showroom-message {
    text-align: left;
}

/* Downloaded image keeps the centered layout */
.download-mode .showroom-message {
    text-align: center;
}