:root {
    --primary-blue: #28998b;
    --light-green: #d4e4af;
    --dark-green: #173126;
    --muted: #6b7280;
    --border: #e2e4ea;
    --bg-page: #e7e7e7;
    --bg-card: #ffffff;
    --text: #000000;
    --danger: #FF384A;
    --green: #6AB04C;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Poppins", sans-serif !important;
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.text-primary {
    color: var(--primary-blue) !important;
}

/* ── Card ── */
.form-card {
    background: var(--bg-card);
    border-radius: 18px;
    box-shadow: 0 4px 32px rgba(26, 26, 94, .08);
    padding: 1.3rem 1.3rem;
    width: 100%;
    max-width: 840px;
    animation: fadeUp .45s ease both;
}

.card {
    border: solid 1px #e9e9e9;
}

.card-header {
    border-bottom: solid 1px #e9e9e9;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Brand ── */
.brand {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-align: center;
    margin-bottom: 1.1rem;
    width: 250px;
    height: auto;
    margin-inline: auto;
    object-fit: cover;
}

.brand img {
    width: 100%;
    height: 100%;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    color: var(--text);
    margin-bottom: .55rem;
}

.form-note {
    text-align: center;
    color: var(--text);
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 2rem;
}

/* ── Stepper ── */
.stepper {
    display: flex;
    align-items: center;
    position: relative;
    gap: 0;
}

/* Each step = circle + label inline */
.step-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    background: #fff;
    flex-shrink: 0;
    transition: border-color .3s, background .3s, color .3s, box-shadow .3s;
}

.step-circle.active {
    border-color: var(--primary-blue);
    color: #fff;
    box-shadow: 0 0 0 4px rgb(99 99 201 / 10%);
    background: var(--primary-blue);
}

.step-circle.done {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
    color: #fff;
}

.step-label {
    font-size: 1rem;
    font-weight: normal;
    color: var(--text);
    white-space: nowrap;
    transition: color .3s;
}

.step-label.active {
    color: var(--primary-blue);
    font-weight: 600;
}

/* ── Chevron arrow connector ── */
.step-arrow {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 40px;
    margin: 0 4px;
}

/* The ">" chevron arrow tip, made with borders */
.step-arrow::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    width: 40px;
    height: 40px;
    border-top: 1.5px solid #d3d3d3;
    border-right: 1.5px solid #d3d3d3;
    transform: translateY(-50%) rotate(45deg);
    background: transparent;
    transition: border-color .4s;
}

/* ── Form panels ── */
.step-panel {
    display: none;
    animation: fadeUp .35s ease both;
}

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

/* ── Labels & inputs ── */
.form-label {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .40rem;
}

.required-star {
    color: var(--danger);
    margin-left: 1px;
}

.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1rem;
    pointer-events: none;
}

.input-wrap input,
.input-wrap select {
    padding-left: 2.4rem;
}

.form-control,
.form-select {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: .92rem;
    padding: .65rem 1rem;
    color: var(--text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(71, 71, 194, .12);
    background: #ffffffe7;
    outline: none;
}

/* ── Yes/No toggle ── */
.yn-group {
    display: flex;
    gap: .55rem;
}

.yn-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: #fff;
    font-size: .88rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
    user-select: none;
}

.yn-btn:hover {
    border-color: var(--green);
    color: var(--green);
}

.yn-btn.selected-yes {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.yn-btn.selected-no,
.yn-btn.selected-no:hover,
.yn-btn.selected-no:focus {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}


.yn-btn i {
    font-size: .85rem;
    position: relative;
    top: 2px;
}

/* ── Question rows ── */
.question-block {
    padding-bottom: 21px;
    margin-bottom: 11px;
}

.question-text {
    font-weight: normal;
    color: var(--text);
    margin-bottom: .3rem;
    font-size: 1rem;
}

/* ── Navigation buttons ── */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 1rem;
    gap: .75rem;
}

.btn-next,
.btn-primary,
.btn-submit {
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .65rem 1.6rem;
    font-size: .92rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.btn-next:hover,
.btn-submit:hover,
.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus,
.btn-primary:focus-visible {
    transform: translateX(2px) !important;
    box-shadow: none !important;
    background: var(--primary-blue);
}

.btn-back,
.btn-secondary {
    border: 1px solid var(--light-green);
    background-color: var(--light-green);
    color: var(--dark-green) !important;
    border-radius: 10px;
    padding: .65rem 1.4rem;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.btn-back:hover,
.btn-secondary:hover,
.btn-secondary:active,
.btn-secondary:focus,
.btn-secondary:focus-visible {
    box-shadow: none !important;
    transform: translateX(-2px) !important;
}

/* ── Step 2 – personal info ── */
.row-cols-2 {
    gap: 0;
}

/* ── Step 3 – summary ── */
.summary-card {
    background: #f8f8fd;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-key {
    color: var(--muted);
    font-weight: 500;
}

.summary-val {
    font-weight: 600;
    color: var(--text);
}

.success-banner {
    display: none;
    text-align: center;
    padding: 2.5rem 1rem;
    animation: fadeUp .4s ease both;
}

.success-banner i {
    font-size: 3.2rem;
    color: #22c55e;
    margin-bottom: 1rem;
    display: block;
}

.success-banner h4 {
    font-weight: 700;
    color: var(--text);
}

.success-banner p {
    color: var(--muted);
    font-size: .95rem;
}

/* ── Input Group Input Validation ── */
.input-group input.is-invalid {
    border-top-right-radius: var(--bs-border-radius) !important;
    border-bottom-right-radius: var(--bs-border-radius) !important;
}

/* ── FlatPicker Input ── */
.flatpickr-wrapper input {
    border-radius: 0 !important;
    border-top-right-radius: var(--bs-border-radius) !important;
    border-bottom-right-radius: var(--bs-border-radius) !important;
}

/* ── Select2 overrides ── */
.select2-container--default .select2-selection--single {
    height: auto;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: .6rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: .92rem;
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(71, 71, 194, .12);
    background: #ffffffe7;
    outline: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text);
    line-height: 1.5;
    padding: 0;
    font-size: .92rem;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--muted);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    height: auto;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--muted) transparent transparent transparent;
    border-width: 5px 4px 0 4px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--primary-blue) transparent;
    border-width: 0 4px 5px 4px;
}

/* Clear button */
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0.2rem 1.2rem 0 0;
    line-height: 1;
}

/* Dropdown panel */
.select2-dropdown {
    border: 1.5px solid var(--primary-blue);
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(26, 26, 94, .1);
    font-family: 'DM Sans', sans-serif;
    overflow: hidden;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: .45rem .75rem;
    font-size: .88rem;
    font-family: 'DM Sans', sans-serif;
    outline: none;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary-blue);
}

.select2-container--default .select2-results__option {
    padding: .55rem 1rem;
    font-size: .9rem;
    color: var(--text);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--primary-blue);
    color: #fff;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background: var(--primary-blue);
    color: #fff;
    font-weight: 600;
}

/* Address FieldSet */
.addr_fieldset {
    min-width: 0;
    padding: 18px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;

    & legend {
        width: auto;
        margin: -30px 0 0 20px;
        background: #fff;
        padding: 0 8px;
        font-weight: bold;
        font-size: medium;
    }
}

/* Address Look-up UI */
#addr_postcode_lookup #ideal-postcode-wrapper {
    flex-wrap: wrap !important;
}

#addr_postcode_lookup .ipsf_submit {
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .65rem 1.6rem;
    font-size: .92rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    transition: background .2s, transform .15s;
    white-space: nowrap;
    height: 42px;
    min-width: 150px;

    & :hover {
        background: var(--primary-blue);
        transform: translateX(2px);
    }
}

/* Styles for signature plugin v1.2.0. */
.signature_container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.signature_container #signature_pad {
    display: inline-block;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: crosshair;
    width: 100%;
    height: 152px;
}

.yn-btn-no {
    background: rgb(255, 56, 74, 0.1);
    color: var(--danger);
    border: solid 1px #ffb3ba;
    width: 62px;
}

.yn-btn-no:hover,
.yn-btn-no:focus,
.yn-btn-no:active {
    background: rgb(255, 56, 74, 0.1);
    color: var(--danger);
    border: solid 1px #ffb3ba;
}


.yn-btn-yes {
    background: rgb(106, 176, 76, 0.1);
    color: var(--green);
    border: solid 1px #6ab04cb0;
    width: 62px;
}

.yn-btn span {
    position: relative;
    top: 1px;
    right: 2px;
}

.step-input-group .flatpickr-wrapper {
    flex: 1;
}

.default_down_arrow {
    position: relative;
    display: block;
}

.default_down_arrow:after {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    transform: rotate(225deg);
    position: absolute;
    top: 16px;
    line-height: 50px;
    right: 15px;
    border-top: 2px solid #000;
    border-left: 2px solid #000;
    pointer-events: none;
}

.default_down_arrow select {
    appearance: none;
}

.fw-600 {
    font-weight: 600;
}

.form-step-panel .form-check-input {
    width: 1.5em;
    height: 1.5em;
}

.form-step-panel .form-check .form-check-input {
    margin-left: -2.2em;
    border: solid 2px #dbdbdb;
    margin-top: 1px;
}

.form-step-panel .form-check {
    padding-left: 2em;
}

.signature_wrapper {
    background: #f8f8f8;
    padding: 10px;
    border-radius: 8px;
    border: solid 1px #e9e9e9;
}

#panel-3 .select2.select2-container.select2-container--default {
    width: 100% !important;
}

/* ── SVG Circle + Check ── */
.check-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
}

.check-wrap svg {
    width: 72px;
    height: 72px;
    overflow: visible;
}

/* Circle fill burst */
.circle-fill {
    fill: #22c55e;
    transform-origin: center;
    animation: circlePop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes circlePop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ripple ring */
.ripple {
    fill: none;
    stroke: #22c55e;
    stroke-width: 3;
    transform-origin: center;
    animation: rippleOut 0.7s ease-out 0.55s both;
}

@keyframes rippleOut {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

/* Checkmark draw */
.check-path {
    fill: none;
    stroke: #fff;
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: drawCheck 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.62s forwards;
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .form-card {
        padding: 2rem 1.25rem;
        width: 100%;
    }

    .step-label {
        font-size: .72rem;
    }

    .brand {
        width: 200px;
    }
}

@media (max-width: 460px) {
    .step-label {
        display: none;
    }

    .step-arrow {
        margin: 0 2px;
    }
}