:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-soft: #f5f7f9;
    --line: #e8edf1;
    --line-strong: #d8e0e6;
    --ink: #1f2730;
    --ink-soft: #5f6874;
    --ink-muted: #9aa3ad;
    --accent: #49aee9;
    --accent-hover: #329fdd;
    --accent-soft: #eaf7fd;
    --green: #5fad6b;
    --green-soft: #edf8ef;
    --red: #d85b57;
    --red-soft: #fff0ee;
    --radius: 8px;
    --shadow: 0 18px 45px rgba(31, 39, 48, .07);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: calc(44px + env(safe-area-inset-top)) 18px calc(72px + env(safe-area-inset-bottom));
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
    width: 100%;
    max-width: 420px;
}

.brand {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.logo-img {
    display: block;
    max-width: 166px;
    max-height: 74px;
    object-fit: contain;
}

.card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.step {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    line-height: 1;
    font-weight: 720;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.title {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 24px;
    line-height: 1.1;
    font-weight: 760;
}

.subtitle {
    margin: 0 0 20px;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.row {
    margin-bottom: 14px;
}

label {
    display: block;
    margin: 0 0 6px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 680;
    user-select: none;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
select {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink);
    background: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 680;
    box-shadow: inset 0 1px 0 rgba(31, 39, 48, .03);
}

textarea {
    width: 100%;
    min-height: 118px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink);
    background: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 680;
    resize: vertical;
    box-shadow: inset 0 1px 0 rgba(31, 39, 48, .03);
}

input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: #b7e3f6;
    box-shadow: 0 0 0 4px rgba(73, 174, 233, .14);
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 14px;
    padding: 0 14px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 680;
    text-decoration: none;
}

button:hover,
button:focus-visible {
    background: var(--accent-hover);
}

button:active {
    transform: translateY(1px);
}

.language-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.language-flag-button {
    position: relative;
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: auto;
    min-height: 48px;
    margin: 0;
    padding: 8px 12px;
    border-color: var(--line);
    color: var(--ink);
    background: var(--surface-soft);
    font-size: 13px;
    font-weight: 700;
}

.language-flag-button:hover,
.language-flag-button:focus-visible {
    background: #fff;
}

.language-flag-button img,
.language-fallback-flag {
    width: 32px;
    height: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: #fff;
}

.language-flag-button img {
    display: block;
    object-fit: cover;
}

.language-fallback-flag {
    display: inline-grid;
    place-items: center;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 800;
}

.language-flag-button.is-current {
    border-color: #a5dff6;
    background: var(--accent-soft);
    box-shadow: 0 0 0 4px rgba(73, 174, 233, .12);
}

.language-name {
    white-space: nowrap;
}

.language-empty,
.field-hint {
    margin: 0 0 12px;
    color: var(--ink-muted);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 560;
}

.error {
    margin: 0 0 12px;
    padding: 11px 13px;
    border: 1px solid rgba(216, 91, 87, .28);
    border-radius: var(--radius);
    color: var(--red);
    background: var(--red-soft);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 720;
}

.validation-summary-valid {
    display: none;
}

.success {
    margin-top: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(95, 173, 107, .24);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--green-soft);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 650;
}

.field-error {
    display: block;
    margin-top: 6px;
    color: var(--red);
    font-size: 12px;
    font-weight: 720;
}

.field-validation-valid {
    display: none;
}

.checkbox-list {
    display: grid;
    gap: 8px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--surface-soft);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.check-row input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 0;
}

.mail-target {
    color: var(--ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.foot {
    margin-top: 16px;
    color: var(--ink-soft);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 420px) {
    body {
        padding: calc(36px + env(safe-area-inset-top)) 18px calc(72px + env(safe-area-inset-bottom));
    }

    .card {
        padding: 24px;
    }

    .title {
        font-size: 22px;
    }
}
