/* Direct Car Loans Core: component styles. Everything is scoped to .dcl-* classes.
   Colours read the theme's presets and fall back to the brand palette under any other theme. */
:root {
	--dcl-navy: var(--wp--preset--color--navy, #0b1b3a);
	--dcl-blue: var(--wp--preset--color--electric, #1f5bff);
	--dcl-emerald: var(--wp--preset--color--emerald, #0e7a53);
	--dcl-ink: var(--wp--preset--color--charcoal, #22262e);
	--dcl-muted: var(--wp--preset--color--slate, #5a6272);
	--dcl-paper: var(--wp--preset--color--warm-white, #faf8f4);
	--dcl-surface: var(--wp--preset--color--surface, #ffffff);
	--dcl-line: var(--wp--preset--color--line, #e3ded4);
	--dcl-tint: var(--wp--preset--color--tint, #eef3ff);
	--dcl-danger: #b3261e;
	--dcl-warn-bg: #fff6df;
	--dcl-radius: 12px;
	--dcl-gap: clamp(1rem, 2.5vw, 1.5rem);
}

.screen-reader-text { border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; white-space: nowrap; }

/* Buttons and links */
.dcl-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7rem 1.4rem; border: 2px solid var(--dcl-blue); border-radius: 999px; background: var(--dcl-blue); color: #fff; font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.dcl-button:hover { background: var(--dcl-navy); border-color: var(--dcl-navy); color: #fff; }
.dcl-button--secondary { background: transparent; color: var(--dcl-navy); border-color: var(--dcl-navy); }
.dcl-button--secondary:hover { background: var(--dcl-navy); color: #fff; }
.dcl-button--small { min-height: 44px; padding: .5rem 1rem; font-size: .95rem; }
.dcl-button[disabled], .dcl-button[aria-disabled="true"] { opacity: .6; cursor: progress; }
.dcl-link-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; border: 0; background: none; color: var(--dcl-blue); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.dcl-button:focus-visible, .dcl-link-button:focus-visible, .dcl-apply :focus-visible, .dcl-directory :focus-visible, .dcl-calculator :focus-visible, .dcl-compare :focus-visible, .dcl-faq summary:focus-visible, .dcl-table-scroll:focus-visible { outline: 3px solid var(--dcl-blue); outline-offset: 3px; }

/* Cards, facts, badges */
.dcl-card { background: var(--dcl-surface); border: 1px solid var(--dcl-line); border-radius: var(--dcl-radius); padding: var(--dcl-gap); }
.dcl-card h3 { margin-top: 0; }
.dcl-cards, .dcl-guide-list, .dcl-branches { list-style: none; margin: 0 0 var(--dcl-gap); padding: 0; display: grid; gap: var(--dcl-gap); }
.dcl-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.dcl-guide-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.dcl-provider-card { display: flex; flex-direction: column; height: 100%; }
.dcl-card__logo { max-width: 140px; height: auto; max-height: 56px; object-fit: contain; object-position: left; margin-bottom: .5rem; }
.dcl-card__type { color: var(--dcl-muted); margin: 0 0 .5rem; font-size: .95rem; }
.dcl-card__actions, .dcl-profile__actions, .dcl-compare__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: auto; padding-top: 1rem; }
.dcl-card__facts, .dcl-facts { margin: 0; }
.dcl-card__facts > div, .dcl-facts > div { display: grid; grid-template-columns: minmax(8rem, 34%) 1fr; gap: .25rem 1rem; padding: .6rem 0; border-top: 1px solid var(--dcl-line); }
.dcl-card__facts dt, .dcl-facts dt { font-weight: 650; color: var(--dcl-navy); }
.dcl-card__facts dd, .dcl-facts dd { margin: 0; overflow-wrap: anywhere; }
.dcl-unknown { color: var(--dcl-muted); font-style: italic; }
.dcl-rate-basis { color: var(--dcl-muted); font-size: .9em; }
.dcl-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.dcl-badge { display: inline-block; padding: .15rem .6rem; border: 1px solid var(--dcl-line); border-radius: 999px; background: var(--dcl-paper); color: var(--dcl-ink); font-size: .8rem; font-weight: 650; }
.dcl-badge--source, .dcl-badge--registration { border-color: var(--dcl-emerald); color: var(--dcl-emerald); background: #f0faf5; }
.dcl-badge--sponsored, .dcl-badge--partner { border-color: #8a5a00; color: #6b4500; background: var(--dcl-warn-bg); }
.dcl-badge--demo { border-color: var(--dcl-danger); color: var(--dcl-danger); background: #fdf1f0; }
.dcl-sponsored { margin: 0 0 2rem; padding: var(--dcl-gap); border: 1px dashed #8a5a00; border-radius: var(--dcl-radius); background: #fffbf0; }
.dcl-sponsored h2 { margin-top: 0; font-size: 1.15rem; }

/* Alerts and notes */
.dcl-alert { margin: 0 0 1.25rem; padding: 1rem 1.25rem; border: 1px solid var(--dcl-line); border-left-width: 6px; border-radius: 8px; background: var(--dcl-surface); }
.dcl-alert > :first-child { margin-top: 0; } .dcl-alert > :last-child { margin-bottom: 0; }
.dcl-alert--info { border-left-color: var(--dcl-blue); background: var(--dcl-tint); }
.dcl-alert--warning { border-left-color: #8a5a00; background: var(--dcl-warn-bg); }
.dcl-alert--error { border-left-color: var(--dcl-danger); background: #fdf1f0; }
.dcl-note, .dcl-hint { color: var(--dcl-muted); font-size: .92rem; }
.dcl-hint { display: block; margin-top: .25rem; }
.dcl-empty { padding: var(--dcl-gap); border: 1px dashed var(--dcl-line); border-radius: var(--dcl-radius); background: var(--dcl-surface); }
.dcl-missing { background: var(--dcl-warn-bg); }
.dcl-section { margin-top: 2.5rem; }
.dcl-cta-panel { padding: clamp(1.25rem, 4vw, 2rem); border-radius: var(--dcl-radius); background: var(--dcl-navy); color: #fff; }
.dcl-cta-panel h2 { margin-top: 0; color: #fff; }
.dcl-cta-panel .dcl-link-button { color: #fff; }
.dcl-cta-panel .dcl-button:hover { background: #fff; border-color: #fff; color: var(--dcl-navy); }

/* Forms */
.dcl-field { margin: 0 0 1.1rem; }
.dcl-field > label, .dcl-choices__label { display: block; margin: 0 0 .35rem; font-weight: 650; color: var(--dcl-navy); }
.dcl-optional { font-weight: 400; color: var(--dcl-muted); }
.dcl-field input[type="text"], .dcl-field input[type="email"], .dcl-field input[type="tel"], .dcl-field input[type="search"], .dcl-field select { width: 100%; min-height: 48px; padding: .6rem .8rem; border: 1.5px solid #8b93a3; border-radius: 8px; background: #fff; color: var(--dcl-ink); font: inherit; font-size: 1rem; }
.dcl-field input[aria-invalid="true"], .dcl-field select[aria-invalid="true"] { border-color: var(--dcl-danger); border-width: 2px; }
.dcl-field--check label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; color: var(--dcl-ink); }
.dcl-field--check input, .dcl-compare-toggle input { width: 22px; height: 22px; margin: .15rem 0 0; flex: none; accent-color: var(--dcl-blue); }
.dcl-error { display: block; color: var(--dcl-danger); font-weight: 600; font-size: .95rem; }
.dcl-error:empty { display: none; }
.dcl-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
fieldset.dcl-step, .dcl-calculator fieldset { margin: 0 0 1.5rem; padding: 0; border: 0; min-width: 0; }
fieldset.dcl-step > legend, .dcl-calculator legend { padding: 0; margin: 0 0 1rem; font-size: 1.35rem; font-weight: 700; color: var(--dcl-navy); }
.dcl-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.dcl-choices__label, .dcl-choices > .dcl-hint, .dcl-choices > .dcl-error { grid-column: 1 / -1; margin: 0; }
.dcl-choice { display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: .6rem .9rem; border: 1.5px solid #8b93a3; border-radius: 10px; background: #fff; cursor: pointer; }
.dcl-choice input { width: 20px; height: 20px; accent-color: var(--dcl-blue); }
.dcl-choice:has(input:checked) { border-color: var(--dcl-blue); box-shadow: inset 0 0 0 1px var(--dcl-blue); background: var(--dcl-tint); }
.dcl-choice:has(input:focus-visible) { outline: 3px solid var(--dcl-blue); outline-offset: 3px; }

/* Application form */
.dcl-apply { max-width: 680px; }
.dcl-apply__form { padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--dcl-line); border-radius: 16px; background: var(--dcl-surface); }
.dcl-progress { margin-bottom: 1.5rem; }
.dcl-progress__label { margin: 0 0 .4rem; font-weight: 650; color: var(--dcl-muted); }
.dcl-progress__track { height: 8px; border-radius: 999px; background: var(--dcl-line); overflow: hidden; }
.dcl-progress__bar { height: 100%; width: 25%; border-radius: 999px; background: var(--dcl-emerald); transition: width .2s ease; }
.dcl-step__nav, .dcl-apply__submit { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; margin: 1.5rem 0 0; }
.dcl-step__nav > :only-child, .dcl-apply__submit > :only-child { margin-left: auto; }
.dcl-disclosure { margin-bottom: 1.25rem; padding: 1rem 1.25rem; border-radius: 10px; background: var(--dcl-paper); border: 1px solid var(--dcl-line); }

/* Directory */
.dcl-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 0 1rem; margin-bottom: 1.5rem; padding: var(--dcl-gap); border: 1px solid var(--dcl-line); border-radius: var(--dcl-radius); background: var(--dcl-surface); }
.dcl-field--wide, .dcl-filters__actions { grid-column: 1 / -1; }
.dcl-filters__actions { display: flex; gap: 1rem; align-items: center; margin: 0; }
.dcl-results-count { font-weight: 650; }
.dcl-compare-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 600; cursor: pointer; }
.dcl-pagination ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1.5rem 0; padding: 0; }
.dcl-pagination a, .dcl-pagination span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 1px solid var(--dcl-line); border-radius: 8px; background: var(--dcl-surface); }
.dcl-pagination [aria-current] { background: var(--dcl-navy); border-color: var(--dcl-navy); color: #fff; font-weight: 650; }

/* Comparison */
.dcl-table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--dcl-line); border-radius: var(--dcl-radius); background: var(--dcl-surface); }
.dcl-table-scroll table { width: 100%; border-collapse: collapse; margin: 0; }
.dcl-table-scroll th, .dcl-table-scroll td { padding: .75rem 1rem; border-bottom: 1px solid var(--dcl-line); text-align: left; vertical-align: top; }
.dcl-table-scroll thead th { background: var(--dcl-navy); color: #fff; }
.dcl-table-scroll thead th a, .dcl-table-scroll thead .dcl-link-button { color: #fff; }
.dcl-compare__table { min-width: 640px; }
.dcl-compare__table td, .dcl-compare__table thead th { min-width: 180px; }
.dcl-compare__table tbody th { position: sticky; left: 0; z-index: 1; width: 9.5rem; min-width: 9.5rem; background: var(--dcl-paper); color: var(--dcl-navy); border-right: 1px solid var(--dcl-line); }
.dcl-compare__table thead th:first-child { position: sticky; left: 0; z-index: 2; }
.dcl-sources { margin: 0; padding-left: 1.1rem; }
.dcl-compare-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: center; padding: .75rem 1rem; background: var(--dcl-navy); color: #fff; box-shadow: 0 -4px 16px rgba(11, 27, 58, .2); }
.dcl-compare-bar .dcl-link-button { color: #fff; }
.dcl-compare-bar .dcl-button:hover { background: #fff; border-color: #fff; color: var(--dcl-navy); }
body.dcl-has-compare-bar { padding-bottom: 5.5rem; }

/* Calculator */
.dcl-calculator { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .dcl-calculator { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.dcl-calculator__form, .dcl-calculator__results { padding: var(--dcl-gap); border: 1px solid var(--dcl-line); border-radius: 16px; background: var(--dcl-surface); }
.dcl-calculator__title { margin-top: 0; }
.dcl-calculator__payment { display: flex; flex-direction: column; margin: 0 0 1rem; padding: 1rem 1.25rem; border-radius: 12px; background: var(--dcl-navy); color: #fff; }
.dcl-calculator__payment strong { font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.dcl-schedule { margin: 1rem 0; } .dcl-schedule summary, .dcl-faq summary, .dcl-changelog summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; }
.dcl-schedule .dcl-table-scroll { max-height: 420px; overflow-y: auto; }
.dcl-schedule td, .dcl-schedule th { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* FAQs, breadcrumbs, editorial footer, branches, ads */
.dcl-faq { border-bottom: 1px solid var(--dcl-line); } .dcl-faq summary { padding: .5rem 0; color: var(--dcl-navy); font-size: 1.05rem; }
.dcl-faq__answer { padding: 0 0 1rem; }
.dcl-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; margin: 0 0 1rem; padding: 0; font-size: .9rem; color: var(--dcl-muted); }
.dcl-breadcrumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--dcl-line); }
.dcl-editorial { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--dcl-line); font-size: .95rem; }
.dcl-editorial h2 { font-size: 1.1rem; }
.dcl-branch { padding: 1rem; border: 1px solid var(--dcl-line); border-radius: 10px; background: var(--dcl-surface); }
.dcl-branch address { font-style: normal; margin: .25rem 0; }
.dcl-map { display: block; width: 100%; height: 300px; margin-top: .75rem; border: 0; border-radius: 10px; }
.dcl-ad { margin: 2rem auto; } .dcl-ad__label { display: block; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dcl-muted); }
.dcl-ad__box { width: 100%; border: 1px solid var(--dcl-line); background: var(--dcl-paper); overflow: hidden; }
.dcl-location-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: var(--dcl-gap); }
.dcl-location-index h2 { margin: 0 0 .5rem; font-size: 1.25rem; }

/* Sticky mobile CTA: small screens only, reserves its own space, low stacking order. */
.dcl-sticky-cta { display: none; }
@media (max-width: 640px) {
	.dcl-sticky-cta:not([hidden]) { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: .5rem; align-items: center; justify-content: center; padding: .6rem 3.25rem .6rem .75rem; background: var(--dcl-surface); border-top: 1px solid var(--dcl-line); }
	.dcl-sticky-cta .dcl-button { flex: 1; max-width: 22rem; }
	.dcl-sticky-cta__close { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--dcl-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
	body.dcl-has-sticky { padding-bottom: 4.5rem; }
	body.dcl-has-compare-bar .dcl-sticky-cta { display: none; }
	.dcl-card__facts > div, .dcl-facts > div { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.dcl-button, .dcl-progress__bar { transition: none; }
}

/* Hidden-attribute safety: component display rules must never override [hidden]. */
:where(.dcl-apply, .dcl-directory, .dcl-compare, .dcl-calculator, .dcl-compare-bar, .dcl-sticky-cta) [hidden] { display: none !important; }
/* Row headers in plugin tables must wrap, whatever the theme's prose table rules say. */
.dcl-table-scroll .dcl-compare__table tbody th, .dcl-table-scroll table tbody th { white-space: normal; }
