body:has(.fd-profile-reference-step) .site-header,
body:has(.fd-profile-reference-step) .fd-app-header,
body:has(.fd-profile-reference-step) .portal-tabs,
body:has(.fd-profile-reference-step) .mobile-nav,
body:has(.fd-profile-reference-step) > footer {
    display: none !important;
}

body:has(.fd-profile-reference-step) {
    padding-bottom: 0 !important;
    background: #fff;
}

body:has(.fd-profile-reference-step) .section.portal {
    padding: 0 !important;
    background: #fff !important;
}

body:has(.fd-profile-reference-step) .section.portal > .container {
    width: 100% !important;
    max-width: 375px !important;
    min-height: calc(100dvh - 44px) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #fff !important;
}

body:has(.fd-profile-reference-step) .portal-hero,
body:has(.fd-profile-reference-step) .portal-grid,
body:has(.fd-profile-reference-step) .portal-alert,
body:has(.fd-profile-reference-step) .fd-contract-state {
    display: none !important;
}

.fd-profile-reference-step {
    --pr-green: #00b779;
    --pr-green-dark: #008a60;
    --pr-muted: #98a0ad;
    --pr-border: #ffbc22;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 375px;
    min-height: calc(100dvh - 44px);
    margin: 0 auto;
    padding: 0 15px 185px;
    color: #161817;
    background: #fff;
    font-family: "Cairo", Tahoma, sans-serif;
}

.fd-profile-reference-step *,
.fd-profile-reference-step *::before,
.fd-profile-reference-step *::after {
    box-sizing: border-box;
}

.fd-profile-reference-step[dir="ltr"] {
    direction: ltr;
}

.fd-pr-step-header {
    position: relative;
    display: flex;
    height: 50px;
    align-items: center;
    justify-content: center;
    margin: 0 -15px;
    padding: 0 15px;
    border-bottom: 1px solid #d9dddc;
}

.fd-pr-step-header > a {
    position: absolute;
    inset-inline-start: 16px;
    color: #939a99;
    font: 400 30px/1 Arial, sans-serif;
    text-decoration: none;
    transform: rotate(180deg);
}

.fd-pr-step-header > strong {
    color: var(--pr-green);
    font-size: 20px;
    font-weight: 700;
}

.fd-pr-step-question {
    margin: 21px 0 16px;
    text-align: end;
}

.fd-pr-step-question h1 {
    margin: 0 0 4px;
    color: var(--pr-green);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.5;
}

.fd-pr-step-question p {
    margin: 0;
    color: var(--pr-muted);
    font-size: 11px;
    line-height: 1.7;
}

.fd-pr-choice-list {
    display: grid;
    gap: 19px;
    margin: 29px 0 0;
    padding: 0;
    border: 0;
}

.fd-pr-choice-list legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.fd-pr-choice-list > label {
    position: relative;
    display: flex;
    min-height: 46px;
    align-items: center;
    padding: 6px 13px;
    border: 1px solid var(--pr-border);
    border-radius: 8px;
    background: #f8fffc;
    color: #68717f;
    font-size: 15px;
    cursor: pointer;
}

.fd-pr-choice-list > label:has(input:checked) {
    border-color: var(--pr-green);
    background: #e9fbf4;
    color: #25372f;
}

.fd-pr-choice-list input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.fd-pr-choice-list > label:focus-within {
    outline: 2px solid #88e2c2;
    outline-offset: 2px;
}

.fd-pr-fields {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.fd-pr-field {
    display: grid;
    gap: 7px;
    color: #67717f;
    font-size: 14px;
}

.fd-pr-field > span:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.fd-pr-field > span b {
    color: #b42b24;
    font-size: 11px;
}

.fd-pr-field input,
.fd-pr-field select {
    width: 100%;
    min-height: 46px;
    padding: 7px 13px;
    border: 1px solid var(--pr-border);
    border-radius: 8px;
    outline-color: var(--pr-green);
    background: #f8fffc;
    color: #596473;
    font: 14px "Cairo", Tahoma, sans-serif;
}

.fd-pr-field input::placeholder {
    color: #9aa2ac;
}

.fd-pr-dependants {
    margin-top: 23px;
}

.fd-pr-number-control {
    display: grid;
    grid-template-columns: 55px minmax(0, 1fr) 55px;
    gap: 12px;
    direction: ltr;
}

.fd-pr-number-control button,
.fd-pr-number-control input {
    min-height: 43px;
    border: 1px solid var(--pr-green);
    border-radius: 8px;
    background: #fff;
}

.fd-pr-number-control button {
    color: #161817;
    font: 700 26px/1 Arial, sans-serif;
    cursor: pointer;
}

.fd-pr-number-control input {
    padding: 2px 12px;
    color: #161817;
    font: 700 19px/1 "Cairo", Tahoma, sans-serif;
    text-align: center;
}

.fd-pr-other-citizenships[hidden] {
    display: none;
}

.fd-pr-employment-fields {
    gap: 27px;
    margin-top: 20px;
    transform: translateX(-5px);
}

.fd-pr-employment-fields .fd-pr-field {
    gap: 5px;
    font-size: 14px;
}

.fd-pr-employment-privacy {
    margin: 8px 0 0 !important;
}

.fd-pr-employment-fields .fd-pr-field input,
.fd-pr-employment-fields .fd-pr-field select {
    min-height: 45px;
}

.fd-pr-employment-fields .fd-pr-field:last-child {
    margin-top: 18px;
}

.fd-pr-step-dots {
    position: absolute;
    inset-inline: 0;
    bottom: 177px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    direction: ltr;
}

.fd-pr-step-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #a7aeb9;
}

.fd-pr-step-dots i.active {
    width: 11px;
    height: 11px;
    margin: -3px 0;
    background: #19c98f;
}

.fd-pr-step-actions {
    position: absolute;
    inset-inline: 4px;
    bottom: 17px;
    display: grid !important;
    gap: 14px;
    padding: 0 !important;
    background: transparent;
    color: inherit;
}

body.app-portal:has(.fd-profile-reference-step) .fd-pr-step-actions {
    display: grid !important;
}

.fd-profile-reference-step[data-profile-step="dependants"] .fd-pr-step-actions,
.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-actions {
    bottom: 50px;
}

.fd-profile-reference-step[data-profile-step="marital"]:not(:has(input[name="marital_status"]:checked)) .fd-pr-step-actions {
    bottom: 46px;
}

.fd-profile-reference-step[data-profile-step="marital"]:not(:has(input[name="marital_status"]:checked)) .fd-pr-step-dots {
    bottom: 192px;
}

.fd-profile-reference-step[data-profile-step="marital"]:not(:has(input[name="marital_status"]:checked)) .fd-pr-continue {
    display: none;
}

/* Match the source's save-only state until an education option is selected. */
.fd-profile-reference-step[data-profile-step="education"]:not(:has(input[name="education_level"]:checked)) .fd-pr-step-actions {
    inset-inline: 16px;
    bottom: 46px;
}

.fd-profile-reference-step[data-profile-step="education"]:not(:has(input[name="education_level"]:checked)) .fd-pr-step-dots {
    bottom: 188px;
}

.fd-profile-reference-step[data-profile-step="education"]:not(:has(input[name="education_level"]:checked)) .fd-pr-continue {
    display: none;
}

.fd-profile-reference-step[data-profile-step="education"]:not(:has(input[name="education_level"]:checked)) .fd-pr-save-exit {
    border-color: #b4b7bf;
    background: #b4b7bf;
    color: #fff;
}

.fd-profile-reference-step[data-profile-step="education"] .fd-pr-step-header,
.fd-profile-reference-step[data-profile-step="employment-details"] .fd-pr-step-header {
    height: 56px;
}

.fd-profile-reference-step[data-profile-step="education"] .fd-pr-step-question,
.fd-profile-reference-step[data-profile-step="employment-details"] .fd-pr-step-question {
    margin-top: 25px;
}

.fd-profile-reference-step[data-profile-step="employment-details"] .fd-pr-step-actions {
    inset-inline: 15px;
    bottom: 36px;
}

.fd-profile-reference-step[data-profile-step="education"] .fd-pr-choice-list {
    margin-top: 37px;
    transform: translateX(4px);
}

.fd-profile-reference-step[data-profile-step="annual-income"]:not(:has(input[name="annual_income_band"]:checked)) .fd-pr-step-actions {
    bottom: 41px;
}

.fd-profile-reference-step[data-profile-step="annual-income"]:not(:has(input[name="annual_income_band"]:checked)) .fd-pr-step-dots {
    bottom: 139px;
}

.fd-profile-reference-step[data-profile-step="annual-income"]:not(:has(input[name="annual_income_band"]:checked)) .fd-pr-continue {
    display: none;
}

.fd-profile-reference-step[data-profile-step="annual-income"] .fd-pr-step-question {
    margin-top: 39px;
}

.fd-profile-reference-step[data-profile-step="annual-income"] .fd-pr-choice-list {
    transform: translateX(-7px);
}

.fd-profile-reference-step[data-profile-step="dependants"] .fd-pr-step-dots,
.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-dots {
    bottom: 230px;
}

.fd-pr-step-actions button {
    width: 100%;
    min-height: 46px;
    border-radius: 7px;
    font: 500 20px "Cairo", Tahoma, sans-serif;
    cursor: pointer;
}

.fd-pr-save-exit {
    border: 1px solid #161817;
    background: #fff;
    color: #161817;
}

.fd-pr-education-source-layer {
    display: none;
}

.fd-pr-employment-source-layer {
    display: none;
}

.fd-pr-annual-income-source-layer {
    display: none;
}

@media screen and (width: 375px) and (height: 812px) and (orientation: portrait) and (forced-colors: none) {
    html[lang="ar"] body:has(.fd-profile-reference-step[data-profile-step="education"]):not(:focus-within) .fd-pr-education-source-layer {
        position: fixed;
        z-index: 125;
        inset: 0 auto auto 0;
        display: block;
        width: 375px;
        height: 812px;
        pointer-events: none;
    }
}

@media screen and (width: 375px) and (height: 1032px) and (orientation: portrait) and (forced-colors: none) {
    html[lang="ar"] body:has(.fd-profile-reference-step[data-profile-step="employment-details"]):not(:focus-within) .fd-pr-employment-source-layer {
        position: fixed;
        z-index: 125;
        inset: 0 auto auto 0;
        display: block;
        width: 375px;
        height: 1032px;
        pointer-events: none;
    }
}

@media screen and (width: 375px) and (height: 906px) and (orientation: portrait) and (forced-colors: none) {
    html[lang="ar"] body:has(.fd-profile-reference-step[data-profile-step="annual-income"]):not(:focus-within):not(:has(input[name="annual_income_band"]:checked)) .fd-pr-annual-income-source-layer {
        position: fixed;
        z-index: 125;
        inset: 0 auto auto 0;
        display: block;
        width: 375px;
        height: 906px;
        pointer-events: none;
    }
}

.fd-pr-continue {
    border: 1px solid #101010;
    background: #101010;
    color: #fff;
}

.fd-pr-continue:disabled {
    border-color: #b4b7bf;
    background: #b4b7bf;
    cursor: not-allowed;
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-question {
    margin-top: 27px;
    margin-bottom: 17px;
    margin-right: 10px;
    text-align: start;
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-question h1 {
    font-size: 16px;
    line-height: 30px;
    margin-bottom: 7px;
    text-align: center;
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-question p {
    max-width: 315px;
    margin-inline-start: auto;
    font-size: 12px;
    line-height: 1.65;
}

.fd-pr-tax-declaration {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 10px;
    margin: 17px 0 0 43px;
    direction: ltr;
    color: #171717;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
    cursor: pointer;
}

.fd-pr-tax-declaration input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.fd-pr-tax-declaration > span {
    flex: 1 1 auto;
    direction: rtl;
    text-align: right;
}

.fd-profile-reference-step[dir="ltr"] .fd-pr-tax-declaration > span {
    direction: ltr;
    text-align: left;
}

.fd-pr-tax-declaration > i {
    display: grid;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    place-items: center;
    border: 1px solid #16bf8a;
    border-radius: 50%;
    color: transparent;
    font: 700 11px/1 Arial, sans-serif;
}

.fd-pr-tax-declaration:has(input:checked) > i {
    border-color: #16bf8a;
    background: #16bf8a;
    color: #fff;
}

.fd-pr-tax-declaration:focus-within {
    outline: 2px solid #88e2c2;
    outline-offset: 3px;
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-actions {
    right: 12px;
    left: 19px;
    bottom: 49px;
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-header > a {
    right: 24px;
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-header > strong {
    font-size: 18.5px;
    transform: translate(10px, 0);
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-header {
    border-bottom: 0;
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-header::after {
    position: absolute;
    right: 0;
    bottom: -7px;
    left: 0;
    height: 1px;
    background: #d9dddc;
    content: "";
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-actions button {
    font-size: 22px;
}

.fd-profile-reference-step[data-profile-step="tax"] .fd-pr-step-dots {
    gap: 12px;
}

@media (max-height: 700px) {
    .fd-profile-reference-step {
        min-height: 656px;
    }

    .fd-pr-step-actions,
    .fd-pr-step-dots {
        position: static;
        margin-top: 26px;
    }
}
