/**
 * Profile & questionnaire forms — Apple-inspired visual layer.
 * Matches search-form.css design tokens; functionality unchanged.
 */

.profile-container {
    --sf-bg: var(--color-surface);
    --sf-fill: var(--color-control);
    --sf-fill-elevated: var(--color-control-hover);
    --sf-separator: var(--color-border-subtle);
    --sf-label: var(--color-text-muted);
    --sf-text: var(--color-text);
    --sf-radius-shell: 16px;
    --sf-radius-field: 10px;
    --sf-radius-control: 10px;
    --pf-row-h: 44px;
    --pf-pad-x: 0.875rem;
    --pf-pad-y: 0.5rem;
    --sf-shadow: var(--shadow-surface);
    --sf-font:
        -apple-system, blinkmacsystemfont, "SF Pro Text", "SF Pro Display",
        system-ui, sans-serif;

    max-width: none;
    margin: 0 0 2rem;
    padding: 1.125rem;
    background: var(--sf-bg);
    border: none;
    border-radius: var(--sf-radius-shell);
    box-shadow: var(--sf-shadow);
    font-family: var(--sf-font);
}

.profile-page .profile-booking-banner-host {
    margin-bottom: 0.75rem;
}

.profile-segment .tab-check-icon,
.profile-segment .tab-incomplete-icon {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    line-height: 1;
}

.profile-segment .tab-check-icon {
    color: #34c759;
}

.profile-segment .tab-incomplete-icon {
    color: #ff9500;
}

.profile-segment .tab-check-icon[hidden],
.profile-segment .tab-incomplete-icon[hidden] {
    display: none;
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

.form-section {
    margin-bottom: 0;
}

/* ── Profile form card (iOS Settings–style groups) ── */

.profile-form-card {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.profile-form-group__title {
    margin: 0 0 0.25rem;
    padding: 0 0.125rem;
    font-family: var(--sf-font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--sf-label);
}

.profile-form-group__hint {
    margin: 0 0 0.375rem;
    padding: 0 0.125rem;
    font-family: var(--sf-font);
    font-size: 11px;
    line-height: 1.35;
    color: var(--sf-label);
}

.profile-form-group__footnote {
    margin: 0.5rem 0 0;
    padding: 0 0.125rem;
    font-family: var(--sf-font);
    font-size: 12px;
    line-height: 1.4;
    color: var(--sf-label);
}

.profile-form-group {
    margin: 0;
}

.profile-form-group__body {
    overflow: hidden;
    border-radius: var(--sf-radius-field);
    background: var(--sf-fill);
}

.profile-form-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3125rem;
    padding: 0.5625rem 0.75rem;
}

.profile-form-field label {
    display: block;
    margin: 0;
    font-family: var(--sf-font);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: var(--sf-label);
}

.profile-form-field input[type="text"],
.profile-form-field input[type="email"] {
    width: 100%;
    margin: 0;
    padding: 0.5rem 0.625rem;
    border: none;
    border-radius: 8px;
    background: var(--sf-bg);
    color: var(--sf-text);
    font-family: var(--sf-font);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.018em;
    line-height: 1.3;
    text-align: left;
    box-shadow: inset 0 0 0 1px var(--sf-separator);
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.profile-form-field input[type="text"]::placeholder,
.profile-form-field input[type="email"]::placeholder {
    color: var(--color-text-faint);
}

.profile-form-field input[type="text"]:focus,
.profile-form-field input[type="email"]:focus {
    outline: none;
    background: var(--sf-bg);
    box-shadow:
        inset 0 0 0 1px var(--primary),
        0 0 0 3px var(--primary-light);
}

.profile-form-field input[type="text"].is-invalid,
.profile-form-field input[type="email"].is-invalid {
    background: rgb(255 59 48 / 4%);
    box-shadow:
        inset 0 0 0 1px rgb(255 59 48 / 55%),
        0 0 0 3px rgb(255 59 48 / 10%);
}

.profile-form-field input[type="text"].is-invalid:focus,
.profile-form-field input[type="email"].is-invalid:focus {
    box-shadow:
        inset 0 0 0 1px rgb(255 59 48 / 65%),
        0 0 0 3px rgb(255 59 48 / 14%);
}

.profile-form-field__error {
    margin: 0.125rem 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #b42318;
}

.profile-form-toggle-row.is-disabled {
    opacity: 0.45;
    cursor: default;
}

.profile-form-toggle-row.is-disabled .profile-form-toggle-row__input[type="checkbox"] {
    cursor: default;
}

.profile-country-field.is-disabled .profile-country-field__trigger {
    opacity: 0.55;
    cursor: not-allowed;
}

.profile-form-field + .profile-form-field,
.profile-form-field + .profile-form-toggle-row,
.profile-form-toggle-row + .profile-form-field {
    border-top: 1px solid var(--sf-separator);
}

.profile-form-field.is-collapsed {
    display: none;
}

.profile-form-field--phone .intl-phone-input-host,
.profile-form-field--phone .intl-phone-input {
    width: min(100%, var(--pf-phone-width, 21rem));
    max-width: var(--pf-phone-width, 21rem);
}

.profile-form-group--phones .profile-form-group__body {
    --pf-phone-width: 21rem;
}

.profile-form-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    min-height: 42px;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--sf-separator);
    cursor: pointer;
    user-select: none;
}

.profile-form-toggle-row__label {
    flex: 1;
    min-width: 0;
    font-family: var(--sf-font);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--sf-text);
}

.profile-form-toggle-row__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-right: -0.375rem;
}

.profile-container .profile-form-toggle-row__input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 51px;
    height: 31px;
    min-width: 51px;
    min-height: 31px;
    max-width: 51px;
    max-height: 31px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 31px;
    background: rgba(120, 120, 128, 0.16);
    box-shadow: none;
    box-sizing: border-box;
    line-height: 0;
    font-size: 0;
    cursor: pointer;
    transition: background 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-container .profile-form-toggle-row__input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.15),
        0 1px 1px rgba(0, 0, 0, 0.06);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-container .profile-form-toggle-row__input[type="checkbox"]:checked {
    background: var(--primary);
    box-shadow: none;
}

.profile-container .profile-form-toggle-row__input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.profile-container .profile-form-toggle-row__input[type="checkbox"]:checked::after {
    content: none;
}

.profile-form-group--consent .profile-form-group__body--consent {
    padding: 0.25rem;
    background: var(--sf-fill);
}

.profile-form-group--consent .consent-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
}

.profile-form-group--consent .consent-checkbox-option {
    margin: 0;
    padding: 0.625rem 0.75rem;
    gap: 0.625rem;
}

.profile-form-group--consent .consent-checkbox-option label {
    font-size: 13px;
    line-height: 1.35;
}

.profile-form-group--consent .consent-disclaimer {
    margin-top: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 12px;
}

.profile-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.25rem;
    padding-top: 0.75rem;
}

.profile-form-actions .btn-primary {
    margin-top: 0;
    width: auto;
    min-height: 36px;
    padding: 0.4375rem 1.125rem;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.profile-form-card--page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-form-card--page .profile-form-card--embedded {
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: none;
}

.profile-form-error,
.prebook-profile-pane__error {
    flex-shrink: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgb(255 59 48 / 10%);
    color: #c41e12;
    font-size: 13px;
    line-height: 1.4;
}

.section-title {
    margin: 0 0 1.25rem;
    font-family: var(--sf-font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--sf-text);
    gap: 0.5rem;
}

.section-title i {
    color: var(--sf-label);
    font-size: 14px;
}

.profile-container .form-group {
    margin-bottom: 1rem;
}

.profile-container .form-group label,
.profile-container .consent-section .section-label {
    display: block;
    margin-bottom: 0.375rem;
    font-family: var(--sf-font);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--sf-label);
}

/* ── Questionnaire — iOS Settings grouped sections ── */

.profile-container #questionnaire-section .section-title {
    display: none;
}

.profile-container .questionnaire-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    margin: 0;
}

.profile-container .questionnaire-form .questionnaire-block {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
}

.profile-container .questionnaire-form .questionnaire-block > label {
    margin: 0;
    padding: 0 0.125rem;
    font-family: var(--sf-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.4;
    color: var(--sf-text);
}

.profile-container .questionnaire-form .radio-group,
.profile-container .questionnaire-form .checkbox-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    overflow: hidden;
    border-radius: var(--sf-radius-field);
    background: var(--sf-fill);
}

.profile-container .questionnaire-form .radio-option,
.profile-container .questionnaire-form .checkbox-option {
    margin: 0;
    padding: 0.6875rem 0.875rem;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.profile-container .questionnaire-form .radio-option:not(:last-child),
.profile-container .questionnaire-form .checkbox-option:not(:last-child) {
    border-bottom: 1px solid var(--sf-separator);
}

.profile-container .questionnaire-form .radio-option:hover,
.profile-container .questionnaire-form .checkbox-option:hover {
    background: var(--color-highlight);
}

.profile-container .questionnaire-form .radio-option.selected,
.profile-container .questionnaire-form .checkbox-option.selected,
.profile-container .questionnaire-form .checkbox-option:has(input[type="checkbox"]:checked) {
    background: var(--sf-bg);
    box-shadow: none;
}

.profile-container .questionnaire-form .radio-option label,
.profile-container .questionnaire-form .checkbox-option label {
    font-size: 14px;
    line-height: 1.35;
}

.profile-container .questionnaire-form > .btn-primary,
.profile-container .questionnaire-form > button[type="submit"] {
    margin-top: 0.25rem;
    width: auto;
    min-height: 36px;
    padding: 0.4375rem 1.125rem;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.profile-container .section-completed .questionnaire-form .radio-option,
.profile-container .section-completed .questionnaire-form .checkbox-option {
    background: transparent;
    box-shadow: none;
}

.profile-container .section-completed .questionnaire-form .radio-option.selected,
.profile-container .section-completed .questionnaire-form .checkbox-option.selected,
.profile-container .section-completed .questionnaire-form .checkbox-option:has(input[type="checkbox"]:checked) {
    background: var(--color-highlight);
}

.profile-container .form-group input,
.profile-container .form-group select {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: none;
    border-radius: var(--sf-radius-field);
    background: var(--sf-fill);
    color: var(--sf-text);
    font-family: var(--sf-font);
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.022em;
    line-height: 1.235;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.profile-container .form-group input::placeholder {
    color: var(--color-text-faint);
}

.profile-container .form-group input:focus,
.profile-container .form-group select:focus {
    outline: none;
    background: var(--sf-bg);
    box-shadow:
        0 0 0 3px var(--primary-light),
        inset 0 0 0 1px rgba(0, 194, 168, 0.45);
}

.profile-container .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

.profile-container .checkbox-group {
    margin-top: 0.625rem;
    gap: 0.5rem;
}

.profile-container .checkbox-group label {
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--sf-text);
    letter-spacing: -0.01em;
}

.profile-container .checkbox-group input[type="checkbox"],
.profile-container .checkbox-option input[type="checkbox"],
.profile-container .consent-checkbox-option input[type="checkbox"] {
    appearance: none;
    position: relative;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    background: var(--sf-fill-elevated);
    box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.18);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.profile-container .profile-form-group__body .consent-checkbox-option input[type="checkbox"]:checked,
.profile-container .checkbox-group input[type="checkbox"]:checked,
.profile-container .checkbox-option input[type="checkbox"]:checked,
.profile-container .consent-checkbox-option input[type="checkbox"]:checked {
    background: var(--primary);
    box-shadow: none;
}

.profile-container .checkbox-group input[type="checkbox"]:checked::after,
.profile-container .checkbox-option input[type="checkbox"]:checked::after,
.profile-container .consent-checkbox-option input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.profile-container .radio-group {
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.profile-container .radio-option,
.profile-container .checkbox-option,
.profile-container .consent-checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: var(--sf-radius-field);
    background: var(--sf-fill);
    cursor: pointer;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.profile-container .radio-option:hover,
.profile-container .checkbox-option:hover,
.profile-container .consent-checkbox-option:hover {
    background: var(--sf-fill-elevated);
}

.profile-container .radio-option.selected,
.profile-container .checkbox-option.selected,
.profile-container .consent-checkbox-option:has(input[type="checkbox"]:checked) {
    background: transparent;
    box-shadow: none;
}

.profile-container .radio-option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin: 0.125rem 0 0;
    padding: 0;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    background: var(--sf-fill-elevated);
    box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.18);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.profile-container .radio-option input[type="radio"]:checked {
    background: var(--primary);
    box-shadow: inset 0 0 0 4px var(--sf-bg);
}

.profile-container .radio-option label,
.profile-container .checkbox-option label,
.profile-container .consent-checkbox-option label {
    margin: 0;
    flex: 1;
    font-family: var(--sf-font);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--sf-text);
    cursor: pointer;
}

.profile-container .consent-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sf-separator);
}

.profile-container .profile-form-group--consent {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.profile-container .consent-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.profile-container .consent-disclaimer {
    padding: 0.875rem 1rem;
    border: none;
    border-radius: var(--sf-radius-field);
    background: rgba(255, 149, 0, 0.08);
    font-family: var(--sf-font);
    font-size: 13px;
    line-height: 1.5;
    color: rgba(60, 60, 67, 0.85);
}

.profile-container .consent-disclaimer a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.profile-container .consent-disclaimer a:hover {
    text-decoration: underline;
}

.profile-container .btn-primary {
    margin-top: 1.25rem;
    min-height: 48px;
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: 980px;
    background: var(--primary);
    box-shadow: none;
    color: var(--white);
    font-family: var(--sf-font);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.022em;
    transition:
        background 0.2s ease,
        transform 0.15s ease,
        opacity 0.2s ease;
}

.profile-container .btn-primary:hover {
    background: var(--primary-hover);
    transform: none;
    box-shadow: none;
}

.profile-container .btn-primary:active {
    transform: scale(0.98);
    opacity: 0.92;
}

.profile-container .btn-primary:disabled {
    background: rgba(60, 60, 67, 0.18);
    color: rgba(60, 60, 67, 0.55);
    border: none;
    opacity: 1;
    box-shadow: none;
    transform: none;
}

.profile-container .btn-primary:disabled:hover {
    background: rgba(60, 60, 67, 0.18);
    transform: none;
    box-shadow: none;
}

.profile-container .alert {
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: var(--sf-radius-field);
    font-family: var(--sf-font);
    font-size: 14px;
    line-height: 1.4;
}

.profile-container .alert-warning {
    background: rgba(255, 149, 0, 0.1);
    color: rgba(60, 60, 67, 0.9);
}

.profile-container .alert-success {
    background: rgba(52, 199, 89, 0.12);
    color: rgba(28, 80, 45, 0.95);
}

.profile-container .alert-error {
    background: rgba(255, 59, 48, 0.1);
    color: rgba(120, 30, 25, 0.95);
}

.profile-container .section-locked {
    opacity: 0.45;
    pointer-events: none;
}

.profile-container .section-completed {
    opacity: 0.65;
    pointer-events: none;
}

.profile-container .section-completed .radio-option,
.profile-container .section-completed .checkbox-option {
    cursor: not-allowed;
    background: var(--sf-fill);
}

.profile-container .section-completed .radio-option:hover,
.profile-container .section-completed .checkbox-option:hover {
    background: var(--sf-fill);
    box-shadow: none;
}

.profile-container .checkbox-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.profile-container .loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--sf-fill-elevated);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: pf-spin 1s linear infinite;
}

@keyframes pf-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 768px) {
    .profile-page .profile-container {
        padding: 0 1rem 2rem;
    }

    body:not(.profile-page) .profile-form-card--page {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem 1.5rem;
        align-items: start;
    }

    body:not(.profile-page) .profile-form-card--page #profile-form-host {
        display: contents;
    }

    body:not(.profile-page) .profile-form-card--page .profile-form-group--phones,
    body:not(.profile-page) .profile-form-card--page .profile-form-group--consent,
    body:not(.profile-page) .profile-form-card--page #profile-form-error,
    body:not(.profile-page) .profile-form-card--page .profile-form-actions {
        grid-column: 1 / -1;
    }

    .profile-form-group--phones .profile-form-group__body {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0 2rem;
    }

    .profile-form-group--phones .profile-form-field--phone {
        flex: 0 1 auto;
        width: min(100%, var(--pf-phone-width, 21rem));
        max-width: var(--pf-phone-width, 21rem);
        padding-right: 0;
    }

    .profile-form-group--phones .profile-form-toggle-row {
        flex: 1 1 100%;
    }

    .profile-form-group--phones .profile-form-group__body:has(.profile-form-field.is-collapsed) {
        gap: 0;
    }

    body:not(.profile-page) .profile-container .questionnaire-form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem 1.5rem;
        align-items: start;
    }

    body:not(.profile-page) .profile-container .questionnaire-form > .btn-primary,
    body:not(.profile-page) .profile-container .questionnaire-form > button[type="submit"] {
        grid-column: 1 / -1;
        justify-self: end;
        margin-top: 0;
    }
}

@media (min-width: 1024px) {
    body:not(.profile-page) .profile-form-card--page {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body:not(.profile-page) .profile-form-card--page .profile-form-group--phones {
        grid-column: auto;
    }

    body:not(.profile-page) .profile-form-card--page .profile-form-group--consent,
    body:not(.profile-page) .profile-form-card--page #profile-form-error,
    body:not(.profile-page) .profile-form-card--page .profile-form-actions {
        grid-column: 1 / -1;
    }

    .profile-form-group--phones .profile-form-group__body {
        display: block;
    }

    .profile-form-group--phones .profile-form-field--phone {
        width: 100%;
        max-width: none;
    }

    .profile-form-group--phones .profile-form-field--phone .intl-phone-input-host,
    .profile-form-group--phones .profile-form-field--phone .intl-phone-input {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 767px) {
    .profile-container {
        max-width: none;
        margin: 0.75rem 0 1.5rem;
        padding: 1rem;
        border-radius: 14px;
    }

    .profile-form-field--phone .intl-phone-input-host,
    .profile-form-field--phone .intl-phone-input {
        width: 100%;
        max-width: none;
    }

    .profile-form-card {
        gap: 1rem;
    }

    .profile-form-field input[type="text"],
    .profile-form-field input[type="email"],
    .profile-container .profile-form-group__body .intl-phone-input__number,
    .profile-form-field .profile-country-field__trigger,
    .profile-form-field .profile-country-field__trigger .prebook-country-picker__trigger-label {
        font-size: 16px;
    }

    .profile-form-field,
    .profile-form-field .intl-phone-input,
    .profile-form-field .profile-country-field,
    .profile-container .form-group {
        scroll-margin-top: 12px;
        scroll-margin-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }

    body.profile-page.profile-keyboard-open {
        overscroll-behavior: none;
    }

    .profile-form-field:has(.intl-phone-input-host) .intl-phone-input,
    .profile-form-field:has(.intl-phone-input-host) .intl-phone-input:focus-within {
        box-shadow: inset 0 0 0 1px rgba(0, 194, 168, 0.45);
        transform: none;
    }

    .profile-form-field:has(.intl-phone-input-host) .intl-phone-input__flag .flag-icon {
        transform: none;
    }

    .profile-container .profile-form-toggle-row__input[type="checkbox"] {
        width: 51px;
        height: 31px;
        min-width: 51px;
        min-height: 31px;
        max-width: 51px;
        max-height: 31px;
        padding: 0;
    }

    .profile-container .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .profile-container .form-group input,
    .profile-container .form-group select {
        font-size: 16px;
    }

    .profile-container .radio-option label,
    .profile-container .checkbox-option label,
    .profile-container .consent-checkbox-option label {
        font-size: 14px;
    }

    .profile-container .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .profile-container .profile-form-actions .btn-primary,
    .profile-container .questionnaire-form > button[type="submit"] {
        width: auto;
        min-height: 40px;
        padding: 0.5rem 1.125rem;
    }

    body.profile-page .profile-container .btn-primary {
        width: auto;
        justify-content: center;
    }
}

.profile-form-field--error > label {
    color: #b42318;
}

.profile-form-field--error .profile-country-field.is-invalid .profile-country-field__trigger,
.profile-form-field--error .profile-country-field__trigger.is-invalid {
    background: rgb(255 59 48 / 4%);
    box-shadow:
        inset 0 0 0 1px rgb(255 59 48 / 55%),
        0 0 0 3px rgb(255 59 48 / 10%);
}

.profile-form-field--error .profile-country-field__error {
    margin: 0.125rem 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #b42318;
}

.profile-form-field--error-animate {
    animation: profile-form-field-error-enter 0.35s ease;
}

@keyframes profile-form-field-error-enter {
    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-3px);
    }

    40% {
        transform: translateX(3px);
    }

    60% {
        transform: translateX(-2px);
    }

    80% {
        transform: translateX(2px);
    }
}

.profile-form-group--error > .profile-form-group__title {
    color: #b42318;
}

.profile-form-group--consent.profile-form-group--error .consent-checkbox-option.is-invalid {
    background: rgb(255 59 48 / 5%);
    box-shadow: inset 0 0 0 1px rgb(255 59 48 / 42%);
}

.profile-form-field--error .profile-phone-verify__status--note,
.profile-form-field--error .profile-phone-verify__status--error {
    color: #b42318;
    font-weight: 500;
}

.profile-phone-verify-host {
    margin-top: 0.375rem;
}

.profile-phone-verify {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.profile-phone-verify__btn {
    align-self: flex-start;
    min-height: 34px;
    padding: 0.375rem 0.875rem;
    border: 0.5px solid var(--color-border-strong);
    border-radius: 980px;
    background: var(--color-surface-glass);
    color: var(--sf-text);
    font-family: var(--sf-font, -apple-system, blinkmacsystemfont, system-ui, sans-serif);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    box-shadow: var(--shadow-surface-sm);
}

.profile-phone-verify__btn:hover:not(:disabled) {
    background: var(--color-control-hover);
    border-color: var(--color-border-strong);
}

.profile-phone-verify__btn:active:not(:disabled) {
    background: var(--color-control-active);
}

.profile-phone-verify__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.profile-phone-verify__status {
    margin: 0;
    font-family: var(--sf-font, -apple-system, blinkmacsystemfont, system-ui, sans-serif);
    font-size: 13px;
    line-height: 1.4;
}

.profile-phone-verify__status--verified {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.profile-phone-verify__check {
    position: relative;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-control-hover);
}

.profile-phone-verify__check::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 5px;
    width: 4px;
    height: 7px;
    border-right: 1.5px solid var(--sf-text);
    border-bottom: 1.5px solid var(--sf-text);
    transform: rotate(45deg);
}

.profile-phone-verify__status--note {
    color: var(--color-text-muted);
}

.profile-phone-verify__status--error {
    color: #b42318;
}

@media (max-width: 640px) {
    .profile-phone-verify__btn {
        width: 100%;
        justify-content: center;
    }
}
