/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #0176d3;
    --primary-dark: #032d60;
    --primary-light: #5eb4ff;
    --bg-peach: #eef4fb;
    --bg-blue: #e3f0fc;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.06);
    --text-heading: #111827;
    --text-body: #4b5563;
    --text-muted: #9ca3af;
    --step-inactive: #e5e7eb;
    --label-color: #194364;
    --input-border: #0176d3;
    --input-focus: rgba(1, 118, 211, 0.18);
    --shadow-primary: rgba(1, 118, 211, 0.28);
    --shadow-card:
        0 0 0 1px var(--card-border),
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 24px 48px -12px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-peach) 0%, #f5f5f5 45%, var(--bg-blue) 100%);
    position: relative;
    overflow-x: hidden;
    padding: 40px 20px 70px;
    color: var(--text-heading);
}

/* ── Page background (subtle, corporate) ── */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.page-bg__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.page-bg__glow--1 {
    width: 420px;
    height: 420px;
    top: -8%;
    right: -6%;
    background: radial-gradient(circle, rgba(1, 118, 211, 0.12) 0%, transparent 68%);
}

.page-bg__glow--2 {
    width: 380px;
    height: 380px;
    bottom: -6%;
    left: -4%;
    background: radial-gradient(circle, rgba(25, 67, 100, 0.1) 0%, transparent 68%);
}

.page-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(25, 67, 100, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(25, 67, 100, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 75%);
}

/* ── Main Card ── */
.card {
    width: 800px;
    max-width: 100%;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 36px 40px 40px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-card);
    isolation: isolate;
    animation: fadeInUp 0.6s ease forwards;
}

.card::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -28px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.14) 0%, transparent 72%);
    z-index: -1;
    filter: blur(10px);
    pointer-events: none;
}

/* ── Brand logo ── */
.brand-logo {
    display: flex;
    justify-content: center;
    margin: 0 auto 18px;
}

.brand-logo img {
    display: block;
    height: 44px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
}

/* ── Steps ── */
.steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
}

.steps span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--step-inactive);
    color: #6b7280;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    transition: background 0.25s ease, color 0.25s ease;
}

.steps span.active {
    background: var(--primary);
    color: #fff;
}

.steps .line {
    width: 24px;
    height: 2px;
    background: var(--step-inactive);
    border-radius: 1px;
}

/* ── Heading & Description ── */
.card h1 {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-heading);
    line-height: 1.3;
    max-width: 520px;
    margin: 0 auto;
}

.desc {
    max-width: 500px;
    margin: 14px auto 32px;
    text-align: center;
    color: var(--text-body);
    line-height: 1.6;
    font-size: 14px;
    font-weight: 400;
}

/* ── Form Grid ── */
.form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 22px;
}

/* ── Field ── */
.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--label-color);
    font-weight: 700;
}

.field input[type="text"],
.field input[type="email"] {
    width: 100%;
    height: 44px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 0 14px;
    background: #fff;
    color: var(--text-heading);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input[type="text"]::placeholder,
.field input[type="email"]::placeholder {
    color: var(--text-muted);
}

.field input[type="text"]:focus,
.field input[type="email"]:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px var(--input-focus);
}

/* ── Phone Field ── */
.phone-field {
    position: relative;
}

.phone-field.is-open {
    z-index: 25;
}

.phone-wrapper {
    display: flex;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-field.is-open .phone-wrapper,
.phone-wrapper:focus-within {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px var(--input-focus);
}

.phone-country {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 10px;
    border: 0;
    border-right: 1px solid var(--input-border);
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.phone-country:hover {
    background: #f9fafb;
}

.phone-country__flag,
.phone-flag {
    display: block;
    width: 24px;
    height: 18px;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    border: 0;
    flex-shrink: 0;
    background: transparent;
    opacity: 1;
    filter: none;
    mix-blend-mode: normal;
}

.phone-country__code {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    min-width: 2.5rem;
}

.phone-country__caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #6b7280;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.phone-field.is-open .phone-country__caret {
    transform: rotate(180deg);
}

.phone-wrapper input[type="tel"] {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    background: transparent;
    outline: none;
    border: 0;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-heading);
}

.phone-wrapper input[type="tel"]::placeholder {
    color: var(--text-muted);
}

.phone-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.phone-dropdown[hidden] {
    display: none;
}

.phone-dropdown__search {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-heading);
    background: #fafafa;
}

.phone-dropdown__search::placeholder {
    color: var(--text-muted);
}

.phone-dropdown__search:focus {
    background: #fff;
}

.phone-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 260px;
    overflow-y: auto;
}

.phone-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.12s ease;
}

.phone-dropdown__item .phone-flag {
    flex-shrink: 0;
}

.phone-dropdown__name {
    flex: 1;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phone-dropdown__dial {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.phone-dropdown__item:hover,
.phone-dropdown__item.is-active {
    background: #f3f4f6;
}

.phone-dropdown__item[aria-selected="true"] {
    background: #f0f7ff;
}

.phone-dropdown__item[aria-selected="true"] .phone-flag,
.phone-dropdown__item.is-active .phone-flag {
    opacity: 1;
    filter: none;
}

.phone-dropdown__divider {
    height: 1px;
    margin: 4px 12px;
    background: #e5e7eb;
    pointer-events: none;
}

.phone-dropdown__empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Checkbox & Agreement ── */
.field--agree {
    grid-column: 1 / -1;
}

.agree {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px 12px;
    align-items: start;
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-body);
    cursor: pointer;
}

.agree input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.agree span {
    min-width: 0;
}

/* ── Button ── */
.btn {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    min-width: 220px;
    height: 36px;
    margin: 12px auto 0;
    padding: 0 32px 0 36px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px var(--shadow-primary);
}

.btn__text {
    line-height: 1;
}

.btn__icon {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-primary);
}

.btn:active {
    transform: translateY(0);
}

/* ── Field validation ── */
.field-error {
    margin: 6px 0 0;
    font-size: 11.5px;
    font-weight: 500;
    color: #dc2626;
    line-height: 1.4;
    white-space: nowrap;
    letter-spacing: -0.1px;
}

.field-error[hidden] {
    display: none;
}

.field.is-invalid input[type="text"],
.field.is-invalid input[type="email"],
.field.is-invalid input[type="tel"] {
    border-color: #dc2626;
}

.field.is-invalid input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field.is-invalid .phone-wrapper {
    border-color: #dc2626;
}

.field.is-invalid .phone-wrapper:focus-within {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field--agree.is-invalid .agree {
    color: var(--text-body);
}

/* ── Note ── */
.note {
    grid-column: 1 / -1;
    margin: 16px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
    text-align: center;
}

.note a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.note a:hover {
    text-decoration: underline;
}

/* ── Footer ── */
.footer {
    width: 100%;
    height: 48px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    z-index: 10;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
}

.footer a {
    color: var(--text-body);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    color: var(--primary);
}

/* ── Entrance Animation ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    body {
        padding: 24px 16px 60px;
    }

    .card {
        padding: 28px 22px 32px;
        border-radius: 16px;
    }

    .card h1 {
        font-size: 22px;
    }

    .desc {
        font-size: 13px;
        margin-bottom: 24px;
    }

    .form {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .page-bg__grid {
        opacity: 0.6;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 24px 18px 28px;
    }

    .card h1 {
        font-size: 20px;
    }

    .brand-logo img {
        height: 36px;
        max-width: 180px;
    }
}
