:root {
    --ui-primary: #00aeef;
    --ui-secondary: #0058a9;
    --ui-success: #00c389;
    --ui-info: #00b4f1;
    --ui-warning: #f4b400;
    --ui-error: #dc2626;
    --ui-neutral: #64748b;
    --bla-cyan: #00aeef;
    --bla-blue: #0058a9;
    --bla-lime: #bfd730;
    --ui-surface: #ffffff;
    --ui-background: #f5f8fb;
    --ui-border: #dbe4ec;
    --ui-radius: 12px;
    --ui-shadow: 0 10px 30px rgba(0, 88, 169, 0.08);
}

body {
    font-family: "Noto Sans Thai", "Tahoma", sans-serif;
    color: #1f2937;
    font-size: 15px;
    line-height: 1.6;
    background: var(--ui-background);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea,
.select2-container {
    font-family: inherit;
}

h1,
h2,
h3,
p,
label,
button {
    line-height: inherit;
}

input,
select,
textarea,
.form-control {
    font-size: 16px;
    line-height: 1.4;
}

h1,
.index-heading {
    font-size: clamp(1.5rem, 1.2vw + 1.1rem, 1.875rem);
}

h2 {
    font-size: clamp(1.3125rem, 0.8vw + 1rem, 1.625rem);
}

small,
.form-text {
    font-size: 0.8125rem;
    line-height: 1.5;
}

.btn-primary {
    min-height: 46px;
    padding: 0.7rem 1.5rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 88, 169, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    background-color: var(--ui-secondary) !important;
    border-color: var(--ui-secondary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background-color: var(--ui-primary) !important;
    border-color: var(--ui-primary) !important;
    box-shadow: 0 6px 16px rgba(0, 174, 239, 0.25);
    transform: translateY(-1px);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(0, 174, 239, 0.45);
    outline-offset: 2px;
}

.btn:disabled {
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.65;
    transform: none;
}

.app-action-secondary {
    min-height: 46px;
    padding: 0.7rem 1.5rem;
    color: var(--ui-secondary);
    font-size: 1rem;
    font-weight: 600;
    background: #fff;
    border: 1px solid var(--ui-secondary);
    border-radius: 8px;
}

.app-action-secondary:hover,
.app-action-secondary:focus {
    color: #fff;
    background: var(--ui-secondary);
}

.text-danger {
    color: var(--ui-error) !important;
}

.field-validation-error {
    display: block;
    margin-top: 0.375rem;
    color: var(--ui-error);
    font-size: 0.8125rem;
}

.form-control[aria-invalid="true"],
.is-invalid-control {
    border-color: var(--ui-error) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.consent-table {
    margin-bottom: 0;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
}

.consent-checkbox {
    appearance: none;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin-top: 0.125rem;
    border: 2px solid #a8b5c2;
    border-radius: 6px;
    display: inline-block;
    position: relative;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.1s ease;
}

.consent-checkbox:hover {
    border-color: var(--ui-secondary);
}

.consent-checkbox:focus-visible {
    outline: 3px solid rgba(0, 174, 239, 0.35);
    outline-offset: 3px;
}

.consent-checkbox:checked {
    background-color: var(--ui-primary);
    border-color: var(--ui-primary);
}

.consent-checkbox::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 12px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -60%) rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.consent-checkbox:checked::after {
    opacity: 1;
}

.app-steps {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    max-width: 960px;
    margin: 1.25rem auto 1.75rem;
    padding: 0 1rem;
}

.app-step {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0.75rem 1rem;
    color: var(--ui-neutral);
    font-size: clamp(0.875rem, 0.25vw + 0.8rem, 0.9375rem);
    line-height: 1.35;
    text-align: center;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
}

.app-step.is-active {
    color: var(--ui-secondary);
    font-weight: 600;
    background: rgba(0, 174, 239, 0.1);
    border-color: var(--ui-primary);
    box-shadow: 0 3px 10px rgba(0, 174, 239, 0.12);
}

.wizard-card {
    padding: clamp(1.25rem, 3vw, 2.5rem);
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

.wizard-card label,
.wizard-card legend,
.wizard-card p {
    font-size: clamp(0.9375rem, 0.2vw + 0.9rem, 1rem);
}

.wizard-card .form-control,
.wizard-card .select2-selection,
.wizard-card .select2-results__option,
.wizard-card .fontom,
.wizard-card .input-box {
    font-size: 1rem !important;
}

.wizard-card .form-control,
.wizard-card .select2-selection--single {
    min-height: 44px;
}

.wizard-card input.form-control,
.wizard-card select.form-control,
.wizard-card textarea.form-control {
    height: auto;
    padding: 0.625rem 0.75rem;
}

.wizard-card input.form-control {
    vertical-align: middle;
}

.wizard-card input.form-control::placeholder,
.wizard-card textarea.form-control::placeholder {
    color: var(--ui-neutral);
    opacity: 0.75;
}

.wizard-card .select2-selection--single .select2-selection__rendered {
    padding-right: 2rem;
    padding-left: 0.75rem;
    line-height: 1.4;
}

.wizard-card .select2-selection--single {
    display: flex;
    align-items: center;
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
}

.wizard-card .select2-selection--single .select2-selection__arrow {
    top: 50%;
    min-height: 42px;
    transform: translateY(-50%);
}

.wizard-card--narrow {
    max-width: 900px;
    margin-right: auto;
    margin-left: auto;
}

.index-interest-other {
    margin-top: 1rem;
}

#application-form.wizard-card {
    max-width: 1000px;
    margin-right: auto;
    margin-left: auto;
}

.benefit-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 2rem;
    padding-right: 1rem;
    padding-left: 1rem;
}

#benefit-step .benefit-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

#benefit-step .benefit-row > [class*="col-"] {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

#benefit-step .form-control {
    max-width:100%;
}
#benefit-step .select2-container {
    width: 100% !important;
    max-width: 100%;
}

#benefit-step {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

#benefit-step .wizard-card,
#benefit-step .form-group,
#benefit-step .benefit-row,
#benefit-step [class*="col-"] {
    min-width: 0;
    max-width: 100%;
}

.benefit-banner {
    width: 100%;
}

#benefit-step input,
#benefit-step select,
#benefit-step button {
    max-width: 100%;
}

.benefit-heading {
    margin-bottom: 1.5rem;
    color: #111827;
    font-weight: 600;
}

.benefit-section-heading {
    margin: 1.5rem 0 1rem;
    color: var(--ui-secondary);
    font-weight: 600;
}

#benefit-step .form-group {
    margin-bottom: 1rem !important;
}

#benefit-step .wizard-card p {
    margin-bottom: 0.75rem;
}

#benefit-step .benefit-field {
    margin-bottom: 0.75rem;
}

#benefit-step .benefit-field > label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
}

#benefit-step .benefit-otp-contact {
    color: #1f2937;
    font-weight: 400;
}

#benefit-step #RefO .row,
#benefit-step #TextO .row {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
}

#benefit-step .single-page-actions {
    align-items: stretch;
}

#benefit-step .benefit-phone-group {
    margin-bottom: 1rem !important;
}

#benefit-step .benefit-phone-otp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.75rem;
}

#benefit-step .benefit-phone-otp .btn {
    white-space: nowrap;
}

#benefit-step .benefit-otp-reference {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
}

#benefit-step .benefit-otp-reference p {
    margin-bottom: 0;
}

#benefit-step .wizard-actions {
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    #benefit-step .benefit-row > .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    #benefit-step .benefit-row > .col-md-4:last-child:nth-child(odd) {
        flex-basis: 100%;
        max-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .benefit-container {
        padding-right: 0;
        padding-left: 0;
    }

    #benefit-step .benefit-row {
        margin-right: 0;
        margin-left: 0;
    }

    #benefit-step .benefit-row > [class*="col-"] {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    #benefit-step .benefit-heading,
    #benefit-step .benefit-section-heading {
        text-align: left !important;
    }

    #benefit-step .app-action-secondary,
    #benefit-step .index-submit {
        width: 100%;
        min-width: 0;
    }

    #benefit-step #RefO .col-md-2,
    #benefit-step #TextO .col-md-12 {
        width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    #benefit-step .wizard-card {
        width: 100%;
        padding: 1rem;
    }

    #benefit-step .app-steps {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    #benefit-step .app-step {
        overflow-wrap: anywhere;
    }

    #benefit-step .benefit-phone-otp {
        grid-template-columns: minmax(0, 1fr);
    }

    #benefit-step .benefit-phone-otp .btn {
        width: 100%;
    }

    #benefit-step .benefit-otp-reference {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    #benefit-step .wizard-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    #benefit-step .wizard-actions > .btn {
        width: 100%;
        margin: 0;
    }
}

.wizard-card .row {
    row-gap: 0.25rem;
}

.wizard-card label,
.wizard-card legend {
    margin-bottom: 0.375rem;
    font-weight: 500;
}

.consent-description {
    color: var(--ui-neutral);
    font-size: clamp(0.9375rem, 0.2vw + 0.9rem, 1rem);
    line-height: 1.7;
}

.consent-description__paragraph {
    margin: 0 0 1rem;
}

.consent-description__paragraph:last-child {
    margin-bottom: 0;
}

.app-step__short {
    display: none;
}

.consent-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: #fafdff;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.consent-option label {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

.consent-option:hover {
    background: #f3fbff;
    border-color: rgba(0, 174, 239, 0.55);
}

.single-page-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.wizard-actions {
    margin-top: 1.5rem;
}

@media (max-width: 576px) {
    body {
        font-size: 15px;
    }

    .app-steps {
        gap: 0.25rem;
        font-size: 0.8rem;
    }

    .app-step {
        padding: 0.5rem 0.25rem;
        line-height: 1.25;
        border-radius: 8px;
    }

    .app-step__full {
        display: none;
    }

    .app-step__short {
        display: inline;
    }

    .wizard-card {
        padding: 1.125rem;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .wizard-card label,
    .wizard-card legend,
    .wizard-card p {
        font-size: 0.9375rem;
    }

    .single-page-actions {
        flex-direction: column-reverse;
    }

    .single-page-actions .btn,
    .wizard-actions .btn {
        width: 100%;
    }
}

.single-page-success {
    min-height: 100vh;
    padding-top: 2rem;
    background: #f7f9fb;
}

.single-page-success .index-container {
    max-width: 760px;
    margin-top: 3rem;
    padding: 3rem 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 88, 169, 0.1);
}

.single-page-success h1 {
    color: var(--ui-success);
}
