/* Expert sign-up, referral-source sign-up, and the onboarding wizard
   (Views/Accounts/Register, RegisterExpert, ExpertOnboarding*). */

:root {
    --xo-red: #EE402B;
    --xo-red-dark: #D2321E;
    --xo-navy: #1F3A56;
    --xo-text: #1D2733;
    --xo-muted: #6B7785;
    --xo-border: #DCE3EB;
    --xo-panel: #F3F6FA;
    --xo-panel-blue: #EAF2FC;
    --xo-radius: 10px;
}

body:has(.xo-shell) {
    background:
        linear-gradient(160deg, transparent 0 82%, rgba(238, 64, 43, .9) 82% 84%, transparent 84%),
        linear-gradient(200deg, rgba(238, 64, 43, .9) 0 3%, transparent 3%),
        #FCEFEF;
    background-attachment: fixed;
    min-height: 100vh;
}

.xo-shell {
    font-family: "Mulish", sans-serif;
    color: var(--xo-text);
    padding: 2rem 1rem 3rem;
    display: flex;
    justify-content: center;
}

.xo-card {
    width: 100%;
    max-width: 760px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(31, 58, 86, .12);
    padding: 1.75rem 2rem 2rem;
}

.xo-card--narrow { max-width: 520px; }

@media (max-width: 575.98px) {
    .xo-card { padding: 1.25rem 1rem 1.5rem; }
}

/* ---------- Header ---------- */

.xo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.xo-logo { height: 30px; width: auto; }
.xo-logo--center { display: block; margin: 0 auto; height: 36px; }

.xo-save-exit {
    border: 0;
    background: none;
    color: var(--xo-navy);
    font-weight: 700;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .5rem;
    border-radius: 6px;
}

.xo-save-exit:hover { background: var(--xo-panel); }

.xo-title {
    text-align: center;
    font-weight: 800;
    font-size: 1.35rem;
    margin: .75rem 0 0;
}

/* ---------- Progress ---------- */

.xo-progress {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0 .5rem;
}

.xo-progress__track {
    flex: 1;
    height: 10px;
    background: #E9EDF2;
    border-radius: 999px;
    overflow: hidden;
}

.xo-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--xo-red), #F2705F);
    border-radius: 999px;
    transition: width .35s ease;
}

.xo-progress__label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--xo-muted);
    white-space: nowrap;
    min-width: 92px;
    text-align: right;
}

/* ---------- Stepper ---------- */

.xo-stepper {
    list-style: none;
    display: flex;
    justify-content: space-between;
    padding: 0;
    margin: 1rem 0 1.25rem;
    position: relative;
}

.xo-stepper::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 8%;
    right: 8%;
    height: 2px;
    background: var(--xo-border);
}

.xo-stepper__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    position: relative;
    text-align: center;
    min-width: 0;
    padding: 0 2px;
}

.xo-stepper__circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--xo-border);
    background: #fff;
    color: var(--xo-muted);
    font-weight: 800;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.xo-stepper__label {
    font-size: .7rem;
    color: var(--xo-muted);
    line-height: 1.15;
    max-width: 100%;
}

.xo-stepper__item.is-done .xo-stepper__circle {
    border-color: var(--xo-navy);
    color: var(--xo-navy);
    cursor: pointer;
}

.xo-stepper__item.is-active .xo-stepper__circle {
    background: var(--xo-navy);
    border-color: var(--xo-navy);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(31, 58, 86, .15);
}

.xo-stepper__item.is-active .xo-stepper__label {
    color: var(--xo-navy);
    font-weight: 800;
}

@media (max-width: 575.98px) {
    .xo-stepper__label { display: none; }
}

/* ---------- Panels & fields ---------- */

.xo-panel {
    background: var(--xo-panel);
    border: 1px solid var(--xo-border);
    border-radius: var(--xo-radius);
    padding: 1.25rem 1.25rem 1.5rem;
}

.xo-panel + .xo-panel { margin-top: 1rem; }

.xo-panel__title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 1rem;
}

.xo-panel__subtitle {
    font-size: .95rem;
    font-weight: 800;
    margin: 1.25rem 0 .75rem;
}

.xo-shell .form-label,
.xo-question {
    font-size: .85rem;
    font-weight: 700;
    color: var(--xo-text);
    margin-bottom: .35rem;
}

.xo-question { display: block; }

.xo-req { color: var(--xo-red); margin-left: 2px; }

.xo-hint {
    font-size: .78rem;
    color: var(--xo-muted);
    margin-top: .25rem;
}

.xo-shell .form-control,
.xo-shell .form-select {
    border-color: var(--xo-border);
    border-radius: 8px;
    font-size: .9rem;
    padding: .55rem .75rem;
    background-color: #fff;
}

.xo-shell .form-control:focus,
.xo-shell .form-select:focus {
    border-color: var(--xo-navy);
    box-shadow: 0 0 0 .2rem rgba(31, 58, 86, .12);
}

.xo-shell .form-control::placeholder,
.xo-shell textarea::placeholder {
    color: #b7c0cc;
    opacity: 1;
}

.xo-shell .form-select:required:invalid {
    color: #b7c0cc;
}

.xo-shell .form-select option {
    color: var(--xo-text);
}

.xo-shell .select2-container--default .select2-selection__placeholder {
    color: #b7c0cc;
}

.xo-shell .form-control.is-invalid,
.xo-shell .form-select.is-invalid { border-color: #dc3545; }

.xo-field { margin-bottom: 1rem; }

.xo-info {
    border: 0;
    background: none;
    padding: 0 .15rem;
    margin-left: .15rem;
    color: var(--xo-muted);
    font-size: .8rem;
    line-height: 1;
    vertical-align: baseline;
    cursor: help;
}

.xo-info:hover,
.xo-info:focus-visible { color: var(--xo-navy); }

.xo-inline-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.xo-inline-question .xo-question { margin-bottom: 0; }

.xo-inline-question .xo-yesno { flex: none; }

.xo-yesno {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.xo-yesno .form-check { margin: 0; }

@media (max-width: 575.98px) {
    .xo-inline-question { align-items: flex-start; flex-direction: column; gap: .4rem; }
}

.xo-shell .form-check-input:checked {
    background-color: var(--xo-navy);
    border-color: var(--xo-navy);
}

.xo-checkgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem 1.25rem;
}

@media (max-width: 575.98px) {
    .xo-checkgrid { grid-template-columns: 1fr; }
}

.xo-checkgrid .form-check-label,
.xo-check .form-check-label { font-size: .88rem; }

.xo-input-suffix { position: relative; }
.xo-input-suffix .form-control { padding-right: 2rem; }
.xo-input-suffix::after {
    content: attr(data-suffix);
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--xo-muted);
    font-size: .85rem;
}

.xo-conditional[hidden] { display: none !important; }

.xo-callout {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    background: var(--xo-panel-blue);
    border-radius: 8px;
    padding: .75rem .9rem;
    font-size: .85rem;
    color: var(--xo-navy);
}

/* Repeating rows (licences, team members, service regions) */
.xo-repeat-row {
    background: #fff;
    border: 1px solid var(--xo-border);
    border-radius: 8px;
    padding: .75rem;
    margin-bottom: .75rem;
    position: relative;
}

.xo-repeat-row__remove {
    position: absolute;
    top: .4rem;
    right: .4rem;
    border: 0;
    background: none;
    color: var(--xo-muted);
    font-size: 1rem;
    line-height: 1;
    padding: .25rem;
}

.xo-repeat-row__remove:hover { color: var(--xo-red); }

/* Extra phone numbers match the primary number row: no card, no field labels. */
.xo-repeat-row--phone {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: .5rem;
}

.xo-repeat-row--phone .xo-repeat-row__remove {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.375rem;
    height: 2.375rem;
    padding: 0;
}

.xo-add-btn {
    border: 1px solid var(--xo-border);
    background: #fff;
    color: var(--xo-navy);
    font-weight: 700;
    font-size: .85rem;
    border-radius: 8px;
    padding: .5rem .9rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.xo-add-btn:hover { border-color: var(--xo-navy); }

.xo-duration-table {
    border: 1px solid var(--xo-border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.xo-duration-table__head,
.xo-duration {
    display: grid;
    grid-template-columns: minmax(8rem, 1.15fr) minmax(9.5rem, 1fr) minmax(9.5rem, 1fr);
    gap: .5rem .75rem;
    align-items: center;
}

.xo-duration-table__head {
    padding: .55rem .8rem;
    background: var(--xo-panel);
    border-bottom: 1px solid var(--xo-border);
    color: var(--xo-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.xo-duration-table__head span { text-align: center; }
.xo-duration-table__head span:first-child { text-align: left; }

.xo-duration {
    padding: .6rem .8rem;
    border-bottom: 1px solid var(--xo-border);
    margin: 0;
    background: transparent;
}

.xo-duration:last-child { border-bottom: 0; }

.xo-duration__name {
    font-weight: 700;
    font-size: .88rem;
    line-height: 1.3;
}

.xo-duration__label { display: none; }

.xo-duration__clock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    min-height: 2.4rem;
    padding: .15rem .55rem;
    border: 1px solid var(--xo-border);
    border-radius: 8px;
    background: #fff;
}

.xo-duration__clock:focus-within {
    border-color: var(--xo-navy);
    box-shadow: 0 0 0 .2rem rgba(31, 58, 86, .12);
}

.xo-duration__clock input {
    width: 1.7rem;
    border: 0;
    background: transparent;
    padding: .15rem 0;
    text-align: center;
    font: inherit;
    font-weight: 700;
    font-size: .9rem;
    color: var(--xo-text);
    box-shadow: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.xo-duration__clock input:focus { outline: none; }

.xo-duration__clock input::placeholder {
    color: #b7c0cc;
    font-weight: 600;
}

.xo-duration__clock input::-webkit-outer-spin-button,
.xo-duration__clock input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.xo-duration__clock span {
    color: var(--xo-muted);
    font-size: .75rem;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .xo-duration-table__head { display: none; }

    .xo-duration {
        grid-template-columns: 1fr;
        gap: .4rem;
    }

    .xo-duration__label {
        display: block;
        margin-bottom: .2rem;
        color: var(--xo-muted);
        font-size: .72rem;
        font-weight: 800;
        letter-spacing: .02em;
        text-transform: uppercase;
    }
}

.xo-timeline {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(10rem, 14rem);
    gap: .5rem .75rem;
    align-items: center;
    margin-top: .55rem;
}

.xo-timeline__name {
    margin: 0;
    font-weight: 700;
    font-size: .88rem;
    line-height: 1.3;
}

@media (max-width: 575.98px) {
    .xo-timeline { grid-template-columns: 1fr; gap: .3rem; }
}

.xo-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .5rem;
}

.xo-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--xo-panel-blue);
    color: var(--xo-navy);
    border-radius: 999px;
    padding: .25rem .65rem;
    font-size: .8rem;
    font-weight: 700;
}

.xo-chip button {
    border: 0;
    background: none;
    color: inherit;
    padding: 0;
    line-height: 1;
}

/* Select2 alignment with the form controls */
.xo-shell .select2-container { width: 100% !important; }
.xo-shell .select2-container--default .select2-selection--single,
.xo-shell .select2-container--default .select2-selection--multiple {
    border-color: var(--xo-border);
    border-radius: 8px;
    min-height: 40px;
}
.xo-shell .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; font-size: .9rem; }
.xo-shell .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
.xo-shell .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--xo-panel-blue);
    border: 0;
    color: var(--xo-navy);
    font-weight: 700;
    font-size: .8rem;
    border-radius: 999px;
}

/* ---------- Documents ---------- */

.xo-doc-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--xo-border);
}

.xo-doc-row:last-child { border-bottom: 0; }

.xo-doc-row__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #FDECEA;
    color: var(--xo-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.xo-doc-row__body { flex: 1; min-width: 0; }
.xo-doc-row__title { font-weight: 700; font-size: .9rem; }
.xo-doc-row__desc { font-size: .78rem; color: var(--xo-text); }
.xo-doc-row__files { font-size: .78rem; color: var(--xo-muted); word-break: break-word; }
.xo-doc-row__files .is-new { color: #198754; font-weight: 700; }

.xo-file-btn {
    border: 1px solid var(--xo-border);
    background: #fff;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 700;
    padding: .4rem .75rem;
    white-space: nowrap;
    cursor: pointer;
    margin: 0;
}

.xo-file-btn:hover { border-color: var(--xo-navy); }

/* ---------- Review ---------- */

.xo-review-item {
    border-bottom: 1px solid var(--xo-border);
}

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

.xo-review-item__head {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 0;
}

.xo-review-item__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #FDECEA;
    color: var(--xo-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.xo-review-item__toggle {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    text-align: left;
    padding: 0;
    color: inherit;
}

.xo-review-item__title { font-weight: 800; font-size: .9rem; display: block; }
.xo-review-item__preview { font-size: .78rem; color: var(--xo-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.xo-review-item__edit {
    border: 0;
    background: none;
    color: #2F6FD6;
    font-weight: 700;
    font-size: .85rem;
    padding: .25rem .5rem;
}

.xo-review-item__details {
    margin: 0 0 .75rem 44px;
    font-size: .82rem;
}

.xo-review-item__details dt { color: var(--xo-muted); font-weight: 600; }
.xo-review-item__details dd { margin: 0 0 .4rem; word-break: break-word; }

.xo-missing {
    border: 1px solid #F5C2C7;
    background: #FFF5F5;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .85rem;
    margin-top: 1rem;
}

.xo-missing button {
    border: 0;
    background: none;
    color: #2F6FD6;
    padding: 0;
    font-weight: 700;
    text-decoration: underline;
}

/* ---------- Navigation ---------- */

.xo-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.xo-back {
    border: 0;
    background: none;
    color: var(--xo-text);
    font-weight: 700;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .25rem;
}

.xo-btn {
    border: 0;
    background: var(--xo-red);
    color: #fff;
    font-weight: 800;
    border-radius: 999px;
    padding: .65rem 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    box-shadow: 0 6px 16px rgba(238, 64, 43, .3);
    text-decoration: none;
    transition: background .15s ease;
}

.xo-btn:hover,
.xo-btn:focus { background: var(--xo-red-dark); color: #fff; }
.xo-btn:disabled { opacity: .65; }
.xo-btn--block { width: 100%; justify-content: center; }

.xo-btn--outline {
    background: #fff;
    color: var(--xo-text);
    border: 1.5px solid var(--xo-text);
    box-shadow: none;
}

.xo-btn--outline:hover,
.xo-btn--outline:focus { background: var(--xo-panel); color: var(--xo-text); }

.xo-alert {
    border-radius: 8px;
    font-size: .85rem;
    margin-top: 1rem;
    line-height: 1.4;
}

.xo-alert ul {
    margin: .45rem 0 0;
    padding-left: 1.15rem;
    max-height: 14rem;
    overflow: auto;
}

.xo-alert li {
    list-style: disc;
    margin: 0;
    padding: .28rem 0;
    line-height: 1.4;
}

/* ---------- Welcome pages ---------- */

.xo-welcome__heading {
    text-align: center;
    font-weight: 900;
    font-size: 1.9rem;
    line-height: 1.2;
    margin: 1.25rem 0 .5rem;
}

.xo-welcome__lead {
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: .75rem;
}

.xo-welcome__text {
    text-align: center;
    color: #3D4855;
    font-size: .95rem;
    margin: 0 auto 1.25rem;
    max-width: 520px;
}

.xo-need {
    background: var(--xo-panel-blue);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
}

.xo-need h2,
.xo-important h2 {
    font-size: 1.1rem;
    font-weight: 900;
    margin: 0 0 .75rem;
}

.xo-need ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.xo-need li {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: .45rem 0;
    font-size: .92rem;
}

.xo-need li i {
    color: var(--xo-navy);
    font-size: 1.3rem;
    line-height: 1;
}

.xo-important {
    background: #FDECEA;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.xo-important h2 { color: var(--xo-red); display: flex; align-items: center; gap: .5rem; }

.xo-important ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: .9rem;
}

.xo-feature {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.xo-feature__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FDECEA;
    color: var(--xo-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.xo-feature h3 { font-size: .95rem; font-weight: 800; margin: 0 0 .15rem; }
.xo-feature p { font-size: .85rem; color: var(--xo-muted); margin: 0; }

/* ---------- Submitted ---------- */

.xo-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #E3F4EA;
    color: #1E9E58;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: .5rem auto 1rem;
}

.xo-next-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.xo-next-steps li {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .45rem 0;
    font-size: .9rem;
}

.xo-next-steps li span {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--xo-navy);
    color: var(--xo-navy);
    font-weight: 800;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---------- Password toggle ---------- */

.xo-password { position: relative; }
.xo-password .form-control { padding-right: 2.5rem; }
.xo-password button {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: var(--xo-muted);
}
