:root {
    --bg: #f6f6f6;
    --phone: #cfd4dc;
    --card: #ffffff;
    --text: #191923;
    --muted: #7f8087;
    --line: #e1e1e5;
    --accent: #ff2758;
    --accent-hover: #ef1f4d;
    --success: #20d6a0;
    --shadow: 0 14px 42px rgba(20, 24, 32, .08);
    --radius: 12px;
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-x: hidden;
}

button,
input,
a {
    font: inherit;
}

button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.page {
    width: min(100%, 480px);
    min-height: 100vh;
    padding: 22px 18px 36px;
}

.lead-card {
    position: relative;
    height: calc(100vh - 112px);
    height: calc(100dvh - 112px);
    min-height: 680px;
    max-height: 900px;
    max-width: 430px;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 13px;
    border: 1px solid rgba(210, 213, 218, .9);
    background: var(--phone);
    box-shadow: var(--shadow);
}

.lead-card::after {
    content: "";
    position: absolute;
    top: 12px;
    right: -20px;
    width: 74px;
    height: 38px;
    border-radius: 19px;
    background: #818690;
    z-index: 1;
}

.stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 64px 20px 30px;
    scrollbar-width: none;
}

.stage::-webkit-scrollbar {
    display: none;
}

.slide {
    display: none;
}

.slide.is-active {
    display: block;
}

.brand-card,
.form-card,
.thanks-box {
    position: relative;
    z-index: 2;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}

.brand-card {
    margin-bottom: 24px;
    padding: 60px 18px 28px;
    text-align: center;
}

.brand-avatar {
    position: absolute;
    left: 50%;
    top: -50px;
    width: 100px;
    height: 100px;
    transform: translateX(-50%);
    border-radius: 999px;
    object-fit: cover;
    background: #000;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
}

.brand-card h1 {
    margin: 4px 0 10px;
    font-size: 23px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand-card p {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    color: #565760;
}

.form-card {
    padding: 36px 20px 28px;
}

.form-title {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 28px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
}

.info-dot {
    width: 16px;
    height: 16px;
    border: 1px solid #b7bac2;
    border-radius: 50%;
    color: #8d9098;
    font-size: 11px;
    font-weight: 700;
    line-height: 14px;
    padding: 0;
}

.field {
    display: block;
    margin-bottom: 28px;
}

.field:last-of-type {
    margin-bottom: 18px;
}

.field span,
.field-head span {
    display: block;
    margin-bottom: 16px;
    font-size: 19px;
    line-height: 1.2;
    font-weight: 800;
}

.field input {
    width: 100%;
    height: 38px;
    padding: 0 0 13px;
    border: 0;
    border-bottom: 1px solid #d9d9dd;
    border-radius: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 17px;
    line-height: 1.3;
    transition: border-color .2s ease;
}

.field input::placeholder {
    color: #a4a5ab;
}

.field input:focus {
    border-bottom-color: #9da1aa;
}

.field input:disabled {
    color: #b3b5bb;
    cursor: not-allowed;
}

.field input.is-invalid {
    border-bottom-color: var(--accent);
}

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

.np-reset {
    padding-top: 2px;
    white-space: nowrap;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.field-autocomplete {
    position: relative;
}

.field-hint {
    margin: 8px 0 0;
    color: #9a9ca4;
    font-size: 13px;
    line-height: 1.35;
}

.suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 24px);
    z-index: 10;
    max-height: 240px;
    overflow: auto;
    border: 1px solid #e4e4e8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(24, 28, 36, .15);
}

.suggestion-item {
    display: block;
    width: 100%;
    padding: 13px 14px;
    text-align: left;
    color: var(--text);
    border-bottom: 1px solid #f0f0f2;
    background: #fff;
}

.suggestion-item:last-child {
    border-bottom: 0;
}

.suggestion-item:hover,
.suggestion-item:focus {
    background: #f6f6f8;
}

.suggestion-empty {
    color: #8a8c94;
    cursor: default;
}

.suggestion-title {
    display: block;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.suggestion-subtitle {
    display: block;
    margin-top: 3px;
    color: #8a8c94;
    font-size: 13px;
    line-height: 1.25;
}

.form-error {
    margin: 18px 0 0;
    color: var(--accent);
    font-size: 14px;
    line-height: 1.35;
}

.privacy-card {
    position: relative;
    z-index: 2;
    margin-top: 24px;
    margin-bottom: 4px;
    padding: 34px 20px 38px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}

.privacy-card h2 {
    margin: 0 0 20px;
    font-size: 21px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.01em;
}

.privacy-card p {
    margin: 0;
    color: #767880;
    font-size: 16px;
    line-height: 1.48;
}

.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.bottom-bar {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
    padding: 16px 20px 17px;
    border-top: 1px solid #e1e2e5;
    background: #fff;
}


.submit-btn[hidden],
.tiktok-btn[hidden] {
    display: none !important;
}

.submit-btn,
.tiktok-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
    transition: .2s ease;
}

.submit-btn {
    background: #eeeeef;
    color: #9c9da3;
}

.submit-btn.is-ready {
    background: var(--accent);
    color: #fff;
}

.submit-btn.is-ready:hover,
.tiktok-btn:hover {
    background: var(--accent-hover);
}

.submit-btn.is-loading {
    pointer-events: none;
    opacity: .72;
}

.tiktok-btn {
    background: var(--accent);
    color: #fff;
}

.slide-thanks {
    min-height: calc(100vh - 310px);
}

.thanks-box {
    margin-top: 20px;
    padding: 40px 20px 34px;
    text-align: center;
}

.check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: #f7f7f7;
}

.check-icon svg {
    fill: var(--success);
}

.thanks-box h2 {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
}

.thanks-box p {
    margin: 0;
    color: #555862;
    font-size: 16px;
    line-height: 1.45;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    max-width: 430px;
    margin: 24px auto 0;
    color: #22232a;
    font-size: 20px;
}

.pager-arrow {
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    color: #676a72;
}

.pager-arrow svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pager-arrow:disabled {
    opacity: .35;
    cursor: default;
}

@media (max-width: 420px) {
    .page {
        padding: 16px 12px 28px;
    }

    .lead-card {
        height: calc(100vh - 104px);
        height: calc(100dvh - 104px);
        min-height: 650px;
    }

    .stage {
        padding-left: 18px;
        padding-right: 18px;
    }

    .form-card {
        padding-left: 19px;
        padding-right: 19px;
    }

    .field span,
    .field-head span {
        font-size: 18px;
    }

    .privacy-card p {
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .stage {
        padding-left: 14px;
        padding-right: 14px;
    }

    .brand-avatar {
        width: 88px;
        height: 88px;
        top: -44px;
    }

    .brand-card {
        padding-top: 54px;
    }

    .form-title {
        font-size: 20px;
    }
}

/* Patch 1.4.0: mobile scroll + fixed bottom submit */
html, body {
    height: 100%;
}

body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page {
    min-height: 100vh;
    min-height: 100dvh;
}

.lead-card {
    height: calc(100vh - 112px);
    height: calc(100dvh - 112px);
    min-height: 560px;
    max-height: none;
    overflow: hidden;
}

.stage {
    height: 100%;
    overflow-y: auto !important;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    padding-bottom: 132px;
}

.slide-form {
    min-height: 100%;
    padding-bottom: 8px;
}

.privacy-card {
    display: block;
    margin-top: 24px;
    margin-bottom: 0;
}

.bottom-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding-bottom: max(17px, env(safe-area-inset-bottom));
    box-shadow: 0 -10px 24px rgba(207, 212, 220, .35);
}

.submit-btn:disabled {
    cursor: not-allowed;
}

.submit-btn:disabled:not(.is-ready) {
    background: #eeeeef;
    color: #9c9da3;
}

.submit-btn.is-ready:not(:disabled) {
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

@media (max-width: 420px) {
    .lead-card {
        height: calc(100vh - 104px);
        height: calc(100dvh - 104px);
        min-height: 540px;
    }

    .stage {
        padding-top: 58px;
        padding-bottom: 138px;
    }
}

@media (max-height: 720px) {
    .page {
        padding-top: 12px;
        padding-bottom: 24px;
    }

    .lead-card {
        height: calc(100vh - 92px);
        height: calc(100dvh - 92px);
        min-height: 500px;
    }

    .stage {
        padding-top: 54px;
        padding-bottom: 138px;
    }

    .brand-card {
        margin-bottom: 18px;
        padding-bottom: 22px;
    }

    .form-card {
        padding-top: 30px;
    }
}

/* Patch 1.5.0: privacy links, auto country code UI, stronger mobile scroll */
:root {
    --app-height: 100vh;
}

@supports (height: 100dvh) {
    :root { --app-height: 100dvh; }
}

html,
body {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
}

body {
    overflow-y: auto !important;
}

.page {
    min-height: var(--app-height);
}

.lead-card {
    height: calc(var(--app-height) - 112px) !important;
    min-height: 0 !important;
    max-height: none !important;
}

.stage {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: 158px !important;
}

.slide-form {
    min-height: auto !important;
    padding-bottom: 6px !important;
}

.privacy-card {
    display: block !important;
    margin-top: 24px !important;
    margin-bottom: 0 !important;
}

.privacy-card strong {
    color: #3f4149;
    font-weight: 800;
}

.privacy-card a {
    color: inherit;
    text-decoration: none;
}

.privacy-card a:focus,
.privacy-card a:hover {
    text-decoration: underline;
}

.phone-row {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    border-bottom: 1px solid #d9d9dd;
}

.phone-row:focus-within {
    border-bottom-color: #9da1aa;
}

.phone-country {
    flex: 0 0 auto;
    max-width: 118px;
    padding: 0 20px 13px 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 17px;
    line-height: 1.3;
    font-weight: 400;
    appearance: auto;
    -webkit-appearance: menulist;
}

.phone-divider {
    flex: 0 0 1px;
    width: 1px;
    height: 18px;
    margin: 0 12px 13px 4px;
    background: #d9d9dd;
}

.field .phone-row input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    padding: 0 0 13px;
    border-bottom: 0;
}

.field .phone-row input:focus {
    border-bottom: 0;
}

.phone-row.is-invalid {
    border-bottom-color: var(--accent);
}

@media (max-width: 420px) {
    .lead-card {
        height: calc(var(--app-height) - 104px) !important;
        min-height: 0 !important;
    }

    .stage {
        padding-bottom: 164px !important;
    }

    .phone-country {
        max-width: 112px;
        font-size: 16px;
    }
}

@media (max-height: 720px) {
    .lead-card {
        height: calc(var(--app-height) - 82px) !important;
        min-height: 0 !important;
    }

    .stage {
        padding-bottom: 168px !important;
    }
}
