﻿:root {
    --theme: #4258ad; /* main theme + active tab */
    --success-gradient: linear-gradient( 90deg, #00570e, #0c7016, #056b13 ); /* completed tabs, verified, OK */
    --success-solid: #0c7016;
    --accent: #e07000;
    --tab-grey: #b5b9bd; /* tabs not visited yet */
    --card-bg: #ececec;
}

body {
    background: #fff;
    color: #1f2d3d;
    font-family: "Segoe UI", system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-title {
    font-weight: 800;
    color: var(--theme);
}

.step-heading {
    font-weight: 800;
    color: var(--theme);
}

.step-sub {
    color: #333;
}

/* ---------- Tabs ---------- */
.step-tabs {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 0;
    list-style: none;
}

    .step-tabs li {
        flex: 1 1 150px;
    }

.step-tab {
    width: 100%;
    border: 0;
    border-radius: 30px 0 30px 0;
    padding: 18px 12px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    background: var(--tab-grey);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    transition: 0.2s;
}

    .step-tab:hover {
        filter: brightness(1.07);
    }

    .step-tab.active {
        background: var(--theme) !important;
    }

    .step-tab.bg-success:not(.active) {
        background: var(--success-gradient) !important;
    }

    .step-tab .tick {
        display: none;
        margin-right: 6px;
    }

    .step-tab.bg-success:not(.active) .tick {
        display: inline;
    }

/* ---------- Cards ---------- */
.field-card {
    height: 100%;
}

    .field-card .form-label {
        font-weight: 600;
        color: var(--theme);
        margin-bottom: 4px;
    }

    .field-card .form-control,
    .field-card .form-select {
        border-color: #c5cbd3;
    }

#mainForm {
    --bs-border-radius: 0.9rem;
}

.field-card .form-control,
.field-card .form-select {
    border-radius: 0.9rem;
    padding: 0.65rem 1rem;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}

.field-card .input-group {
    border-radius: 0.9rem;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}

    .field-card .input-group .form-control {
        box-shadow: none;
    }

        .field-card .input-group .form-control.is-invalid {
            background-image: none;
            padding-right: 1rem;
        }

    .field-card .input-group:has(.is-invalid) + .invalid-feedback {
        display: block;
    }

    .field-card .input-group:has(.is-invalid) {
        box-shadow: 0 5px 14px rgba(220, 53, 69, 0.25);
    }
/* no error icon on invalid fields - the error message below the field is enough */
.field-card .form-control.is-invalid {
    background-image: none;
    padding-right: 1rem;
}

.field-card .input-group > .btn,
.field-card .input-group-text {
    padding: 0.65rem 1rem;
}
/* keep the right end of the group rounded (the hidden invalid-feedback div is the "last child" and removes it) */
.field-card .input-group > .btn {
    border-top-right-radius: 0.9rem !important;
    border-bottom-right-radius: 0.9rem !important;
}

.field-card .input-group > .input-group-text:first-child {
    border-top-left-radius: 0.9rem;
    border-bottom-left-radius: 0.9rem;
}

.field-card .form-control:focus,
.field-card .form-select:focus {
    border-color: var(--theme);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18), 0 0 0 0.2rem rgba(0, 55, 119, 0.2);
}

.field-card .input-group .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 55, 119, 0.2);
}

.form-check-input:checked {
    background-color: var(--theme);
    border-color: var(--theme);
}

.req::after {
    content: " *";
    color: #dc3545;
}

.certificate-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.certificate-validity {
    min-width: 0;
}

    .certificate-validity .form-control {
        width: 100%;
    }

.addr-title {
    font-weight: 700;
    color: var(--theme);
}

.review-col {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 22px 30px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
    height: 100%;
}

.review-title {
    font-weight: 800;
    color: var(--theme);
    margin-bottom: 10px;
}

.review-row {
    display: flex;
    gap: 24px;
    padding: 12px 0;
    border-bottom: 1px solid #d3d7dd;
}

    .review-row:last-child {
        border-bottom: 0;
    }

    .review-row .k {
        flex: 0 0 150px;
    }

    .review-row .v {
        font-weight: 700;
        word-break: break-word;
    }

.captcha-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    border: 1px solid #d3d3d3;
    border-radius: 4px;
    padding: 10px 14px;
}

.captcha-code {
    font: 700 1.5rem "Courier New", monospace;
    letter-spacing: 6px;
    padding: 2px 14px;
    background: repeating-linear-gradient( 45deg, #e9eef5, #e9eef5 6px, #f6f8fb 6px, #f6f8fb 12px );
    color: var(--theme);
    user-select: none;
    border-radius: 4px;
    text-decoration: line-through wavy #9aa9bd;
}

.btn-theme {
    background: var(--theme);
    color: #fff;
    border: 0;
    font-weight: 700;
    padding: 0.6rem 1.6rem;
    border-radius: 8px;
}

    .btn-theme:hover {
        background: #00296a;
        color: #fff;
    }

.btn-accent {
    background: var(--accent);
    color: #fff;
    border: 0;
    font-weight: 700;
    padding: 0.8rem 1.8rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

    .btn-accent:hover {
        filter: brightness(1.08);
        color: #fff;
    }

#btnNext {
    padding: 10px 30px;
    font-size: 18px;
}

/* ---------- success tick animation ---------- */
.check-anim {
    width: 96px;
    height: 96px;
}

.ck-circle {
    stroke: var(--success-solid);
    stroke-width: 2.5;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: ckDraw 0.6s ease-out forwards;
}

.ck-path {
    stroke: var(--success-solid);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: ckDraw 0.4s 0.45s ease-out forwards;
}

@keyframes ckDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.success-card {
    max-width: 640px;
    margin: 3rem auto;
    padding: 3rem;
    border-radius: 25px;
    text-align: center;
    background: #fff;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
    animation: popIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ref-box {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #eef3fa;
    color: var(--theme);
    padding: 0.6rem 1.4rem;
    border-radius: 0.9rem;
    font-size: 1.05rem;
}

.copy-ref-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    color: var(--theme);
    border: 0;
    border-radius: 50%;
    line-height: 1;
}

    .copy-ref-btn:hover,
    .copy-ref-btn:focus {
        color: #fff;
        background: var(--theme);
        box-shadow: none;
    }

    .copy-ref-btn i {
        font-size: 1rem;
    }

.ref-save-note {
    margin: 0.75rem 0 0;
    color: #333;
    font-size: 0.95rem;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: none;
    }
}
/* after submit: show only the tabs (all done, not clickable) */
#appWrap.submitted > :not(#stepTabs) {
    display: none !important;
}

#appWrap.submitted #stepTabs {
    pointer-events: none;
}

.tab-pane-step {
    display: none;
}

    .tab-pane-step.active {
        display: block;
    }

/* ---------- Layout helpers (moved from inline styles) ---------- */
.container.app-container {
    max-width: 1280px;
}

.mandatory-note {
    font-size: 16px;
}

#captchaInput {
    width: 150px;
}

.success-title {
    color: var(--theme);
}

/* red border on invalid fields (the base .field-card border colour was overriding Bootstrap's) */
.field-card .form-control.is-invalid {
    border-color: #dc3545;
}

.field-card .input-group:has(.is-invalid) .form-control,
.field-card .input-group:has(.is-invalid) .input-group-text {
    border-color: #dc3545;
}

/* gender dropdown */
.field-card .form-select {
    padding-right: 2.25rem;
}

    .field-card .form-select.is-invalid:not([multiple]):not([size]) {
        border-color: #dc3545;
        --bs-form-select-bg-icon: none;
        padding-right: 2.25rem;
        background-position: right 0.75rem center;
        background-size: 16px 12px;
    }

/* applicant photo */
.review-photo {
    width: 95px;
    height: 110px;
    object-fit: cover;
    border-radius: 0.6rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.review-applicant-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #d3d7dd;
}

.review-applicant-fields .review-row:last-child {
    border-bottom: 0;
}

.review-applicant-photo {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 575.98px) {
    .review-applicant-fields .review-row .k {
        flex-basis: 100px;
    }
}

.field-card .btn-preview {
    background: var(--theme);
    color: #fff;
    font-weight: 600;
}

    .field-card .btn-preview:hover {
        background: #00296a;
        color: #fff;
    }

    .field-card .btn-preview:disabled {
        background: var(--tab-grey);
        color: #fff;
        opacity: 1;
        border: none;
    }

/* photo preview modal */
.modal.fade .modal-dialog {
    transform: translateY(-28px) scale(0.94);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.modal.show .modal-dialog {
    transform: none;
    opacity: 1;
}

.modal-backdrop.show {
    opacity: 0.55;
    backdrop-filter: blur(2px);
}

.modal-content {
    border: 0;
    border-radius: 1.1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

#photoModal .modal-dialog {
    max-width: 420px;
}

.modal-title-theme {
    font-weight: 800;
    color: var(--theme);
    margin: 0;
}

.modal-line {
    height: 3px;
    background: var(--theme);
    border-radius: 3px;
    margin: 12px 0 20px;
}

.photo-modal-img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 0.9rem;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25);
}

#documentModal .modal-dialog {
    max-width: 820px;
}

.document-modal-preview {
    width: 100%;
    max-height: 65vh;
    border: 0;
    border-radius: 0.9rem;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}

img.document-modal-preview {
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    object-fit: contain;
}

iframe.document-modal-preview {
    height: 65vh;
}

.modal .btn {
    border-radius: 0.8rem;
    font-weight: 700;
}

/* ---------- header / footer ---------- */
.title-bar {
    min-height: 56px;
    background: linear-gradient(90deg, #00570e, #0c7016, #056b13);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    font-weight: 600;
}

.filing-title-icon {
    width: 42px;
    height: 42px;
    border: 2px solid #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.government-footer {
    min-height: 66px;
    width: 100%;
    background: #145b18;
    color: #fff;
    display: flex;
    align-items: center;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-shield {
    font-size: 31px;
    margin-right: 20px;
}

.footer-text {
    font-size: 15px;
}

.last-updated {
    text-align: right;
    font-size: 14px;
}


#global-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    z-index: 99999;
}

.loader-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

    .loader-content p {
        margin-top: 10px;
        font-weight: 600;
        color: #198754;
    }