/* =========================================================
   Mobile step-page chrome (verify-number / phone-verification / ...).
   Shared so every wizard page keeps the same back + progress + language bar.
   ========================================================= */
.mobile-page {
    width: 100%;
    max-width: 520px;
    min-height: 100dvh;
    margin-inline: auto;
    padding: 16px clamp(16px, 5vw, 40px) 48px;
    background: var(--brand-bg);
    color: #000;
    font-family: var(--font-body);
    font-weight: 400;
}

.mobile-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 24px;
}

.mobile-top .back-button {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;
    cursor: pointer;
    z-index: 1;
}

.mobile-top .back-button.is-rtl svg {
    transform: scaleX(-1);
}

.step-progress {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 139px;
    height: 4px;
    overflow: hidden;
    border-radius: 50px;
    background: rgb(0 0 0 / 15%);
}

.step-progress__fill {
    height: 100%;
    border-radius: inherit;
    background: var(--brand-progress, #c0903b);
    transition: width 0.25s ease;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 56px;
}

.page-title {
    margin: 0;
    color: #00364a;
    font-size: 20px;
    font-weight: 700;
    line-height: 22px;
}

.page-description {
    margin: 0;
    color: #686262;
    font-size: 13px;
    line-height: 20px;
}

.next-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    margin-top: 56px;
    padding: 8px 16px;
    border: 0;
    border-radius: 4px;
    background: linear-gradient(112deg, #00364a, #015270);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    cursor: pointer;
}

.next-button:disabled {
    opacity: 0.7;
    cursor: default;
}

.mobile-alert {
    padding: 10px 12px;
    border-radius: 6px;
    background: #fdecea;
    color: #b02a37;
    font-size: 13px;
    line-height: 17px;
    text-align: center;
}

/* OTP pills + resend meta (shared by the phone/email verification pages) */
.otp-pills {
    display: flex;
    justify-content: center;
    margin-top: 56px;
}

.otp-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 28px;
}

.otp-resend {
    border: 0;
    background: transparent;
    padding: 0;
    color: #b1b1b1;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 22px;
    cursor: pointer;
}

.otp-resend--active {
    color: #00364a;
}

.otp-resend:disabled {
    cursor: default;
}

.otp-note {
    width: 201px;
    color: #000;
    font-size: 13px;
    font-weight: 400;
    line-height: 22px;
    text-align: center;
}

/* =========================================================
   Brand theme variables (toggle via body.theme-dal / body.theme-alnile) ---- */
body.theme-alnile, :root {
    --brand-primary: #324f73;
    --brand-secondary: #FFB600;
    --brand-header-bg: #324f73;
    --brand-accent: #EE863B;
    --brand-accent-hover: #d67835;
}
body.theme-dal {
    --brand-primary: #324F73;
    --brand-secondary: #EE863B;
    --brand-header-bg: #19385B;
    --brand-accent: #EE863B;
    --brand-accent-hover: #d67835;
}
body.theme-alkhaleej {
    --brand-primary: #00364A;
    --brand-secondary: #D49B30;
    --brand-header-bg: #00364A;
    --brand-accent: #D49B30;
    --brand-accent-hover: #b98620;
}
/* Stitch tokens (applied to every theme so the identity renders regardless of Theme:Name) */
:root {
    --brand-bg: #f8f9ff;
    --brand-surface-low: #eff4ff;
    --brand-surface-high: #dce9ff;
    --brand-outline: #94A3B8;
    --brand-outline-soft: #E2E8F0;
    --brand-text: #0b1c30;
    --brand-text-muted: #43474e;
    --brand-success: #15803D;
    --brand-pending: #B45309;
    --brand-progress: var(--brand-primary);
    --font-headline: "Optima", "Optima Nova", "Candara", "Segoe UI", Tahoma, sans-serif;
    --font-body: "Optima", "Optima Nova", "Candara", "Segoe UI", Tahoma, sans-serif;
}
/* Arabic: GE Dinar Two Medium for headings, GE Dinar Two Light for body copy. */
body.ar {
    --font-headline: "GE Dinar Two Medium", "GE Dinar Two", "Alexandria", "Noto Sans Arabic", Tahoma, sans-serif;
    --font-body: "GE Dinar Two Light", "GE Dinar Two", "Alexandria", "Noto Sans Arabic", Tahoma, sans-serif;
}
body {
    font-family: var(--font-body);
    color: var(--brand-text);
}

html {
    font-size: 13px;
}
/*body {
    font-family: 'Noto Sans',Roboto ,Tahoma, Geneva, Verdana, sans-serif;
}*/
/*  body.en-us {
        font-family: "Noto Sans", sans-serif;
    }*/
/*
    body.ar {
        font-family: "Noto Sans Arabic", sans-serif;
    }*/

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

html, body {
    overscroll-behavior: none;
}

.mobile-hight {
    height: 48px !important;
}

.ellipse-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* Space between shapes */
}

.ellipse {
    background-color: var(--brand-primary); /* Green color */
    width: 40px; /* Length of the ellipse */
    height: 10px; /* Height of the ellipse */
    border-radius: 20px; /* Rounded edges */
}

.circle {
    background-color: var(--brand-secondary); /* Brand accent color */
    width: 10px; /* Diameter of the circle */
    height: 10px;
    border-radius: 50%; /* Makes it a circle */
}

#mainContent {
    flex: 1;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.verification-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.verification-input {
    width: 56px;
    height: 56px;
    margin: 0 5px;
    text-align: center;
    border: 2px solid #324F73;
    border-radius: 8px;
    font-size: 1.25rem;
}

.page-title {
    color: var(--brand-text);
    font-family: var(--font-headline);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.form-control {
    border-radius: 0.375rem;
    border: 1px solid #CBD5E1;
}

.info-box {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background-color: #F8FAFC;
    overflow: auto;
}

.btn-success {
    background-color: #EE863B;
    border: none;
    border-radius: 10px;
    font-weight: 700;
}

    .btn-success:hover {
        background-color: #d67835;
    }

.checklist {
    list-style: none;
    padding: 0;
    margin-bottom: 32px;
}

    .checklist li {
        margin-bottom: 10px;
        display: flex;
        align-items: baseline;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        background-color: white;
        padding: 12px;
        border-radius: 8px;
    }

    .checklist i {
        color: var(--brand-primary);
        /* margin-right: 10px;*/
    }

.sahil-color {
    color: var(--brand-primary);
}

.sahil-color-sec {
    color: var(--brand-secondary);
}

.salam-color {
    color: #324F73;
}

.onb-color {
    color: #324F73;
}

.custom-font-size {
    font-size: 12px;
}

.custom-image {
    width: 75%;
}

@media (max-width: 375px) { /* iPhone SE */

    .custom-font-size {
        font-size: 12px;
    }
}


.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 2px solid var(--brand-primary);
    border-radius: 3px;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    display: inline-block;
    position: relative;
}

    .custom-checkbox:checked {
        background-color: var(--brand-primary);
    }

        .custom-checkbox:checked::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 5px;
            width: 5px;
            height: 10px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

.status-card {
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: none;
    margin-bottom: 10px;
    transition: border-color 0.2s ease;
}

    .status-card i {
        font-size: 1.25rem; /* Adjust icon size */
        color: #D1D1D1;
    }

.cube-status-card {
    padding: 10px 20px;
    border: 1px solid #D1D1D1;
    border-radius: 8px;
    width: 120px;
    height: 120px;
    margin: 10px;
    color: #D1D1D1;
    background-color: #fff;
}

    .cube-status-card i {
        font-size: 3rem; /* Adjust icon size */
    }

.status-card-sucsses {
    background: #DCCBAD;
}

.status-card-failed {
    background: #F28F8F;
    border: 1px solid #084c2f !important; /* Border color */
}

.status-card-failed-color {
    color: #8F0D00 !important;
}

.selected {
    color: #324F73 !important;
    border-color: #324F73;
    background-color: #F8FAFC;
}

    .selected i {
        color: #324F73 !important;
        border-color: #324F73;
    }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    flex-direction: row;
    background: var(--brand-header-bg);
    color: white;
}

.logo {
    height: 40px; /* Adjust height as needed */
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    direction: rtl
}

.step {
    width: 8px;
    height: 8px;
    background-color: #E2E8F0;
    border-radius: 9999px;
    z-index: 1;
    margin: 2px;
    transition: background-color 0.2s ease;
}

.connector {
    height: 2px;
    flex: 1;
    min-width: 8px;
    background-color: #E2E8F0;
    border-radius: 9999px;
    margin: 0 2px;
}

.step-completed {
    background-color: #324F73;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 9999px;
}

    .step-completed i,
    .step-completed .material-symbols-outlined {
        font-size: 12px;
    }

.step-active {
    background-color: #EE863B;
    width: 20px;
    height: 20px;
    border-radius: 9999px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .step-active .fs-5 {
        font-size: 12px !important;
    }

.custom-button {
    background: var(--brand-accent);
    border: none;
    color: white;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-body);
    border-radius: 4px;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.15);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

    .custom-button:active {
        background: var(--brand-accent-hover);
    }

    .custom-button:disabled {
        background: #F1F1F1;
        color: #B1B1B1;
        box-shadow: none;
    }

.custom-button-light {
    background: white;
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-body);
    border-radius: 4px;
    box-shadow: none;
    transition: background 0.2s ease;
}

    .custom-button-light:active {
        background: #EFF4FF;
    }

    .custom-button-light:disabled {
        background: #F1F1F1;
        color: #B1B1B1;
        box-shadow: none;
    }

.camera-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    /* Force the video onto its own compositing layer on iOS WebKit: the
       faceid preview video (.preview-video) has a transform + will-change
       and never shows the white-preview bug on the same iPhones, while a
       bare absolutely-positioned object-fit video does. translateZ(0) is a
       visual no-op on other browsers. */
    transform: translateZ(0);
    will-change: transform;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.scan-area {
    width: 80%;
    aspect-ratio: 1 / 1.586;
    position: relative;
    z-index: 2;
    /* Use background gradients to create corner borders */
    background: linear-gradient(to right, white 4px, transparent 4px) 0 0, linear-gradient(to right, white 4px, transparent 4px) 0 100%, linear-gradient(to left, white 4px, transparent 4px) 100% 0, linear-gradient(to left, white 4px, transparent 4px) 100% 100%, linear-gradient(to bottom, white 4px, transparent 4px) 0 0, linear-gradient(to bottom, white 4px, transparent 4px) 100% 0, linear-gradient(to top, white 4px, transparent 4px) 0 100%, linear-gradient(to top, white 4px, transparent 4px) 100% 100%;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    padding: 20px; /* Adjust as needed */
    border: 1px dashed #fff;
}
    .scan-area img {
        animation: fadeInOut 3s infinite;
    }

.scan-button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #e0e0e0c2;
    border: none;
    border-radius: 5px;
    z-index: 3;
    width: 50%;
    height: 48px;
}

.layout-container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full view height */
    height: 100dvh; /* Dynamic: tracks the visible viewport incl. mobile toolbars */
    background-color: white;
}

.main-content {
    flex: 1; /* This allows main content to take the remaining space */
    overflow-y: auto; /* Enables vertical scrolling */
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

.sahil-header {
    background: var(--brand-header-bg);
    border-bottom-left-radius: 56px;
    border-bottom-right-radius: 56px;
    padding-bottom: 20px;
}

    .sahil-header .page-title {
        color: #ffffff;
    }

.switch {
    position: relative;
    display: inline-block;
    width: 30px; /* Reduced from 60px to 30px */
    height: 17px; /* Reduced from 34px to 17px */
}

    /* Hide default HTML checkbox */
    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 13px; /* Reduced from 26px to 13px */
        width: 13px; /* Reduced from 26px to 13px */
        left: 2px; /* Reduced for alignment */
        bottom: 2px; /* Reduced for alignment */
        background-color: white;
        -webkit-transition: .4s;
        transition: .4s;
    }

input:checked + .slider {
    background-color: #324F73;
}

input:focus + .slider {
    box-shadow: 0 0 1px #324F73;
}

input:checked + .slider:before {
    -webkit-transform: translateX(13px); /* Reduced from 26px to 13px */
    -ms-transform: translateX(13px); /* Reduced from 26px to 13px */
    transform: translateX(13px); /* Reduced from 26px to 13px */
}

/* Rounded sliders */
.slider.round {
    border-radius: 17px; /* Reduced from 34px to 17px */
}

    .slider.round:before {
        border-radius: 50%;
    }

.form-check-label {
    font-size: 12px;
}
.image-style {
    width: 50%;
    border-radius: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   Stitch visual identity (applied under the "dal" theme)
   ========================================================= */
body.theme-dal {
    background-color: #f8f9ff;
}

body.theme-dal .main-content {
    background-color: #f8f9ff;
}

/* Material Symbols base sizing */
.material-symbols-outlined {
    font-size: 24px;
    line-height: 1;
    vertical-align: middle;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.step-completed .material-symbols-outlined,
.step-active .material-symbols-outlined {
    font-size: 14px;
}

.checklist .material-symbols-outlined {
    font-size: 20px;
    color: var(--brand-primary);
}

/* Welcome / onboarding carousel (Home page) */
body.theme-dal .carousel-item {
    background-color: #f8f9ff;
}

body.theme-dal .carousel-item::before {
    content: "";
    display: block;
    width: 72px;
    height: 72px;
    margin: 48px auto 8px;
    border-radius: 50%;
    background-color: #e5eeff;
    background-image: url("/images/dal-logo.png");
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #dce9ff;
}

body.theme-dal .carousel-item header span {
    color: #324F73;
    font-weight: 600;
}

body.theme-dal .carousel-item h2 {
    font-family: var(--font-headline);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #19385b;
}

body.theme-dal .carousel-item p {
    color: #43474e;
}

body.theme-dal .carousel-indicators button {
    background-color: #324F73;
    width: 8px;
    height: 8px;
    border-radius: 9999px;
}

body.theme-dal .carousel-indicators button.active {
    background-color: #EE863B;
    width: 24px;
}

body.theme-dal .ellipse {
    background-color: #324F73;
}

body.theme-dal .circle {
    background-color: #EE863B;
}

body.theme-dal .layout-container {
    background-color: #f8f9ff;
}

/* VerificationSubmitted card + banner */
body.theme-dal .text-center .card,
body.theme-dal .d-flex.flex-column .card {
    background-color: #19385b;
    border: none;
    border-radius: 20px;
    font-family: var(--font-body);
}

body.theme-dal .text-center .card:not(.status-card-sucsses):not(.status-card-failed) p,
body.theme-dal .text-center .card:not(.status-card-sucsses):not(.status-card-failed) small,
body.theme-dal .text-center .card:not(.status-card-sucsses):not(.status-card-failed) h1,
body.theme-dal .text-center .card:not(.status-card-sucsses):not(.status-card-failed) .lead {
    color: #ffffff;
}

body.theme-dal .card .header-banner {
    background-color: #EE863B;
    color: #ffffff;
}

body.theme-dal .card .sahil-color-sec {
    color: #EE863B;
}

/* Brand header (MainLayout) */
body.theme-dal .header {
    font-family: var(--font-body);
}

/* OTP inputs (AlKhaleej pill style: white, gold border, radius 38) */
.input {
    width: 68px !important;
    height: 40px !important;
    border: 1px solid #C0903B !important;
    margin: 0 5px !important;
    text-align: center !important;
    font-size: 20px !important;
    border-radius: 38px !important;
    background: #FFFFFF !important;
    color: #000000 !important;
}

    .input:focus {
        border: 1px solid #00364A !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(0, 54, 74, 0.15) !important;
    }

/* Custom select (Userinfo) */
.custom-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("/images/arrowdown.svg");
    background-repeat: no-repeat;
    background-position: 1% center;
    background-size: 1em auto;
    padding-left: 2rem;
    direction: rtl;
}

/* Modal (VerifyNumber country list) */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(11, 28, 48, 0.16);
}

.modal-body li {
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

    .modal-body li:hover {
        background-color: #F8FAFC;
    }

/* Status chips */
.status-card-sucsses {
    background: #DCFCE7;
}

.status-card-failed {
    background: #F28F8F;
    border: 1px solid #DC2626 !important;
}

/* Turnstile sizing inside verify-number */
.turnstile-container {
    transform: scale(0.9);
    transform-origin: center;
}

/* =========================================================
   Stitch layout: page composition, headline, cards, actions
   ========================================================= */

.stitch-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    flex: 1;
}

.stitch-page-centered {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.stitch-headline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.stitch-title {
    font-family: var(--font-headline);
    font-size: 20px;
    line-height: 27px;
    letter-spacing: -0.01em;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0;
}
.stitch-title-sm {
    font-family: var(--font-headline);
    font-size: 13px;
    letter-spacing: -0.01em;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0;
}
@media (min-width: 768px) {
    .stitch-title {
        font-size: 26px;
        line-height: 32px;
        letter-spacing: -0.02em;
    }
}

.stitch-subtitle {
    font-size: 14px;
    line-height: 21px;
    font-weight: 400;
    color: var(--brand-text-muted);
    margin: 0;
}

.stitch-subtitle.sahil-color-sec {
    color: var(--brand-secondary);
}

.stitch-label {
    display: block;
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--brand-text);
}

.stitch-note {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    margin: 8px 0 24px;
    background-color: var(--brand-surface-low);
    border-radius: 8px;
}

    .stitch-note .material-symbols-outlined {
        flex-shrink: 0;
        color: var(--brand-primary);
        font-size: 20px;
    }

.stitch-note-text {
    font-size: 13px;
    line-height: 18px;
    color: var(--brand-text-muted);
}

.stitch-card {
    background-color: #ffffff;
    border: 1px solid var(--brand-outline-soft);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

    .stitch-card ol {
        margin: 0;
        padding-inline-start: 20px;
    }

        .stitch-card ol li {
            margin-bottom: 12px;
            line-height: 22px;
            color: var(--brand-text-muted);
        }

.stitch-card-grid {
    margin-bottom: 24px;
    row-gap: 12px;
}

    .stitch-card-grid .doc-card {
        border-radius: 12px;
        cursor: pointer;
    }

.doc-card-icon {
    flex-shrink: 0;
    margin-inline-end: 12px;
    color: var(--brand-primary);
}

.doc-card-check {
    margin-inline-start: 8px;
    display: none;
    color: var(--brand-primary);
}

.status-card.selected .doc-card-check {
    display: inline-flex;
}

.stitch-capture {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    min-height: 220px;
    margin-bottom: 24px;
    padding: 24px;
    background-color: #F8FAFC;
    border: 2px dashed #94A3B8;
    border-radius: 12px;
}

.stitch-capture-icon {
    font-size: 48px;
    font-variation-settings: 'FILL' 1;
    color: #94A3B8;
}

.stitch-capture-title {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--brand-text-muted);
    text-align: center;
}

.stitch-preview-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 24px;
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid var(--brand-outline-soft);
    border-radius: 12px;
}

.stitch-preview-img {
    max-height: 320px;
    object-fit: contain;
    border-radius: 8px;
}

.stitch-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 40px;
}

/* App bar + progress (MainLayout) */
.stitch-appbar {
    padding: 12px 20px 20px;
    background-color: var(--brand-bg);
}

.stitch-appbar-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stitch-appbar-left {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.stitch-appbar-brand {
    font-family: var(--font-headline);
    font-size: 20px;
    line-height: 28px;
    font-weight: 700;
    color: var(--brand-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stitch-appbar-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.stitch-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

.stitch-progress-meta {
    display: flex;
    justify-content: flex-end;
}

.stitch-caption {
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    color: var(--brand-primary);
    letter-spacing: 0.05em;
}

.stitch-progress-track {
    width: 100%;
    height: 4px;
    background-color: #E2E8F0;
    border-radius: 9999px;
    overflow: hidden;
}

.stitch-progress-fill {
    height: 100%;
    background-color: var(--brand-primary);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

@media (min-width: 768px) {
    .stitch-appbar {
        padding: 16px 24px 20px;
    }

    .stitch-page {
        padding: 32px 24px 48px;
    }
}

/* Home welcome (Stitch welcome layout) */
.stitch-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    width: 100%;
    max-width: 440px;
    margin: 24px auto 0;
}

.stitch-welcome-logo {
    width: 128px;
    height: 128px;
    border-radius: 20%;
    background-color: var(--brand-surface-low);
    border: 1px solid var(--brand-surface-high);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(11, 28, 48, 0.04);
}

.stitch-welcome-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stitch-welcome-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    text-align: start;
}

.stitch-step-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid var(--brand-outline-soft);
    border-radius: 12px;
}

.stitch-step-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 20%;
    background-color: var(--brand-surface-high);
    color: var(--brand-primary);
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stitch-step-title {
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--brand-text);
}

/* Stitch form select fields (boxed, replacing inline underline border) */
.stitch-select {
    border: 1px solid #CBD5E1 !important;
    border-radius: 8px !important;
    background-color: #ffffff;
}

.stitch-select:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(50, 79, 115, 0.15);
    outline: none;
}

/* =========================================================
   Stitch layout overrides: full page structure + spacing
   ========================================================= */

.layout-container {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--brand-bg);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding-top: 81px;
    background: var(--brand-bg);
}

.main-content-no-header {
    padding-top: 0;
}

.stitch-shell-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--brand-bg);
}

.stitch-shell-progress-track,
.stitch-shell-progress-fill {
    height: 4px;
}

.stitch-shell-progress-track {
    width: 100%;
    background: #E2E8F0;
}

.stitch-shell-progress-fill {
    background: var(--brand-primary);
    border-radius: 9999px;
    transition: width 0.25s ease;
}

.stitch-shell-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 0 20px;
}

/* Centered progress pill inside the header bar, next to/around the back arrow. */
.stitch-shell-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 139px;
    height: 4px;
    overflow: hidden;
    border-radius: 50px;
    background: rgb(0 0 0 / 15%);
    pointer-events: none;
}

.stitch-shell-progress__fill {
    height: 100%;
    border-radius: inherit;
    background: var(--brand-progress);
    transition: width 0.25s ease;
}

/* Start page only: progress sits as a full-width strip on top of the toggles,
   with an 8px gap; the bar keeps only the theme/language toggles. */
.stitch-shell-header--home {
    padding-top: calc(8px + env(safe-area-inset-top));
}

.stitch-shell-header--home .stitch-shell-progress {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    width: auto;
    height: 4px;
    margin-inline: 20px;
    margin-bottom: 8px;
}

.main-content--home {
    padding-top: calc(84px + env(safe-area-inset-top));
}

.stitch-shell-brand-group,
.stitch-shell-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stitch-shell-brand-group {
    min-width: 0;
    flex: 1 1 auto;
}

.stitch-shell-brand {
    font-family: var(--font-headline);
    font-size: 20px;
    line-height: 28px;
    font-weight: 700;
    color: var(--brand-primary);
}

.stitch-shell-step,
.stitch-shell-step-mobile {
    color: var(--brand-text-muted);
    font-size: 12px;
    line-height: 16px;
}

.stitch-shell-step-mobile {
    display: none;
}

.stitch-footer-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 20px 40px;
    color: var(--brand-text-muted);
    background: var(--brand-bg);
}

.stitch-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    gap: 24px;
}

.stitch-page-centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stitch-page-welcome {
    min-height: calc(100vh - 81px);
    justify-content: center;
}

.stitch-headline {
    margin-bottom: 0;
}

.stitch-headline-centered {
    text-align: center;
    align-items: center;
}

.stitch-subtitle-large {
    max-width: 32rem;
    font-size: 18px;
    line-height: 26px;
}

.stitch-state-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    width: 100%;
    border: 1px solid var(--brand-outline-soft);
    border-radius: 16px;
    background: #fff;
}

.stitch-form-shell,
.stitch-otp-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stitch-form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stitch-field-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stitch-input-shell,
.stitch-phone-input {
    position: relative;
}

.stitch-text-input,
.stitch-phone-input .form-control,
.form-control.mobile-hight,
.custom-select.mobile-hight {
    min-height: 48px;
    background: #fff;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(11, 28, 48, 0.04);
}

.stitch-text-input:focus,
.stitch-phone-input .form-control:focus,
.custom-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(50, 79, 115, 0.15);
}

.stitch-country-code {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    cursor: pointer;
    color: var(--brand-text);
}

.stitch-country-divider {
    display: inline-block;
    width: 1px;
    height: 24px;
    margin-left: 8px;
    background: #CBD5E1;
}

.stitch-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 20px;
}

.stitch-alert-danger {
    color: #93000a;
    background: #ffdad6;
    border: 1px solid #f2b8b5;
}

.stitch-actions {
    margin-top: 0;
}

.stitch-actions-wide {
    width: 100%;
    max-width: 440px;
    align-self: center;
}

.stitch-actions-compact {
    margin-top: -8px;
}

.custom-button,
.custom-button-light
 {
    min-height: 48px;
    border-radius: 4px;
}

.custom-button-light {
    background: #fff;
}

.stitch-powered-by {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    align-self: center;
    color: var(--brand-text-muted);
    font-size: 12px;
    line-height: 16px;
}

.stitch-welcome-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 440px;
    align-self: center;
}

.stitch-welcome-logo {
    width: 128px;
    height: 128px;
    padding: 16px;
    border-radius: 20px;
    background: var(--brand-surface-low);
    border: 1px solid var(--brand-surface-high);
}

.stitch-welcome-steps {
    gap: 12px;
}

.stitch-step-card {
    align-items: start;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--brand-outline-soft);
    background: #fff;
}

.stitch-step-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stitch-step-copy,
.stitch-capture-copy {
    color: var(--brand-text-muted);
    font-size: 14px;
    line-height: 20px;
}

.stitch-document-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stitch-document-grid-wide {
    grid-column: 1 / -1;
}

.status-card.doc-card {
    max-width: none;
    min-height: 104px;
    margin-bottom: 0;
    padding: 16px;
    flex-direction: column;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px;
    text-align: center;
    border-radius: 12px;
}

.doc-card-icon {
    margin-inline-end: 0;
    font-size: 32px;
}

.doc-card-check {
    margin-inline-start: 0;
}

.stitch-capture {
    min-height: 220px;
    margin-bottom: 0;
}

.stitch-capture-copy {
    text-align: center;
    margin: 0;
}

.stitch-guidance-card {
    padding: 16px;
    border: 1px solid var(--brand-outline-soft);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.05);
}

.stitch-guidance-title {
    margin: 0 0 12px;
    color: var(--brand-text);
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stitch-guidance-list {
    margin: 0;
}

.stitch-guidance-list li {
    gap: 12px;
    margin-bottom: 12px;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.stitch-guidance-list li:last-child {
    margin-bottom: 0;
}

.stitch-guidance-list-tight li {
    align-items: flex-start;
}

.stitch-preview-card {
    margin-bottom: 0;
}

.stitch-selfie-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.stitch-selfie-frame {
    width: min(320px, 100%);
    aspect-ratio: 1;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 4px solid var(--brand-surface-high);
    background: var(--brand-surface-low);
    box-shadow: 0 12px 24px rgba(11, 28, 48, 0.08);
}

.stitch-selfie-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.75rem;
}

.stitch-inline-tip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--brand-surface-low);
    color: var(--brand-primary);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.stitch-otp-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 20px;
    border: 1px solid var(--brand-outline-soft);
    border-radius: 16px;
    background: #fff;
}

.stitch-otp-inputs {
    display: flex;
    justify-content: center;
}

.stitch-otp-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stitch-resend-link {
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.stitch-resend-timer {
    color: var(--brand-text-muted);
}

.stitch-face-frame-shell {
    min-height: 100dvh;
    background: var(--brand-bg);
}

.stitch-camera-screen {
    position: relative;
    min-height: 100dvh;
    background: #0b1c30;
    overflow: hidden;
}

/*.camera-view {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}*/

.stitch-camera-overlay {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 32px 20px 40px;
    background: rgba(11, 28, 48, 0.45);
}

.stitch-camera-copy {
    color: #fff;
    text-align: center;
}

.stitch-camera-title {
    margin: 0 0 8px;
    font-family: var(--font-headline);
    font-size: 20px;
    line-height: 27px;
    font-weight: 700;
}

.stitch-camera-subtitle {
    margin: 0;
    font-size: 15px;
    line-height: 22px;
    color: rgba(255, 255, 255, 0.82);
}

.stitch-camera-frame-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/*.scan-area,
.stitch-camera-frame {
    width: min(100%, 360px);
    aspect-ratio: 1 / 1.586;
    padding: 24px;
    border: 2px dashed rgba(148, 163, 184, 0.95);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.14);
    
    background-image: none;
}*/

.stitch-camera-placeholder {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.55;
}

.stitch-camera-actions {
    display: flex;
    justify-content: center;
}



.stitch-camera-error {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 24px;
    z-index: 4;
    color: #fff;
    text-align: center;
}

@media (max-width: 640px) {
    .stitch-shell-step {
        display: none;
    }

    .stitch-shell-step-mobile {
        display: inline;
    }

    .stitch-document-grid {
        grid-template-columns: 1fr;
    }

    .status-card.doc-card {
        min-height: auto;
        flex-direction: row;
        justify-content: flex-start !important;
        align-items: center !important;
        text-align: start;
    }

    .doc-card-icon {
        font-size: 24px;
        margin-inline-end: 12px;
    }

    .status-card.selected .doc-card-check {
        margin-inline-start: auto;
    }
}

@media (min-width: 768px) {
    .main-content {
        padding-top: 85px;
    }

    .stitch-shell-bar,
    .stitch-page {
        padding-left: 24px;
        padding-right: 24px;
    }

    .stitch-camera-overlay {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* DocumentType page-specific corrections */
.document-type-page {
    width: 100%;
    background: #f8f9ff;
    color: #0b1c30;
}

.document-type-page,
.document-type-page * ,
.document-type-page *::before,
.document-type-page *::after {
    box-sizing: border-box;
}

.document-type-page__content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 28rem;
    min-height: calc(100dvh - 8rem);
    margin: 0 auto;
    padding: 1rem 1.25rem 2.5rem;
    overflow-x: hidden;
}

.document-type-page h2,
.document-type-page h3,
.document-type-page p,
.document-type-page ul,
.document-type-page li {
    margin: 0;
}

.document-type-page ul {
    padding: 0;
    list-style: none;
}

.document-type-page__header {
    margin-bottom: 1.5rem;
}

.document-type-page__title {
    margin-bottom: 0.5rem;
    color: #0b1c30;
    font-family: var(--font-headline);
    font-size: 20px;
    line-height: 27px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.document-type-page__subtitle {
    color: #43474e;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 22px;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.document-type-page__error {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #f2b8b5;
    border-radius: 0.5rem;
    background: #ffdad6;
    color: #93000a;
    font-size: 14px;
    line-height: 20px;
}

.document-type-page__tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-bottom: 24px;
}

.document-type-page__option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 108px;
    max-width: none;
    margin-bottom: 0;
    padding: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.document-type-page__option--wide {
    grid-column: 1 / -1;
}

.document-type-page__option-icon {
    margin-bottom: 8px;
    color: #73777f;
    font-size: 32px;
    line-height: 1;
}

.document-type-page__option-label {
    color: #43474e;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
    overflow-wrap: anywhere;
}

.document-type-page .status-card.document-type-page__option.selected {
    border: 2px solid #324F73;
    background: #F8FAFC;
}

.document-type-page .status-card.document-type-page__option.selected .document-type-page__option-icon,
.document-type-page .status-card.document-type-page__option.selected .document-type-page__option-label {
    color: #324F73;
}

.document-type-page__capture-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 220px;
    margin-bottom: 24px;
    padding: 24px;
    border: 2px dashed #94A3B8;
    border-radius: 12px;
    background: #F8FAFC;
    text-align: center;
}

.document-type-page__capture-icon {
    margin-bottom: 16px;
    color: #94A3B8;
    font-size: 48px;
    line-height: 1;
    font-variation-settings: 'FILL' 1;
}

.document-type-page__capture-title {
    color: #43474e;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.document-type-page__capture-caption {
    margin-top: 4px;
    color: #73777f;
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
}

.document-type-page__guidelines-card {
    width: 100%;
    margin-bottom: 40px;
    padding: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.05);
}

.document-type-page__guidelines-title {
    margin-bottom: 16px;
    color: #0b1c30;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.document-type-page__guidelines-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-type-page__guideline-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.document-type-page__guideline-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 20px;
}

.document-type-page__guideline-icon--good {
    color: #16a34a;
}

.document-type-page__guideline-icon--bad {
    color: #dc2626;
}

.document-type-page__guideline-copy {
    flex: 1;
    color: #43474e;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.document-type-page__actions {
    width: 100%;
    margin-top: auto;
    padding-top: 16px;
}

.document-type-page .document-type-page__button {
    width: 100%;
    min-height: 48px;
    border-radius: 9999px;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: none;
    box-shadow: 0 4px 14px 0 rgba(238, 134, 59, 0.39);
}

.document-type-page .document-type-page__button:disabled {
    box-shadow: none;
}

@media (min-width: 768px) {
    .document-type-page__content {
        padding-top: 16px;
        padding-left: 0;
        padding-right: 0;
    }

    .document-type-page__title {
        font-size: 26px;
        line-height: 32px;
        letter-spacing: -0.02em;
    }
}

.wizard-step {
    display: none;
}

    .wizard-step.active {
        display: block;
    }

.wizard-progress {
    text-align: center;
    margin-bottom: 1rem;
}

.wizard-step-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.wizard-step-dots .wizard-dot.circle.done {
    background-color: var(--brand-success, #60A561);
}

.wizard-step-dots .wizard-dot.ellipse.done {
    background-color: var(--brand-success, #60A561);
}

.wizard-step-counter {
    margin: 0.25rem 0 0;
    font-weight: bold;
}

.wizard-nav .custom-button,
.wizard-nav .custom-button-light {
    min-width: 120px;
}

/* =========================================================
   AlKhaleej Bank theme overrides (body.theme-alkhaleej)
   ========================================================= */
body.theme-alkhaleej {
    --brand-home-title: #015270;
    --brand-bg: #fdfdfd;
    --brand-progress: #c0903b;
}

/* Fonts: Optima (Bold headings / regular body) for English; GE Dinar Two
   (Medium headings / Light body) for Arabic. */
body.theme-alkhaleej {
    --font-headline: "Optima", "Optima Nova", "Candara", "Segoe UI", Tahoma, sans-serif;
    --font-body: "Optima", "Optima Nova", "Candara", "Segoe UI", Tahoma, sans-serif;
}
body.theme-alkhaleej.ar {
    --font-headline: "GE Dinar Two Medium", "GE Dinar Two", "Alexandria", "Noto Sans Arabic", Tahoma, sans-serif;
    --font-body: "GE Dinar Two Light", "GE Dinar Two", "Alexandria", "Noto Sans Arabic", Tahoma, sans-serif;
}

/* All primary buttons use the bank's teal gradient (left -> right). */
body.theme-alkhaleej .custom-button {
    background: linear-gradient(90deg, #00364A 0%, #015270 100%);
    box-shadow: 0 4px 14px 0 rgba(1, 82, 112, 0.3);
}
body.theme-alkhaleej .custom-button:active {
    background: linear-gradient(90deg, #00293a 0%, #01445c 100%);
}

/* Neutralise Bootstrap's `.btn` hover color (it turns the white label black). */
body.theme-alkhaleej .btn.custom-button:hover,
body.theme-alkhaleej .btn.custom-button:focus,
body.theme-alkhaleej .btn.custom-button:active,
.btn.custom-button:hover,
.btn.custom-button:focus,
.btn.custom-button:active {
    color: #fff !important;
    background: linear-gradient(90deg, #00364A 0%, #015270 100%);
}

/* =========================================================
   Bottom-anchored primary actions (mobile wizard pages).
   The CTA is pinned to the visible viewport bottom with `position: sticky`
   (rides above the on-screen keyboard via the resizes-content viewport meta),
   and multi-button action containers get an opaque bar so content scrolls
   cleanly beneath them. No bottom page padding, or the flex `margin-top: auto`
   would float the button up away from the real page bottom.
   ========================================================= */
.mobile-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.mobile-page > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* The CTA itself: pinned to the visible bottom on every wizard page. */
.mobile-page > .next-button,
.mobile-page > form > .next-button,
.mobile-page .instruct-page > .next-button,
.stitch-page > .stitch-actions {
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 20;
}

/* Multi-button action groups: opaque bar so content scrolling under is hidden. */
.mobile-page > .stitch-actions,
.stitch-page > .stitch-actions {
    background: var(--brand-bg, #fff);
    padding-top: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

/* Match the bars' full-width background to each page's horizontal padding. */
.mobile-page > .stitch-actions {
    margin-inline: calc(-1 * clamp(16px, 5vw, 40px));
    padding-left: clamp(16px, 5vw, 40px);
    padding-right: clamp(16px, 5vw, 40px);
}

.stitch-page > .stitch-actions {
    margin-inline: -20px;
    padding-left: 20px;
    padding-right: 20px;
}

/* Tips pages (face / signature) keep the CTA centred but at the bottom. */
.mobile-page > .instruct-page {
    flex: 1 1 auto;
    min-height: 0;
}

/* Shell header back arrow (top-left). */
.stitch-shell-bar {
    position: relative;
}

.shell-back-button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin-right: 4px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--brand-primary, currentColor);
    cursor: pointer;
    flex: 0 0 32px;
}

.shell-back-button:hover {
    background: rgb(0 0 0 / 6%);
}

html[dir="rtl"] .shell-back-button svg {
    transform: scaleX(-1);
}

/* Keep the centered progress dot clear of the new back arrow. */
.stitch-shell-progress,
.step-progress {
    pointer-events: none;
}

/* =========================================================
   Field validation states (is-valid / is-invalid)
   `.form-control.mobile-hight` and `.stitch-select` (declared above) reset the
   border / background (shorthand wipes Bootstrap's check / error icon) with the
   same or higher specificity as Bootstrap's `.is-valid` / `.is-invalid`, so the
   colours and icons never showed. Re-assert them with higher specificity.
   ========================================================= */
.form-control.stitch-input.is-valid,
.form-control.mobile-hight.is-valid,
textarea.form-control.stitch-input.is-valid {
    border-color: var(--bs-form-valid-border-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.stitch-input.is-invalid,
.form-control.mobile-hight.is-invalid,
textarea.form-control.stitch-input.is-invalid {
    border-color: var(--bs-form-invalid-border-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

textarea.form-control.stitch-input.is-valid,
textarea.form-control.stitch-input.is-invalid {
    background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem);
}

.form-control.stitch-input.is-valid:focus,
.form-control.mobile-hight.is-valid:focus {
    border-color: var(--bs-form-valid-border-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-success-rgb), 0.25);
}

.form-control.stitch-input.is-invalid:focus,
.form-control.mobile-hight.is-invalid:focus {
    border-color: var(--bs-form-invalid-border-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-danger-rgb), 0.25);
}

/* Selects: .stitch-select forces its border with !important. */
.stitch-select.is-valid {
    border-color: var(--bs-form-valid-border-color) !important;
}

.stitch-select.is-invalid {
    border-color: var(--bs-form-invalid-border-color) !important;
}
/* Language switcher pill (AlKhaleej design) */
.language-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  width: 94px;
  height: 40px;
  padding: 8px;

  border: none;
  border-radius: 56px;
  background: linear-gradient(
    306deg,
    #d69d2f 27.4%,
    #ffdc5d 100%
  );

  color: #000;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0;

  cursor: pointer;
}

.language-button__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* =========================================================
   DARK MODE (html.dark)
   Every surface/colour used across the wizard gets a dark
   counterpart so the whole flow stays readable.
   ========================================================= */
:root {
  /* Semantic palette — scoped Vue styles reference these so dark mode
     flips everywhere without needing per-file overrides. */
  --brand-page: #fdfdfd;
  --brand-surface: #ffffff;
  --brand-body: #000000;
  --brand-heading: #00364a;
  --brand-muted: #686262;
  --brand-gold: #c0903b;
  --brand-teal: #00364a;
  --brand-control-border: #c0903b;
  --brand-radio-border: #c0903b;
  --brand-otp-bg: #ffffff;
  --brand-otp-color: #000000;
  --brand-otp-border: #c0903b;
  --brand-soft-bg: #fdecea;
  --brand-soft-text: #b02a37;
}

html.dark {
  --brand-bg: #141a24;
  --brand-text: #e8edf5;
  --brand-text-muted: #a9b4c5;
  --brand-primary: #86b8de;
  --brand-secondary: #ffd76a;
  --brand-outline: #5b6b82;
  --brand-outline-soft: #2a3445;
  --brand-page: #141a24;
  --brand-surface: #1c2433;
  --brand-body: #e8edf5;
  --brand-heading: #e8edf5;
  --brand-muted: #a9b4c5;
  --brand-gold: #e6b45a;
  --brand-teal: #86b8de;
  --brand-control-border: #d8ad4a;
  --brand-radio-border: #e6b45a;
  --brand-otp-bg: #1c2433;
  --brand-otp-color: #e8edf5;
  --brand-otp-border: #e6b45a;
  --brand-soft-bg: #3a2a2e;
  --brand-soft-text: #ffb4ab;
  color-scheme: dark;
}

html.dark body,
html.dark .layout-container,
html.dark .main-content {
  background: var(--brand-bg);
  color: var(--brand-text);
}

/* Re-assert the dark background variable on the AlKhaleej body (its theme rule
   is `body.theme-alkhaleej { --brand-bg: #fdfdfd }`, which would otherwise win
   for any `var(--brand-bg)` resolved inside the page). */
html.dark body.theme-alkhaleej {
  --brand-bg: #141a24;
  --brand-text: #e8edf5;
  --brand-text-muted: #a9b4c5;
  --brand-primary: #86b8de;
  --brand-page: #141a24;
  --brand-surface: #1c2433;
  --brand-body: #e8edf5;
  --brand-heading: #e8edf5;
  --brand-muted: #a9b4c5;
  --brand-gold: #e6b45a;
  --brand-teal: #86b8de;
  --brand-control-border: #d8ad4a;
  --brand-radio-border: #e6b45a;
  --brand-otp-bg: #1c2433;
  --brand-otp-color: #e8edf5;
  --brand-otp-border: #e6b45a;
  --brand-outline: #5b6b82;
  --brand-outline-soft: #2a3445;
}

/* Apply dark brand text/muted to elements using the alnile hardcoded hues. */
html.dark .page-title,
html.dark .stitch-title,
html.dark .stitch-title-sm,
html.dark .intro__title,
html.dark .instruct-title,
html.dark .pi-title,
html.dark .fatca-title,
html.dark .terms-title,
html.dark .vs-title,
html.dark .stitch-headline .stitch-title {
  color: var(--brand-text);
}

html.dark .page-description,
html.dark .stitch-subtitle,
html.dark .intro__description,
html.dark .instruct-subtitle,
html.dark .vs-subtitle,
html.dark .stitch-guidance-title,
html.dark .stitch-caption,
html.dark .stitch-step-title,
html.dark .stitch-note-text,
html.dark .terms-paragraph {
  color: var(--brand-text-muted);
}

/* Pages that paint their own background. */
html.dark .mobile-page,
html.dark .splash,
html.dark .splash-inner,
html.dark .terms-page,
html.dark .verification-success-page,
html.dark .stitch-page {
  background: var(--brand-bg);
  color: var(--brand-text);
}

/* Cards, inputs, radios, doc tiles. */
html.dark .stitch-preview-card,
html.dark .stitch-card,
html.dark .doc-card,
html.dark .doc-type-card,
html.dark .vs-card,
html.dark .stitch-guidance-card,
html.dark .stitch-state-card,
html.dark .custom-checkbox {
  background: var(--brand-surface);
  border-color: var(--brand-outline);
  color: var(--brand-text);
}

html.dark .phone-field__input,
html.dark .pi-input,
html.dark .email-field__input {
  color: var(--brand-text);
}

html.dark .phone-field__input::placeholder,
html.dark .pi-input::placeholder,
html.dark .email-field__input::placeholder {
  color: var(--brand-text-muted);
}

/* Step icons / accents stay golden — fine on dark. */

/* Back arrows */
html.dark .mobile-top .back-button,
html.dark .shell-back-button {
  color: var(--brand-text);
}

/* Progress track */
html.dark .step-progress,
html.dark .stitch-shell-progress {
  background: #2a3445;
}

html.dark .mobile-alert {
  background: var(--brand-soft-bg);
  color: var(--brand-soft-text);
}

/* OTP notes */
html.dark .otp-note {
  color: var(--brand-text);
}

/* Buttons that are light (scan again / try again / light styles) */
html.dark .custom-button-light {
  background: var(--brand-surface);
  border-color: var(--brand-outline);
  color: var(--brand-text);
}

html.dark .scan-again-btn {
  background: var(--brand-surface);
  border-color: var(--brand-gold);
  color: var(--brand-gold);
}

html.dark .terms-accept__checkbox {
  accent-color: var(--brand-gold);
}

html.dark .stitch-result-card {
  background: var(--brand-surface);
  color: var(--brand-text);
}

html.dark .verification-success-page .vs-subtitle,
html.dark .verification-success-page .vs-card__value {
  color: var(--brand-text);
}

html.dark .verification-success-page .vs-card__tag {
  background: #2a3445;
  color: var(--brand-text);
}

/* selects: keep native option list readable in dark color-scheme */
html.dark .pi-input:required:invalid {
  color: var(--brand-text-muted);
}
html.dark .pi-input:valid {
  color: var(--brand-text);
}
html.dark .pi-input option {
  color: #0b1c30;
  background: #ffffff;
}

/* OTP input pills (dark border values from otp input component) */
html.dark .otp-pills .input,
html.dark .stitch-otp-inputs .input,
html.dark .input {
  background: var(--brand-otp-bg) !important;
  color: var(--brand-otp-color) !important;
  border-color: var(--brand-otp-border) !important;
}

html.dark .input:focus {
  border-color: var(--brand-teal) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-teal) 25%, transparent) !important;
}

/* Bootstrap form-control inputs used on the large user-info form */
html.dark .form-control,
html.dark .stitch-input,
html.dark .stitch-select,
html.dark textarea.form-control {
  background-color: var(--brand-surface);
  border-color: var(--brand-outline);
  color: var(--brand-text);
}

html.dark .form-control::placeholder,
html.dark .stitch-input::placeholder {
  color: var(--brand-text-muted);
}

html.dark .wizard-dot {
  background-color: #2a3445;
}

/* ===== Scoped-style elements (country code box, radios, labels, etc.) ===== */
html.dark .phone-field__country-code,
html.dark .phone-field__input,
html.dark .email-field__input {
  background: var(--brand-surface);
  border-color: var(--brand-control-border);
  color: var(--brand-body);
}

html.dark .pi-input {
  background: var(--brand-surface) !important;
  color: var(--brand-body) !important;
}

html.dark .pi-input:focus-visible,
html.dark .phone-field__input:focus-visible,
html.dark .email-field__input:focus-visible,
html.dark .fatca-radio__input:focus-visible,
html.dark .pi-radio__input:focus-visible {
  outline-color: var(--brand-teal);
}

html.dark .fatca-radio__input,
html.dark .pi-radio__input {
  background: var(--brand-surface);
  border-color: var(--brand-radio-border);
}

html.dark .fatca-radio__input::before,
html.dark .pi-radio__input::before {
  background: var(--brand-radio-border);
  box-shadow: inset 0 0 0 1px var(--brand-radio-border);
}

html.dark .pi-question,
html.dark .fatca-question,
html.dark .doc-card__label,
html.dark .pi-radio,
html.dark .fatca-radio,
html.dark .pi-label,
html.dark .terms-accept__label,
html.dark .phone-field__label,
html.dark .email-field__label {
  color: var(--brand-heading);
}

html.dark .terms-accept__label {
  color: var(--brand-heading) !important;
}

html.dark .checklist li,
html.dark .stitch-guidance-list li {
  background: var(--brand-surface);
  color: var(--brand-text);
}

html.dark .doc-card {
  background: var(--brand-surface);
  border-color: var(--brand-teal);
}

html.dark .doc-card--selected {
  border-color: var(--brand-gold);
}

html.dark .doc-card__check circle[stroke="#00364a"] {
  stroke: var(--brand-teal);
}

html.dark .otp-resend {
  color: var(--brand-muted);
}

html.dark .otp-resend--active {
  color: var(--brand-heading);
}
