:root {
    --blue: #1a56db;
    --blue-dark: #1341b0;
    --blue-deep: #0d2d6e;
    --blue-light: #eff4ff;
    --blue-mid: #dbeafe;
    --blue-border: #bfdbfe;
    --red: #dc2626;
    --red-light: #fef2f2;
    --green: #16a34a;
    --green-light: #f0fdf4;
    --grey-50: #f8fafc;
    --grey-100: #f1f5f9;
    --grey-200: #e2e8f0;
    --grey-400: #94a3b8;
    --grey-600: #475569;
    --grey-800: #1e293b;
    --text: #0f172a;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 8px 24px rgba(26, 86, 219, .06);
    --shadow-md: 0 4px 20px rgba(26, 86, 219, .12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    scroll-behavior: smooth
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #f0f4ff;
    background-image: radial-gradient(ellipse at 0% 0%, rgba(26, 86, 219, .08) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(13, 45, 110, .07) 0%, transparent 55%);
    min-height: 100vh;
    color: var(--text)
}

/* NAV */
.top-nav {
    background: var(--blue-deep);
    background-image: linear-gradient(135deg, var(--blue-deep) 0%, #1a3a7a 100%);
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 20px rgba(13, 45, 110, .25)
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none
}

.nav-logo {
    width: 38px;
    height: 38px;
    background: var(--blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff
}

.nav-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1
}

.nav-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, .5);
    letter-spacing: 1.2px;
    text-transform: uppercase
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 50px;
    background: rgba(255, 255, 255, .1);
    border: 1.5px solid rgba(255, 255, 255, .2);
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    font-family: 'DM Sans', sans-serif
}

.btn-nav:hover {
    background: rgba(255, 255, 255, .2);
    color: #fff
}

/* LAYOUT */
.page-wrap {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    padding: 32px 40px 80px;
    max-width: 1500px;
    margin: 0 auto
}

/* SIDEBAR NAV */
.side-nav {
    position: sticky;
    top: 80px;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column
}

.side-nav-inner {
    background: #fff;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--blue-border) transparent
}

.side-nav-inner::-webkit-scrollbar {
    width: 4px
}

.side-nav-inner::-webkit-scrollbar-track {
    background: transparent
}

.side-nav-inner::-webkit-scrollbar-thumb {
    background: var(--blue-border);
    border-radius: 99px
}

.side-nav-inner::-webkit-scrollbar-thumb:hover {
    background: var(--blue)
}

.side-nav-header {
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--blue-deep), #1e4fac);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    font-size: 13px;
    color: var(--grey-600);
    cursor: pointer;
    transition: all .18s;
    border-bottom: 1px solid var(--grey-100);
    text-decoration: none
}

.side-nav-item:hover {
    background: var(--blue-light);
    color: var(--blue)
}

.side-nav-item.active {
    background: var(--blue-light);
    color: var(--blue);
    font-weight: 600;
    border-left: 3px solid var(--blue)
}

.side-nav-item .sn-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--blue-mid);
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

/* HERO */
.page-hero {
    background: linear-gradient(135deg, var(--blue-deep) 0%, #1e4fac 100%);
    border-radius: 16px;
    padding: 36px 48px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md)
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -70px;
    right: -70px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04)
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 35%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .03)
}

.hero-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 8px
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 10px
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 16px
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
    font-weight: 500
}

.hero-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, .65);
    line-height: 1.6;
    max-width: 600px;
    margin-top: 8px
}

/* SECTION CARDS */
.section-card {
    background: #fff;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: border-color .2s;
    scroll-margin-top: 90px
}

.section-card:focus-within {
    border-color: var(--blue-border)
}

.section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 28px;
    background: linear-gradient(to right, var(--blue-light), #fff);
    border-bottom: 1.5px solid var(--blue-mid)
}

.sec-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.sec-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--blue-deep);
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: .3px
}

.section-body {
    padding: 28px
}

/* FORM CONTROLS */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--grey-600);
    margin-bottom: 6px;
    letter-spacing: .2px
}

.req {
    color: var(--red);
    margin-left: 2px
}

.form-control,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none
}

.form-control:focus,
.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, .1)
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .08)
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--green)
}

textarea.form-control {
    resize: vertical;
    min-height: 90px
}

.input-with-icon {
    position: relative
}

.input-with-icon .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-400);
    font-size: 15px;
    pointer-events: none
}

.input-with-icon .form-control {
    padding-left: 36px
}

.char-counter {
    font-size: 11px;
    color: var(--grey-400);
    text-align: right;
    margin-top: 3px
}

.char-counter.warn {
    color: #f59e0b
}

.char-counter.over {
    color: var(--red)
}

.err-msg {
    font-size: 12px;
    color: var(--red);
    margin-top: 5px;
    display: none;
    align-items: center;
    gap: 4px;
    animation: fadeIn .2s ease
}

.err-msg.show {
    display: flex
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

/* GRID */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px
}

.col-full {
    flex: 0 0 100%
}

.col-half {
    flex: 0 0 calc(50% - 8px)
}

.col-third {
    flex: 0 0 calc(33.333% - 11px)
}

.col-two-third {
    flex: 0 0 calc(66.666% - 8px)
}

.col-quarter {
    flex: 0 0 calc(25% - 12px)
}

@media(max-width:768px) {

    .col-half,
    .col-third,
    .col-two-third,
    .col-quarter {
        flex: 0 0 100%
    }
}

/* RADIO PILLS */
.radio-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px
}

.radio-pill input[type=radio] {
    display: none
}

.radio-pill label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    border-radius: 50px;
    border: 1.5px solid var(--grey-200);
    background: #fff;
    color: var(--grey-600);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    user-select: none
}

.radio-pill input[type=radio]:checked+label {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue)
}

.radio-pill label:hover {
    border-color: var(--blue-border);
    color: var(--blue)
}

/* DYNAMIC TABLE */
.dyn-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px
}

.dyn-table thead th {
    background: var(--blue-light);
    color: var(--blue-deep);
    font-size: 11.5px;
    font-weight: 700;
    padding: 10px 10px;
    text-align: left;
    letter-spacing: .4px;
    text-transform: uppercase;
    border: 1.5px solid var(--blue-mid)
}

.dyn-table tbody td {
    padding: 7px 7px;
    border: 1.5px solid var(--grey-100);
    vertical-align: middle
}

.dyn-table tbody tr:hover td {
    background: var(--blue-light)
}

.btn-remove {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1.5px solid var(--grey-200);
    background: #fff;
    color: var(--grey-400);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s
}

.btn-remove:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-light)
}

.btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: 1.5px dashed var(--blue-border);
    background: var(--blue-light);
    color: var(--blue);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    font-family: 'DM Sans', sans-serif
}

.btn-add-row:hover {
    background: var(--blue-mid);
    border-style: solid
}

/* SIGNATURE */
.sig-drop-zone {
    border: 2px dashed var(--blue-border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    background: var(--blue-light);
    cursor: pointer;
    transition: all .2s;
    position: relative
}

.sig-drop-zone:hover,
.sig-drop-zone.drag-over {
    border-color: var(--blue);
    background: var(--blue-mid)
}

.sig-drop-zone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%
}

.sig-drop-icon {
    font-size: 34px;
    color: var(--blue);
    margin-bottom: 8px
}

.sig-drop-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue-deep);
    margin-bottom: 4px
}

.sig-drop-hint {
    font-size: 12px;
    color: var(--grey-400)
}

.sig-size-limit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--blue);
    background: rgba(26, 86, 219, .1);
    padding: 4px 12px;
    border-radius: 50px
}

.sig-preview-wrap {
    display: none;
    border: 1.5px solid var(--blue-border);
    border-radius: var(--radius);
    padding: 18px;
    background: #fff;
    position: relative;
    text-align: center
}

.sig-preview-wrap.show {
    display: block
}

.sig-preview-img {
    max-height: 100px;
    max-width: 100%;
    border-radius: 6px;
    object-fit: contain;
    display: inline-block
}

.sig-preview-info {
    font-size: 12px;
    color: var(--grey-400);
    margin-top: 8px
}

.sig-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--grey-200);
    background: #fff;
    color: var(--grey-400);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s
}

.sig-remove-btn:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-light)
}

.sig-valid-badge {
    display: none;
    align-items: center;
    gap: 5px;
    color: var(--green);
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    justify-content: center
}

.sig-valid-badge.show {
    display: flex
}

/* DECLARATION */
.decl-box {
    background: var(--blue-light);
    border-left: 4px solid var(--blue);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 18px 20px;
    font-size: 13px;
    color: var(--grey-600);
    line-height: 1.75;
    margin-bottom: 20px
}

/* DIVIDER */
.field-divider {
    border: none;
    border-top: 1.5px solid var(--grey-100);
    margin: 18px 0 12px
}

.optional-label {
    font-size: 11px;
    color: var(--grey-400);
    font-weight: 500;
    background: var(--grey-100);
    padding: 2px 8px;
    border-radius: 50px;
    margin-left: 6px
}

/* SUBMIT FOOTER */
.form-footer {
    background: #fff;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: var(--shadow);
    margin-top: 24px;
    position: sticky;
    bottom: 16px;
    z-index: 100
}

.footer-left {
    font-size: 12.5px;
    color: var(--grey-400);
    display: flex;
    align-items: center;
    gap: 6px
}

.footer-right {
    display: flex;
    gap: 10px;
    align-items: center
}

.btn-reset-form {
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--grey-200);
    background: #fff;
    color: var(--grey-600);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    font-family: 'DM Sans', sans-serif
}

.btn-reset-form:hover {
    border-color: var(--grey-400);
    color: var(--text)
}

.btn-submit {
    padding: 10px 32px;
    border-radius: var(--radius-sm);
    background: var(--blue);
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 4px 14px rgba(26, 86, 219, .3)
}

.btn-submit:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26, 86, 219, .35)
}

.btn-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none
}

.btn-submit .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin .7s linear infinite
}

.btn-submit.loading .spinner {
    display: block
}

.btn-submit.loading .btn-icon {
    display: none
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* PAYMENT BOX */
.payment-box {
    background: var(--blue-light);
    border: 1.5px solid var(--blue-mid);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 13px;
    color: var(--grey-600);
    line-height: 1.7;
    margin-top: 12px
}

.payment-box strong {
    color: var(--blue-deep)
}

/* PROGRESS BAR */
.progress-wrap {
    background: #fff;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow)
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--grey-600);
    margin-bottom: 8px;
    font-weight: 600
}

.progress-bar-bg {
    background: var(--grey-100);
    border-radius: 99px;
    height: 6px;
    overflow: hidden
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--blue), #3b82f6);
    height: 100%;
    border-radius: 99px;
    transition: width .4s ease;
    width: 0%
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--blue-border);
    border-radius: 99px
}

::-webkit-scrollbar-thumb:hover {
    background: var(--blue)
}

@media(max-width:1024px) {
    .page-wrap {
        grid-template-columns: 1fr;
        padding: 20px 20px 100px
    }

    .side-nav {
        display: none
    }
}

@media(max-width:768px) {
    .page-wrap {
        padding: 16px 14px 100px
    }

    .page-hero {
        padding: 28px 24px
    }

    .hero-title {
        font-size: 28px
    }

    .section-body {
        padding: 20px 16px
    }

    .top-nav {
        padding: 0 18px
    }
}