/* Loan form styles. All themeable values are CSS custom properties — to re-skin,
   override any of these in your own <style> block or edit them here directly. */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Fonts */
    --font-body:     'DM Sans';
    --font-heading:  'Plus Jakarta Sans';
    --font-fallback: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

    /* Sizes */
    --size-base:       17px;
    --size-h1:         26px;
    --size-h1-lg:      32px;
    --size-h2:         22px;
    --size-h2-lg:      26px;
    --size-label:      15px;
    --size-input:      16px;
    --size-button:     15px;
    --size-submit:     16px;
    --size-help:       13px;
    --size-tcpa:       13px;
    --size-step-tab:   13px;
    --size-step-count: 15px;

    /* Colors */
    --color-primary:        #2563eb;
    --color-primary-dark:   #1d4ed8;
    --color-primary-light:  #dbeafe;
    --color-success:        #059669;
    --color-success-dark:   #047857;
    --color-error:          #dc2626;
    --color-text:           #111827;
    --color-text-secondary: #4b5563;
    --color-text-muted:     #6b7280;
    --color-text-label:     #374151;
    --color-border:         #e5e7eb;
    --color-border-hover:   #d1d5db;
    --color-border-focus:   #93c5fd;
    --color-border-filled:  #c7d7fe;
    --color-bg-input:       #fafbff;
    --color-progress-track: #e8f0fe;

    /* Radius */
    --radius-card:   24px;
    --radius-input:  12px;
    --radius-button: 12px;
    --radius-tcpa:   14px;
    --radius-footer: 14px;

    /* Backgrounds */
    --bg-page:   linear-gradient(135deg, #f0f4ff, #e8f0fe);
    --bg-card:   #ffffff;
    --bg-tcpa:   linear-gradient(135deg, #f8faff, #eff6ff);
    --bg-footer: #f9fafb99;

    /* Shadows */
    --shadow-card:         0 1px 2px #0000000a, 0 4px 16px #2563eb0f, 0 20px 60px #0000000f;
    --shadow-button:       0 4px 14px #2563eb40;
    --shadow-button-hover: 0 6px 20px #2563eb59;
    --shadow-submit:       0 4px 14px #05966940;
    --shadow-submit-hover: 0 6px 20px #05966959;
    --shadow-input-focus:  0 0 0 3px #2563eb14, 0 1px 4px #2563eb1a;
    --shadow-progress:     0 0 8px #2563eb66;

    /* Spacing */
    --space-card-padding:      28px 24px;
    --space-card-padding-lg:   40px;
    --space-field-gap:         20px;
    --space-input-padding:     14px 16px;
    --space-button-padding:    14px 32px;
    --space-button-padding-lg: 16px 32px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body), var(--font-fallback, system-ui, sans-serif);
    font-size: var(--size-base, 17px);
    line-height: 1.5;
    color: var(--color-text, #111827);
    background: var(--bg-page, #fff);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-display {
    font-family: var(--font-heading), var(--font-fallback, system-ui, sans-serif);
    letter-spacing: -0.025em;
}

/* ================== Page layout ================== */

.wrap {
    max-width: 720px;
    margin: 32px auto;
    padding: 0 16px;
}

.form-card {
    background: var(--bg-card, #fff);
    border: 1px solid #2563eb14;
    border-radius: var(--radius-card, 24px);
    box-shadow: var(--shadow-card, 0 4px 16px rgba(0,0,0,0.05));
    /* padding: var(--space-card-padding, 28px 24px)*/
	padding: 15px 0px;
}
@media (min-width: 640px) {
    .form-card { padding: var(--space-card-padding-lg, 40px); }
}

/* ================== Header ================== */

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}
.form-header h1 {
    font-family: var(--font-heading), var(--font-fallback, system-ui, sans-serif);
    font-size: var(--size-h1, 26px);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--color-text, #111827);
    margin: 0;
    text-transform: uppercase;
}
@media (min-width: 640px) {
    .form-header h1 { font-size: var(--size-h1-lg, 32px); }
}
.step-count {
    font-size: var(--size-step-count, 15px);
    font-weight: 500;
    color: var(--color-text-muted, #6b7280);
    white-space: nowrap;
}

/* Progress bar */
.progress {
    height: 8px;
    background: var(--color-progress-track, #e8f0fe);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 12px;
}
.bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary, #2563eb), #3b82f6);
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-progress, 0 0 8px #2563eb66);
}

/* Step mini-tabs (desktop only) */
.step-tabs {
    display: none;
    margin-bottom: 32px;
}
@media (min-width: 640px) {
    .step-tabs { display: flex; }
}
.step-tab {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: var(--size-step-tab, 13px);
    font-weight: 600;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: default;
    transition: color 0.15s;
}
.step-tab.active {
    color: var(--color-primary, #2563eb);
    position: relative;
}
.step-tab.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--color-primary, #2563eb);
    border-radius: 99px;
}
.step-tab.done {
    color: var(--color-text-muted, #6b7280);
}

/* Pills progress (alternative to .progress bar) */
.progress-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.progress-pills .pill {
    flex: 1;
    height: 8px;
    background: var(--color-progress-track, #e8f0fe);
    border-radius: 99px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.progress-pills .pill.active,
.progress-pills .pill.done {
    background: linear-gradient(90deg, var(--color-primary, #2563eb), #3b82f6);
}
.progress-pills .pill.active {
    box-shadow: var(--shadow-progress, 0 0 8px #2563eb66);
}

/* ================== Loan amount field (4 modes) ================== */

.loan-amount label { margin-bottom: 12px; }

/* Slider mode */
.loan-amount-slider .slider-wrap { text-align: center; }
.loan-amount-slider .slider-value {
    display: block;
    font-family: var(--font-heading), var(--font-fallback, system-ui, sans-serif);
    font-size: 38px;
    font-weight: 800;
    color: var(--color-primary, #2563eb);
    margin-bottom: 14px;
    letter-spacing: -0.025em;
}
.loan-amount-slider input[type=range] {
    width: 100%;
    accent-color: var(--color-primary, #2563eb);
    height: 8px;
    cursor: pointer;
}
.loan-amount-slider .slider-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--color-text-muted, #6b7280);
    margin-top: 8px;
    font-weight: 500;
}

/* Ranges mode */
.loan-amount-ranges .loan-ranges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.loan-range {
    padding: 18px 12px;
    background: var(--color-bg-input, #fafbff);
    border: 2px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-input, 12px);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text, #111827);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.loan-range:hover {
    border-color: var(--color-primary, #2563eb);
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px #2563eb14;
}
.loan-range.selected {
    border-color: var(--color-primary, #2563eb);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--color-primary-dark, #1d4ed8);
    box-shadow: 0 0 0 3px #2563eb14;
}

/* Dropdown / dropdown_ranges / manual_dropdown — inherit base .field select/input look. */
/* (kept on purpose minimal so they match the rest of the form)                          */

/* ================== Section title ================== */

.step-title {
    margin-bottom: 24px;
}
.step-title h2 {
    font-family: var(--font-heading), var(--font-fallback, system-ui, sans-serif);
    font-size: var(--size-h2, 22px);
    font-weight: 700;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #1e3a8a, var(--color-primary, #2563eb));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}
@media (min-width: 640px) {
    .step-title h2 { font-size: var(--size-h2-lg, 26px); }
}
.step-title p {
    margin: 0;
    font-size: 15px;
    color: var(--color-text-muted, #6b7280);
}

/* ================== Step layout ================== */

.step {
    border: none;
    padding: 0;
    margin: 0;
    animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.step[hidden] { display: none; }

.fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-field-gap, 20px);
    margin-bottom: 28px;
}
@media (min-width: 640px) {
    .fields { grid-template-columns: 1fr 1fr; }
}
.field.wide { grid-column: 1 / -1; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================== Fields ================== */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field label {
    font-size: var(--size-label, 15px);
    font-weight: 600;
    color: var(--color-text-label, #374151);
    letter-spacing: -0.01em;
}
.field .req {
    color: var(--color-error, #dc2626);
    margin-left: 2px;
}

.field input:not([type=radio]):not([type=checkbox]),
.field select {
    width: 100%;
    padding: var(--space-input-padding, 14px 16px);
    font-size: var(--size-input, 16px);
    font-family: inherit;
    color: var(--color-text, #111827);
    background: var(--color-bg-input, #fafbff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-input, 12px);
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
    -webkit-appearance: none;
    appearance: none;
}
.field input:not([type=radio]):not([type=checkbox])::placeholder { color: #9ca3af; }
.field input:not([type=radio]):not([type=checkbox]):hover,
.field select:hover {
    border-color: var(--color-border-hover, #d1d5db);
}
.field input:not([type=radio]):not([type=checkbox]):focus,
.field select:focus {
    outline: none;
    background: #fff;
    border-color: var(--color-border-focus, #93c5fd);
    box-shadow: var(--shadow-input-focus, 0 0 0 3px #2563eb14);
}
.field input:not([type=radio]):not([type=checkbox]):not(:placeholder-shown):not(:focus),
.field select:not(:focus):valid {
    background: #fff;
    border-color: var(--color-border-filled, #c7d7fe);
}

.field select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
}

.field.has-error input,
.field.has-error select {
    border-color: #fca5a5;
    background: #fef2f2;
}
.field .help {
    font-size: var(--size-help, 13px);
    color: var(--color-text-muted, #6b7280);
}
.field .err {
    font-size: var(--size-help, 13px);
    font-weight: 500;
    color: var(--color-error, #dc2626);
}

/* ================== Navigation ================== */

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.nav .spacer { flex: 1; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--space-button-padding, 14px 32px);
    font-size: var(--size-button, 15px);
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-button, 12px);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-prev {
    background: #fff;
    color: var(--color-text-muted, #6b7280);
    border: 1px solid var(--color-border, #e5e7eb);
}
.btn-prev:hover {
    background: #f9fafb;
    color: var(--color-text, #111827);
    border-color: var(--color-border-hover, #d1d5db);
}
.btn-next, .btn-submit {
    background: var(--color-primary, #2563eb);
    color: #fff;
    box-shadow: var(--shadow-button, 0 4px 14px #2563eb40);
}
.btn-next:hover, .btn-submit:hover {
    background: var(--color-primary-dark, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: var(--shadow-button-hover, 0 6px 20px #2563eb59);
}
.btn-next:active, .btn-submit:active {
    transform: scale(0.97) translateY(0);
}
/* Disabled state — JS toggles `disabled` attr while required fields are unfilled. */
.btn-next:disabled, .btn-submit:disabled,
.btn-next:disabled:hover, .btn-submit:disabled:hover {
    background: var(--color-border-hover, #d1d5db);
    color: var(--color-text-muted, #6b7280);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-submit {
    background: var(--color-success, #059669);
    box-shadow: var(--shadow-submit, 0 4px 14px #05966940);
    padding: var(--space-button-padding-lg, 16px 32px);
    font-size: var(--size-submit, 16px);
}
.btn-submit:hover {
    background: var(--color-success-dark, #047857);
    box-shadow: var(--shadow-submit-hover, 0 6px 20px #05966959);
}

/* ================== Email domain autocomplete ================== */

.email-suggestions {
    position: absolute;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-input, 12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
}
.email-suggestion {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    border-radius: 8px;
    text-align: left;
    font-family: inherit;
    font-size: 15px;
    color: var(--color-text, #111827);
    cursor: pointer;
    transition: background 0.1s;
}
.email-suggestion:hover {
    background: var(--color-primary-50, #eff6ff);
    color: var(--color-primary-dark, #1d4ed8);
}

/* ================== Radio group (2-option select alternative) ================== */

.radio-group {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    padding: 6px 2px;
}
.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text, #111827);
    user-select: none;
}
/* Hide the native radio but keep it accessible to keyboard/screen readers. */
.radio-option input[type=radio] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    margin: 0;
}
.radio-mark {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border-hover, #d1d5db);
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.radio-mark::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: var(--color-primary, #2563eb);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.15s, transform 0.15s;
}
.radio-option input[type=radio]:checked ~ .radio-mark {
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px #2563eb14;
}
.radio-option input[type=radio]:checked ~ .radio-mark::after {
    opacity: 1;
    transform: scale(1);
}
.radio-option input[type=radio]:focus-visible ~ .radio-mark {
    box-shadow: 0 0 0 3px #2563eb33;
}

/* ================== Switch (iOS-style) ================== */

.switch-wrap {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 6px 0;
}
.switch {
    position: relative;
    width: 56px;
    height: 32px;
    background: var(--color-border, #e5e7eb);
    border: none;
    border-radius: 99px;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.switch.on {
    background: var(--color-primary, #2563eb);
}
.switch.on::after {
    left: 27px;
}
.switch-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text, #111827);
}

/* ================== Toggle group (2-option select alternative) ================== */

.toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.toggle-option {
    padding: 14px 16px;
    background: var(--color-bg-input, #fafbff);
    border: 2px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-input, 12px);
    text-align: center;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text, #111827);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-option:hover {
    border-color: var(--color-primary, #2563eb);
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px #2563eb14;
}
.toggle-option.selected {
    border-color: var(--color-primary, #2563eb);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--color-primary-dark, #1d4ed8);
    box-shadow: 0 0 0 3px #2563eb14;
}

/* ================== Per-step disclaimer ================== */

.step-disclaimer {
    margin: -8px 0 20px;
    padding: 14px 18px;
    background: var(--bg-tcpa, linear-gradient(135deg, #f8faff, #eff6ff));
    border: 1px solid #e0e7ff;
    border-radius: var(--radius-tcpa, 14px);
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-secondary, #4b5563);
}

/* ================== TCPA disclaimer ================== */

.tcpa {
    background: var(--bg-tcpa, linear-gradient(135deg, #f8faff, #eff6ff));
    border: 1px solid #e0e7ff;
    border-radius: var(--radius-tcpa, 14px);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.tcpa-label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: var(--size-tcpa, 13px);
    line-height: 1.5;
    color: var(--color-text-secondary, #4b5563);
    cursor: pointer;
}
.tcpa-label input {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary, #2563eb);
    cursor: pointer;
}
.tcpa-label span strong { color: var(--color-text, #111827); }

/* ================== Security footer ================== */

.security-footer {
    margin-top: 28px;
    padding: 14px 18px;
    background: var(--bg-footer, #f9fafb99);
    border: 1px solid #f3f4f6;
    border-radius: var(--radius-footer, 14px);
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted, #6b7280);
}
.security-footer .lock { color: var(--color-success, #059669); }

/* ================== Button layouts ================== */

/* default 'side_by_side' is already styled above (.nav flex row) */

/* 'stacked': Next full-width on top, Back as small ghost link below */
.layout-stacked .nav {
    flex-direction: column;
    gap: 0;
}
.layout-stacked .nav .btn-next,
.layout-stacked .nav .btn-submit {
    width: 100%;
}
.layout-stacked .btn-back-link {
    display: block;
    margin: 14px auto 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted, #6b7280);
    cursor: pointer;
    padding: 6px 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.layout-stacked .btn-back-link:hover {
    color: var(--color-text, #111827);
}

/* 'back_top': small Back arrow at top of step, Next full-width at bottom */
.layout-back_top .btn-back-top {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    margin: -8px 0 16px -10px;
    transition: all 0.15s;
}
.layout-back_top .btn-back-top:hover {
    color: var(--color-primary, #2563eb);
    background: var(--color-primary-50, #eff6ff);
}
.layout-back_top .nav {
    justify-content: stretch;
}
.layout-back_top .nav .btn-next,
.layout-back_top .nav .btn-submit {
    flex: 1;
    width: 100%;
}

/* ================== Advertising disclosure (popup, doesn't push layout) ================== */

.ad-disclosure {
    margin: 24px 0;
    text-align: left;
    /* details inside is the actual anchor; .ad-disclosure is just spacing */
}
.ad-disclosure details {
    display: inline-block;
    position: relative;
}
.ad-link {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary, #2563eb);
    text-decoration: none;
    user-select: none;
    transition: color 0.15s;
}
.ad-link::-webkit-details-marker { display: none; }
.ad-link:hover { color: var(--color-primary-dark, #1d4ed8); }
.ad-link .ad-info {
    font-size: 16px;
    line-height: 1;
    opacity: 0.85;
}

/* Popup itself — absolutely positioned, doesn't affect surrounding layout.
   JS picks the side (up / down) with more viewport room on open and shifts
   horizontally when the centered popup would overflow the viewport. */
.ad-popup {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, 92vw);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(0,0,0,0.16), 0 4px 8px rgba(0,0,0,0.06);
    padding: 16px 22px 18px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.ad-disclosure details[open] .ad-popup {
    opacity: 1;
    pointer-events: auto;
}

/* Direction: up = above trigger (default), down = below trigger. JS sets data-dir. */
.ad-disclosure[data-dir="up"] .ad-popup   { bottom: calc(100% + 10px); }
.ad-disclosure[data-dir="down"] .ad-popup { top: calc(100% + 10px); }

/* Triangle pointer */
.ad-popup::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 0; height: 0;
    border: 7px solid transparent;
}
.ad-disclosure[data-dir="up"] .ad-popup::after {
    top: 100%;
    transform: translateX(-50%);
    border-top-color: #fff;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,0.06));
}
.ad-disclosure[data-dir="down"] .ad-popup::after {
    bottom: 100%;
    transform: translateX(-50%);
    border-bottom-color: #fff;
    filter: drop-shadow(0 -2px 1px rgba(0,0,0,0.06));
}

.ad-popup-content {
    font-size: 12px;
    line-height: 1.6;
    color: var(--color-text-secondary, #4b5563);
    text-align: justify;
    max-height: 50vh;
    overflow-y: auto;
}
.ad-popup-content strong {
    color: var(--color-text, #111827);
    font-weight: 700;
}

.ad-close {
    position: absolute;
    top: 6px; right: 8px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--color-text-muted, #6b7280);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}
.ad-close:hover {
    background: #f3f4f6;
    color: var(--color-text, #111827);
}

/* ================== Loading screen ================== */
/* Loader styles live in assets/loading.css — paired with loading.html.            */
/* Edit that file to fully customize the wait UI without touching this stylesheet. */

/* ================== Decline page ================== */

.wrap.decline { text-align: center; }
.wrap.decline .form-card { padding: 48px 28px; }
@media (min-width: 640px) {
    .wrap.decline .form-card { padding: 56px 48px; }
}

.decline-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary, #2563eb);
}
.decline-icon svg { width: 44px; height: 44px; }

.wrap.decline h1 {
    font-family: var(--font-heading), var(--font-fallback, system-ui, sans-serif);
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--color-text, #111827);
    letter-spacing: -0.025em;
}
@media (min-width: 640px) {
    .wrap.decline h1 { font-size: 30px; }
}

.wrap.decline .lead {
    font-size: 17px;
    line-height: 1.5;
    color: var(--color-text-secondary, #4b5563);
    margin: 0 auto 28px;
    max-width: 480px;
}

.decline-section {
    text-align: left;
    background: var(--color-bg-input, #fafbff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 14px;
    padding: 18px 22px;
    margin: 12px 0;
}
.decline-section h3 {
    font-family: var(--font-heading), var(--font-fallback, system-ui, sans-serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text, #111827);
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}
.decline-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.decline-section li {
    padding: 5px 0 5px 22px;
    position: relative;
    font-size: 15px;
    color: var(--color-text-secondary, #4b5563);
    line-height: 1.5;
}
.decline-section li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 13px;
    width: 6px;
    height: 6px;
    background: var(--color-primary, #2563eb);
    border-radius: 50%;
}

.decline-actions {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--color-primary, #2563eb);
    color: #fff;
    border-radius: var(--radius-button, 12px);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.15s;
    box-shadow: var(--shadow-button, 0 4px 14px #2563eb40);
}
.btn-link:hover {
    background: var(--color-primary-dark, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: var(--shadow-button-hover, 0 6px 20px #2563eb59);
}
.btn-link.ghost {
    background: #fff;
    color: var(--color-text-secondary, #4b5563);
    border: 1px solid var(--color-border, #e5e7eb);
    box-shadow: none;
}
.btn-link.ghost:hover {
    background: #f9fafb;
    color: var(--color-text, #111827);
    border-color: var(--color-border-hover, #d1d5db);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
/* ================== Dark theme override (Cash RVYN) ================== */

:root {
    /* Fonts — Work Sans throughout, matches the iOS app */
    --font-body:    'Work Sans';
    --font-heading: 'Work Sans';

    /* Brand orange (replaces the form's default blue) */
    --color-primary:        #FF981A;
    --color-primary-dark:   #F9771A;
    --color-primary-light:  rgba(255, 152, 26, 0.16);
    /* Submit unified with primary — single brand colour for all CTAs */
    --color-success:        #FF981A;
    --color-success-dark:   #F9771A;
    --color-text:           #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.80);
    --color-text-muted:     rgba(255, 255, 255, 0.60);
    --color-text-label:     #ffffff;
    --color-border:         rgba(255, 255, 255, 0.16);
    --color-border-hover:   rgba(255, 255, 255, 0.32);
    --color-border-focus:   #FF981A;
    --color-border-filled:  rgba(255, 255, 255, 0.24);
    --color-bg-input:       #141414;
    --color-progress-track: rgba(255, 255, 255, 0.10);

    /* Backgrounds — pure black, matches the app's bgPrimary (#000) */
    --bg-page:   #000000;
    --bg-card:   #000000;
    --bg-tcpa:   #0e0e0e;
    --bg-footer: #0e0e0e;

    /* Shadows — subtle warm glow on focus / CTA */
    --shadow-card:         none;
    --shadow-button:       0 4px 14px rgba(255, 152, 26, 0.40);
    --shadow-button-hover: 0 6px 20px rgba(255, 152, 26, 0.55);
    --shadow-submit:       0 4px 14px rgba(255, 152, 26, 0.40);
    --shadow-submit-hover: 0 6px 20px rgba(255, 152, 26, 0.55);
    --shadow-input-focus:  0 0 0 3px rgba(255, 152, 26, 0.22);
    --shadow-progress:     0 0 8px rgba(255, 152, 26, 0.55);

    /* Radius — pill buttons, generous input radius like the app */
    --radius-card:   24px;
    --radius-input:  16px;
    --radius-button: 999px;
    --radius-tcpa:   16px;
    --radius-footer: 16px;
}

body         { background: #000000; }
.form-card   { border-color: transparent; }

/* Section title — solid white (the default blue gradient washes out on black) */
.step-title h2 {
    background: none;
    -webkit-text-fill-color: initial;
    color: #ffffff;
}

/* Inputs / selects */
.field input::placeholder        { color: rgba(255, 255, 255, 0.40); }
.field input:focus,
.field select:focus              { background: #1a1a1a; color: #ffffff; }
.field input:not([type=radio]):not([type=checkbox]):not(:placeholder-shown):not(:focus),
.field select:not(:focus):valid  { background: #1a1a1a; }
.field input,
.field select                    { color: #ffffff; }
.field select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

/* Date input native picker icon — invert so calendar/clear icons are visible on dark */
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }

/* TCPA / disclaimer / footer / disclosure */
.tcpa, .step-disclaimer { background: #0e0e0e; border-color: rgba(255, 255, 255, 0.10); color: rgba(255, 255, 255, 0.80); }
.tcpa-label             { color: rgba(255, 255, 255, 0.80); }
.security-footer        { background: #0e0e0e; border-color: rgba(255, 255, 255, 0.10); color: rgba(255, 255, 255, 0.60); }
.ad-disclosure          { border-color: transparent; }
.ad-link                { color: #FF981A; }
.ad-link:hover          { color: #F9771A; }
.ad-popup               { background: #0e0e0e; border-color: rgba(255, 255, 255, 0.10); }
.ad-popup-content       { color: rgba(255, 255, 255, 0.80); }
.ad-disclosure[data-dir="up"]   .ad-popup::after { border-top-color: #0e0e0e; }
.ad-disclosure[data-dir="down"] .ad-popup::after { border-bottom-color: #0e0e0e; }
.ad-close               { color: rgba(255, 255, 255, 0.60); }
.ad-close:hover         { background: rgba(255, 255, 255, 0.10); color: #ffffff; }

/* Loan amount range buttons (mode = ranges) */
.loan-range {
    background: #141414;
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}
.loan-range:hover {
    background: #1a1a1a;
    border-color: #FF981A;
    box-shadow: 0 2px 8px rgba(255, 152, 26, 0.20);
}
.loan-range.selected {
    background: rgba(255, 152, 26, 0.16);
    border-color: #FF981A;
    color: #FFB85C;
    box-shadow: 0 0 0 3px rgba(255, 152, 26, 0.18);
}

/* Toggle / Radio / Switch */
.toggle-option {
    background: #141414;
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}
.toggle-option:hover { background: #1a1a1a; border-color: #FF981A; }
.toggle-option.selected {
    background: rgba(255, 152, 26, 0.16);
    border-color: #FF981A;
    color: #FFB85C;
}
.radio-mark    { background: #141414; border-color: rgba(255, 255, 255, 0.32); }
.switch        { background: rgba(255, 255, 255, 0.16); }

/* Tabs (if shown) */
.step-tab        { color: rgba(255, 255, 255, 0.40); }
.step-tab.done   { color: rgba(255, 255, 255, 0.60); }
.step-tab.active { color: #FF981A; }

/* Back / prev button — dark ghost style */
.btn-prev {
    background: #141414;
    color: rgba(255, 255, 255, 0.80);
    border-color: rgba(255, 255, 255, 0.16);
}
.btn-prev:hover {
    background: #1a1a1a;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.32);
}

/* Decline page */
.wrap.decline h1   { color: #ffffff; }
.decline-section   { background: #0e0e0e; border-color: rgba(255, 255, 255, 0.10); }
.decline-section h3{ color: #ffffff; }
.decline-section li { color: rgba(255, 255, 255, 0.80); }
.decline-icon      { background: rgba(255, 152, 26, 0.18); color: #FF981A; }
.btn-link.ghost    { background: #141414; color: rgba(255, 255, 255, 0.80); border-color: rgba(255, 255, 255, 0.16); }
.btn-link.ghost:hover { background: #1a1a1a; color: #ffffff; border-color: rgba(255, 255, 255, 0.32); }

/* Match base selector specificity so dark focus background isn't overridden */
.field input:not([type=radio]):not([type=checkbox]):focus,
.field select:focus { background: #1a1a1a; color: #ffffff; }

/* ================== iOS glass-style CTA buttons (orange) ================== */
/* :not(:disabled) so the disabled state keeps its grey look */

.btn-next:not(:disabled),
.btn-submit:not(:disabled) {
    background: linear-gradient(180deg, #FFB85C 0%, #FF981A 50%, #F9771A 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #1a0d00;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(0, 0, 0, 0.20),
        0 6px 20px rgba(255, 152, 26, 0.45),
        0 1px 3px rgba(0, 0, 0, 0.35);
    border-radius: 999px;
}
.btn-next:not(:disabled):hover,
.btn-submit:not(:disabled):hover {
    background: linear-gradient(180deg, #FFC57A 0%, #FFA833 50%, #F58817 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 0 rgba(0, 0, 0, 0.20),
        0 8px 28px rgba(255, 152, 26, 0.60),
        0 1px 3px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
}
.btn-next:not(:disabled):active,
.btn-submit:not(:disabled):active {
    background: linear-gradient(180deg, #E8841A 0%, #D87010 50%, #C56010 100%);
    transform: scale(0.98) translateY(0);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.30),
        0 2px 8px rgba(255, 152, 26, 0.40);
}

/* Disabled state — matches glass button shape but ghost-dim */
.btn-next:disabled,
.btn-submit:disabled,
.btn-next:disabled:hover,
.btn-submit:disabled:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    box-shadow: none;
    text-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ================== Cash RVYN — flat / no glow ================== */
/* Drop the orange glow halo from inputs / buttons / progress bar.
   Borders + brand colour alone communicate state — extra shadow on
   pure black bg felt over-the-top. */
:root {
    --shadow-button:       none;
    --shadow-button-hover: none;
    --shadow-submit:       none;
    --shadow-submit-hover: none;
    --shadow-input-focus:  none;
    --shadow-progress:     none;
}

/* Glass-style CTA buttons hard-coded their own multi-layer box-shadow —
   override the default + active states explicitly. */
.btn-next:not(:disabled),
.btn-submit:not(:disabled) {
    box-shadow: none;
}
.btn-next:not(:disabled):hover,
.btn-submit:not(:disabled):hover {
    box-shadow: none;
}
.btn-next:not(:disabled):active,
.btn-submit:not(:disabled):active {
    box-shadow: none;
}

/* Progress bar / pills — flat fill, no glow */
.bar,
.progress-pills .pill.active,
.progress-pills .pill.done {
    box-shadow: none;
}

/* Loan range / toggle / radio — kill focus halo */
.loan-range:hover,
.loan-range.selected,
.toggle-option:hover,
.toggle-option.selected,
.radio-option input[type=radio]:checked ~ .radio-mark,
.radio-option input[type=radio]:focus-visible ~ .radio-mark {
    box-shadow: none;
}

/* ================== Cash RVYN visual tweaks (re-applied) ================== */

/* Pill inputs / range / toggle — match app LabeledTextField */
:root { --radius-input: 50px; }

.loan-range,
.loan-range:hover,
.loan-range.selected,
.toggle-option,
.toggle-option:hover,
.toggle-option.selected {
    border-width: 1px;
}

/* Solid accent progress — kill the default blue gradient on both
   `.bar` (continuous mode) and `.progress-pills .pill` (pills mode). */
.bar,
.progress-pills .pill.active,
.progress-pills .pill.done {
    background: #FF981A;
}
