:root {
    --app-bg: #020617;
    --app-surface: #0f172a;
    --app-surface-soft: #111827;
    --app-field-bg: rgba(15, 23, 42, 0.92);
    --app-field-border: #334155;
    --app-text: #f8fafc;
    --app-muted: #94a3b8;
    --app-muted-strong: #cbd5e1;
    --app-border: #1e293b;
    --app-primary: #06b6d4;
    --app-primary-dark: #22d3ee;
    --app-brand: #4f46e5;
    --app-danger: #fb7185;
    --app-success: #34d399;
    --app-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body.application-body {
    min-height: 100vh;
    margin: 0;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: "Inter", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.account-app {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(79, 70, 229, 0.24), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(6, 182, 212, 0.18), transparent 26%),
        linear-gradient(to right, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
        linear-gradient(180deg, #020617 0%, #07111f 48%, #020617 100%);
    background-size: auto, auto, 80px 80px, 80px 80px, auto;
}

.account-app::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.86)),
        url("../images/backgrounds/account-opening-market-bg.png") center / cover no-repeat;
    opacity: 0.34;
    filter: saturate(0.82) contrast(0.96);
}

.application-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 28px;
    min-height: 86px;
    padding: 18px clamp(20px, 6vw, 96px);
    border-bottom: 1px solid rgba(30, 41, 59, 0.82);
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(14px);
}

.application-brand,
.application-nav {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.application-brand {
    color: #f8fafc;
    font-size: 1.15rem;
    font-weight: 800;
}

.application-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--app-brand), var(--app-primary));
    color: #020617;
    font-weight: 900;
}

.application-nav {
    gap: 26px;
    color: var(--app-muted-strong);
    font-weight: 700;
}

.application-nav a {
    transition: color 0.2s ease, transform 0.2s ease;
}

.application-nav a:hover,
.application-nav a:focus {
    color: var(--app-primary-dark);
}

.application-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.application-login {
    min-width: 116px;
    padding: 12px 24px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--app-brand), var(--app-primary));
    color: #020617;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.34);
}

.application-login:hover,
.application-login:focus {
    transform: translateY(-1px);
}

.application-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--app-field-border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.86);
    color: var(--app-text);
}

.application-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.application-mobile-nav {
    display: none;
}

.account-opening-section {
    padding: clamp(54px, 8vw, 96px) 20px 80px;
}

.application-container {
    width: min(100%, 1160px);
    margin: 0 auto;
}

.application-panel {
    border: 1px solid rgba(30, 41, 59, 0.92);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: var(--app-shadow);
}

.alert {
    margin: 30px 34px 0;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 700;
}

.alert-success {
    border: 1px solid rgba(52, 211, 153, 0.28);
    background: rgba(6, 78, 59, 0.42);
    color: var(--app-success);
}

.alert-danger {
    border: 1px solid rgba(251, 113, 133, 0.28);
    background: rgba(127, 29, 29, 0.36);
    color: var(--app-danger);
}

.d-none {
    display: none !important;
}

.wizard-shell {
    padding: 30px 34px 0;
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.wizard-step-tab {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.82);
    color: var(--app-muted);
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wizard-step-tab.is-clickable {
    cursor: pointer;
}

.wizard-step-tab.is-active,
.wizard-step-tab.is-complete {
    border-color: rgba(34, 211, 238, 0.52);
    box-shadow: 0 16px 32px rgba(6, 182, 212, 0.12);
}

.wizard-step-tab.is-active {
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.2), rgba(15, 23, 42, 0.96));
    color: var(--app-text);
    transform: translateY(-1px);
}

.wizard-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 999px;
    background: #1e293b;
    color: var(--app-primary-dark);
    font-weight: 800;
}

.wizard-step-tab.is-active .wizard-step-number,
.wizard-step-tab.is-complete .wizard-step-number {
    background: linear-gradient(135deg, var(--app-brand), var(--app-primary));
    color: #020617;
}

.wizard-step-copy {
    display: grid;
    gap: 2px;
}

.wizard-step-copy strong {
    color: var(--app-text);
    font-size: 0.95rem;
}

.wizard-step-copy span {
    color: var(--app-muted);
    font-size: 0.82rem;
    line-height: 1.25;
}

.enquiry-form {
    padding: 40px 48px 48px;
}

.section-block {
    padding-top: 34px;
    margin-top: 34px;
    border-top: 1px solid var(--app-border);
}

.section-block:first-child,
.wizard-step > .section-block:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

.section-title {
    margin: 0 0 10px;
    color: var(--app-text);
    font-weight: 800;
    letter-spacing: 0;
}

.section-title:not(.h4) {
    color: var(--app-primary);
    font-size: clamp(2rem, 4vw, 2.85rem);
    line-height: 1.08;
    text-align: center;
    text-transform: uppercase;
}

.section-title.h4 {
    font-size: clamp(1.35rem, 2.5vw, 1.7rem);
}

.section-copy {
    max-width: 760px;
    margin: 0 auto 8px;
    color: var(--app-muted);
    font-size: 1.02rem;
    text-align: center;
}

.wizard-step {
    display: none;
}

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

.step-one-grid,
.step-two-grid,
.company-fields,
.beneficiary-fields,
.related-financial-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 24px 32px;
}

.step-three-grid {
    display: grid;
    gap: 30px;
}

.row,
.kyc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 24px 32px;
}

.kyc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.col-md-6 {
    display: grid;
    gap: 10px;
}

.form-group {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.form-group > label,
.kyc-heading {
    color: var(--app-muted-strong);
    font-size: 0.95rem;
    font-weight: 800;
}

.hint-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 18px 20px;
    border-radius: 8px;
    background: var(--app-surface-soft);
    color: var(--app-muted);
}

.hint-list li {
    margin-left: 18px;
}

.birth-date {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.field-span-2,
.field-full {
    grid-column: 1 / -1;
}

.field-shell {
    display: grid;
    gap: 10px;
}

.field-shell label,
.file-card label,
.agreement-box label {
    color: var(--app-muted-strong);
    font-size: 0.95rem;
    font-weight: 700;
}

.form-control,
.form-select,
.field-shell input[type="text"],
.field-shell input[type="email"],
.field-shell input[type="number"],
.field-shell input[type="file"],
.field-shell select,
.field-shell textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--app-field-border);
    border-radius: 7px;
    background: var(--app-field-bg);
    color: var(--app-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control::placeholder,
.field-shell textarea::placeholder {
    color: #64748b;
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.field-shell input:-webkit-autofill,
.field-shell input:-webkit-autofill:hover,
.field-shell input:-webkit-autofill:focus,
.field-shell textarea:-webkit-autofill,
.field-shell textarea:-webkit-autofill:hover,
.field-shell textarea:-webkit-autofill:focus {
    border-color: var(--app-field-border);
    -webkit-text-fill-color: var(--app-text);
    caret-color: var(--app-text);
    box-shadow: 0 0 0 1000px #0f172a inset;
    transition: background-color 9999s ease-out, color 9999s ease-out;
}

.form-control:focus,
.form-select:focus,
.field-shell input:focus,
.field-shell select:focus,
.field-shell textarea:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.18);
}

textarea.form-control,
.field-shell textarea {
    min-height: 116px;
    resize: vertical;
}

.country-select-wrap {
    display: grid;
    gap: 10px;
}

.niceCountryInputSelector {
    position: relative;
    z-index: 5;
    min-height: 50px;
    width: 100%;
    border: 0;
    background: transparent;
}

.niceCountryInputMenu {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid var(--app-field-border) !important;
    border-radius: 7px;
    background: var(--app-field-bg) !important;
    color: var(--app-text) !important;
    overflow: hidden;
}

.niceCountryInputMenu a,
.niceCountryInputMenuDefaultText,
.niceCountryInputMenuDefaultText span {
    color: var(--app-text) !important;
    font-size: 1rem;
    line-height: 1.2;
}

.niceCountryInputMenuDefaultText {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    min-height: 100%;
}

.niceCountryInputMenuCountryFlag {
    flex: 0 0 auto;
    margin: 0 8px 0 0;
}

.niceCountryInputMenuDropdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-height: 100%;
    margin-left: auto;
    color: var(--app-muted) !important;
}

.niceCountryInputMenuFilter,
.niceCountryInputMenuDropdownContent {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 25;
    border: 1px solid var(--app-field-border) !important;
    border-top: 0;
    background: #0f172a !important;
}

.niceCountryInputMenuFilter {
    top: 50px;
    padding: 4px;
    border-radius: 0 0 7px 7px;
}

.niceCountryInputMenuFilter input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--app-field-border) !important;
    border-radius: 7px;
    background: #020617 !important;
    color: var(--app-text) !important;
}

.niceCountryInputMenuDropdownContent {
    top: 100px;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 0 0 7px 7px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
}

.niceCountryInputMenuDropdownContent a {
    display: flex;
    align-items: center;
    min-height: 40px;
    color: var(--app-text) !important;
}

.niceCountryInputMenuDropdownContent a:hover {
    background: rgba(6, 182, 212, 0.12) !important;
    color: var(--app-text) !important;
}

.nice-select {
    display: flex;
    align-items: center;
    width: 100%;
    height: 50px;
    padding-top: 0;
    padding-bottom: 0;
    border-color: var(--app-field-border);
    border-radius: 7px;
    background: var(--app-field-bg);
    color: var(--app-text);
    line-height: 1.2;
}

.nice-select .current {
    display: flex;
    align-items: center;
    min-height: 100%;
}

.nice-select .list {
    width: 100%;
    border: 1px solid var(--app-field-border);
    background: #0f172a;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
}

.nice-select .option {
    display: flex;
    align-items: center;
    min-height: 40px;
    line-height: 1.2;
    color: var(--app-text);
}

.nice-select .option:hover,
.nice-select .option.focus,
.nice-select .option.selected.focus {
    background: rgba(6, 182, 212, 0.12);
}

.file-card {
    display: grid;
    gap: 10px;
    min-height: 168px;
    padding: 20px;
    border: 1px dashed rgba(34, 211, 238, 0.44);
    border-radius: 8px;
    background: var(--app-surface-soft);
}

.file-card input[type="file"] {
    color: var(--app-muted-strong);
    background: var(--app-field-bg);
}

.file-card input[type="file"]::file-selector-button {
    min-height: 32px;
    margin: -6px 12px -6px -8px;
    padding: 6px 12px;
    border: 1px solid rgba(34, 211, 238, 0.46);
    border-radius: 6px;
    background: linear-gradient(135deg, var(--app-brand), var(--app-primary));
    color: #020617;
    font-weight: 800;
    cursor: pointer;
}

.file-card input[type="file"]::-webkit-file-upload-button {
    min-height: 32px;
    margin: -6px 12px -6px -8px;
    padding: 6px 12px;
    border: 1px solid rgba(34, 211, 238, 0.46);
    border-radius: 6px;
    background: linear-gradient(135deg, var(--app-brand), var(--app-primary));
    color: #020617;
    font-weight: 800;
    cursor: pointer;
}

.file-card input[type="file"]:hover::file-selector-button,
.file-card input[type="file"]:focus::file-selector-button,
.file-card input[type="file"]:hover::-webkit-file-upload-button,
.file-card input[type="file"]:focus::-webkit-file-upload-button {
    background: linear-gradient(135deg, #4338ca, #22d3ee);
}

.file-card small {
    color: var(--app-muted);
}

.beneficiary-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.beneficiary-choice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    padding: 12px 16px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.86);
    cursor: pointer;
}

.beneficiary-choice input,
.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--app-primary);
}

.is-hidden {
    display: none !important;
}

.agreement-box {
    padding: 18px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-soft);
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.form-check-label {
    color: var(--app-muted);
}

.form-check-label a {
    color: var(--app-primary-dark);
    font-weight: 800;
}

.signature-panel {
    margin-top: 22px;
}

.signature-pad-shell {
    display: grid;
    gap: 14px;
}

.signature-pad-canvas-wrap {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border: 1px dashed rgba(34, 211, 238, 0.44);
    border-radius: 8px;
    background:
        linear-gradient(transparent 31px, rgba(51, 65, 85, 0.42) 32px),
        linear-gradient(90deg, transparent 31px, rgba(51, 65, 85, 0.42) 32px),
        #020617;
    background-size: 32px 32px;
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.08), inset 0 0 28px rgba(6, 182, 212, 0.08);
}

.signature-pad-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.signature-pad-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #64748b;
    font-weight: 700;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.signature-panel.has-signature .signature-pad-placeholder {
    opacity: 0;
}

.signature-pad-actions {
    display: flex;
    justify-content: flex-end;
}

.signature-feedback {
    display: none;
    margin-top: 10px;
    color: var(--app-danger);
    font-weight: 700;
}

.signature-feedback.is-visible {
    display: block;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 34px;
}

.wizard-actions.is-end {
    justify-content: flex-end;
}

.btn,
.wizard-next,
.wizard-prev,
.wizard-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--app-brand), var(--app-primary));
    color: #020617;
    font-weight: 800;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wizard-next,
.wizard-submit {
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.32);
}

.wizard-prev,
[data-signature-clear] {
    border-color: var(--app-border);
    background: rgba(15, 23, 42, 0.86);
    color: var(--app-text);
}

.btn:hover,
.btn:focus,
.wizard-next:hover,
.wizard-next:focus,
.wizard-prev:hover,
.wizard-prev:focus,
.wizard-submit:hover,
.wizard-submit:focus {
    transform: translateY(-1px);
}

.wizard-next:hover,
.wizard-next:focus,
.wizard-submit:hover,
.wizard-submit:focus {
    background: linear-gradient(135deg, #4338ca, #22d3ee);
    color: #020617;
}

.field-invalid .form-control,
.field-invalid .form-select,
.field-invalid input,
.field-invalid select,
.field-invalid textarea,
.field-invalid.niceCountryInputSelector,
.field-invalid .niceCountryInputSelector {
    border-color: var(--app-danger) !important;
}

.field-invalid.niceCountryInputSelector .niceCountryInputMenu,
.field-invalid .niceCountryInputSelector .niceCountryInputMenu {
    border-color: var(--app-danger) !important;
}

.error-copy,
.field-error {
    color: var(--app-danger);
    font-size: 0.88rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .application-header {
        grid-template-columns: 1fr auto;
        row-gap: 14px;
    }

    .application-nav {
        display: none;
    }

    .application-menu-toggle {
        display: inline-flex;
    }

    .application-mobile-nav {
        grid-column: 1 / -1;
        display: grid;
        max-height: 0;
        gap: 4px;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.25s ease, opacity 0.25s ease;
    }

    .application-mobile-nav.is-open {
        max-height: 360px;
        opacity: 1;
    }

    .application-mobile-nav a {
        padding: 12px 14px;
        border-radius: 8px;
        color: var(--app-muted-strong);
        font-weight: 800;
    }

    .application-mobile-nav a:hover,
    .application-mobile-nav a:focus {
        background: rgba(30, 41, 59, 0.72);
        color: var(--app-text);
    }

    .wizard-steps,
    .step-one-grid,
    .step-two-grid,
    .row,
    .kyc-grid,
    .company-fields,
    .beneficiary-fields,
    .related-financial-details {
        grid-template-columns: 1fr;
    }

    .enquiry-form {
        padding: 32px 24px 36px;
    }

    .wizard-shell {
        padding: 24px 24px 0;
    }
}

@media (max-width: 640px) {
    .application-header {
        min-height: 74px;
        padding: 14px 18px;
    }

    .application-login {
        min-width: 100px;
        padding: 10px 18px;
    }

    .account-opening-section {
        padding: 28px 12px 52px;
    }

    .birth-date {
        grid-template-columns: 1fr;
    }

    .wizard-actions {
        flex-direction: column-reverse;
    }

    .wizard-actions .btn {
        width: 100%;
    }
}
