/* WDD Leads CRM — public styles shared by the intake form, booking page and chat.
   Override --wddl-accent in your theme to match the brand. */
.wddl-public {
	--wddl-accent: #1d4ed8;
	--wddl-accent-ink: #fff;
	--wddl-ink: #111827;
	--wddl-muted: #6b7280;
	--wddl-line: #d1d5db;
	--wddl-soft: #f3f4f6;
	--wddl-ok: #047857;
	--wddl-ok-bg: #ecfdf5;
	--wddl-err: #b91c1c;
	--wddl-err-bg: #fef2f2;
	--wddl-radius: 10px;
	color: var(--wddl-ink);
	box-sizing: border-box;
}
.wddl-public *, .wddl-public *::before, .wddl-public *::after { box-sizing: inherit; }

/* Buttons */
.wddl-public .wddl-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 0 20px; border: 0; border-radius: var(--wddl-radius);
	background: var(--wddl-accent); color: var(--wddl-accent-ink);
	font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.wddl-public .wddl-btn:hover { filter: brightness(1.08); }
.wddl-public .wddl-btn:disabled { opacity: .5; cursor: not-allowed; }
.wddl-public .wddl-btn--ghost { background: transparent; color: var(--wddl-accent); box-shadow: inset 0 0 0 1px var(--wddl-line); }
.wddl-public .wddl-btn--block { width: 100%; }

/* Fields */
.wddl-public label, .wddl-public legend { display: block; font-weight: 600; margin-bottom: 6px; }
.wddl-public input[type="text"], .wddl-public input[type="tel"], .wddl-public input[type="email"],
.wddl-public select, .wddl-public textarea {
	width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--wddl-line);
	border-radius: var(--wddl-radius); background: #fff; color: var(--wddl-ink); font: inherit;
}
.wddl-public textarea { min-height: 90px; }
.wddl-public input:focus-visible, .wddl-public select:focus-visible, .wddl-public textarea:focus-visible,
.wddl-public button:focus-visible, .wddl-public a:focus-visible { outline: 3px solid var(--wddl-accent); outline-offset: 2px; }

.wddl-notice { padding: 14px 16px; border-radius: var(--wddl-radius); margin: 0 0 16px; }
.wddl-notice p { margin: 0 0 10px; }
.wddl-notice p:last-child { margin: 0; }
.wddl-notice--ok { background: var(--wddl-ok-bg); color: var(--wddl-ok); }
.wddl-notice--error { background: var(--wddl-err-bg); color: var(--wddl-err); }
.wddl-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.wddl-muted { color: var(--wddl-muted); }

/* Intake form [wddl_form]
   Only fields and buttons; headings and text around it come from the page. Theme override: --wddl-accent (buttons). */
.wddl-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wddl-form-wrap { max-width: 560px; }
.wddl-form .wddl-field { margin: 0 0 16px; }
.wddl-form fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.wddl-radios label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin-right: 18px; }
.wddl-consent label { display: flex; gap: 8px; font-weight: 400; align-items: flex-start; font-size: .92em; line-height: 1.4; }
.wddl-consent input { margin-top: 3px; flex: none; }
.wddl-form .wddl-submit { width: 100%; }
.wddl-disclaimer { font-size: .8em; color: var(--wddl-muted); margin: 10px 0 0; line-height: 1.45; }

/* Labels inside the fields (steps / compact) */
.wddl-form--inside input[type="text"], .wddl-form--inside input[type="tel"], .wddl-form--inside input[type="email"],
.wddl-form--inside select { background: #f8fafc; }
.wddl-form--inside .wddl-field { margin-bottom: 12px; }
.wddl-form--inside select:has(option[value=""]:checked) { color: var(--wddl-muted); }
.wddl-form--inside select option { color: var(--wddl-ink); }
.wddl-form [aria-invalid="true"] { border-color: var(--wddl-err) !important; }

/* Steps */
.wddl-form.is-stepped [data-step][hidden] { display: none !important; }
.wddl-form-step__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .9em; margin: 0 0 10px; }
.wddl-form:not(.is-stepped) .wddl-step-nav, .wddl-form:not(.is-stepped) .wddl-form-step__top { display: none; }
.wddl-form .wddl-step-error, .wddl-form .wddl-final-error { margin: 0 0 12px; font-size: .92em; }

/* Yes / No answers as buttons */
.wddl-radios--pills legend { font-size: .95em; margin-bottom: 8px; padding: 0; }
.wddl-radios--pills { display: flex; flex-wrap: wrap; gap: 8px; }
.wddl-radios--pills legend { flex: 0 0 100%; }
.wddl-radios--pills label { position: relative; margin: 0; font-weight: 400; }
.wddl-radios--pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wddl-radios--pills span {
	display: inline-flex; align-items: center; min-height: 40px; padding: 6px 18px; border-radius: 999px;
	border: 1px solid var(--wddl-line); background: #fff; cursor: pointer; transition: background .15s, border-color .15s;
}
.wddl-radios--pills label:hover span { border-color: var(--wddl-accent); }
.wddl-radios--pills input:checked + span { background: var(--wddl-accent); border-color: var(--wddl-accent); color: var(--wddl-accent-ink); }
.wddl-radios--pills input:focus-visible + span { outline: 3px solid var(--wddl-accent); outline-offset: 2px; }

.wddl-more summary { cursor: pointer; color: var(--wddl-accent); font-size: .92em; margin-bottom: 8px; }
.wddl-more textarea { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .wddl-radios--pills span { transition: none; } }

/* Booking */
.wddl-booking { max-width: 640px; }
.wddl-step { border: 1px solid var(--wddl-line); border-radius: var(--wddl-radius); padding: 18px; margin: 0 0 14px; background: #fff; }
.wddl-step__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.wddl-step__title { font-weight: 700; font-size: 1.05em; margin: 0; }
.wddl-step__num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--wddl-accent); color: var(--wddl-accent-ink); align-items: center; justify-content: center; font-size: .85em; margin-right: 8px; }
.wddl-step--done { background: var(--wddl-soft); }
.wddl-step--done .wddl-step__num { background: var(--wddl-ok); }
.wddl-step__summary { color: var(--wddl-muted); }
.wddl-link { background: none; border: 0; color: var(--wddl-accent); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.wddl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wddl-chip {
	min-height: 44px; padding: 8px 14px; border-radius: var(--wddl-radius);
	border: 1px solid var(--wddl-line); background: #fff; color: var(--wddl-ink);
	font: inherit; cursor: pointer; text-align: left;
}
.wddl-chip:hover { border-color: var(--wddl-accent); }
.wddl-chip[aria-pressed="true"] { background: var(--wddl-accent); border-color: var(--wddl-accent); color: var(--wddl-accent-ink); }
.wddl-chip small { display: block; opacity: .75; font-size: .8em; }
.wddl-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.wddl-times .wddl-chip { text-align: center; }
.wddl-grid2 { display: grid; gap: 14px; }
.wddl-done { text-align: center; padding: 28px 18px; }
.wddl-done__icon { font-size: 40px; line-height: 1; }
.wddl-done__when { font-size: 1.15em; font-weight: 700; margin: 8px 0; }
.wddl-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Chat */
#wddl-chat { position: fixed; right: 16px; bottom: 16px; z-index: 99999; font-size: 15px; }
.wddl-chat__launcher {
	display: flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 12px 18px;
	background: var(--wddl-accent); color: var(--wddl-accent-ink); font: inherit; font-weight: 700;
	box-shadow: 0 10px 25px rgba(0,0,0,.18); cursor: pointer;
}
.wddl-chat__panel {
	width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 100px));
	display: flex; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden;
	box-shadow: 0 18px 50px rgba(0,0,0,.25);
}
.wddl-chat__head { background: var(--wddl-accent); color: var(--wddl-accent-ink); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wddl-chat__head strong { display: block; }
.wddl-chat__head small { opacity: .85; }
.wddl-chat__head button { background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.wddl-chat__lang { font-size: .8em; border: 1px solid rgba(255,255,255,.5) !important; }
.wddl-chat__body { flex: 1; overflow-y: auto; padding: 14px; background: var(--wddl-soft); display: flex; flex-direction: column; gap: 8px; }
.wddl-msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; line-height: 1.4; white-space: pre-line; }
.wddl-msg--bot { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.wddl-msg--me { background: var(--wddl-accent); color: var(--wddl-accent-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.wddl-chat__options { display: flex; flex-wrap: wrap; gap: 6px; }
.wddl-chat__options .wddl-chip { min-height: 38px; padding: 6px 12px; border-radius: 999px; }
.wddl-chat__input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--wddl-line); background: #fff; }
.wddl-chat__input input { min-height: 42px; }
.wddl-chat__input .wddl-btn { min-height: 42px; padding: 0 14px; }
@media (max-width: 480px) {
	#wddl-chat { right: 8px; bottom: 8px; }
	.wddl-chat__launcher { padding: 15px; font-size: 0; gap: 0; }
	.wddl-chat__launcher svg { width: 24px; height: 24px; }
	.wddl-chat__panel { width: calc(100vw - 16px); height: calc(100vh - 80px); }
}

.wddl-public [hidden], #wddl-chat [hidden] { display: none !important; }

/* Case calculator */
.wddl-calc { max-width: 620px; }
.wddl-calc__card { padding: 20px; margin: 0; }
.wddl-calc__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 22px; font-size: .9em; }
.wddl-calc__bar { height: 6px; background: var(--wddl-soft); border-radius: 99px; overflow: hidden; margin: 10px 0 16px; }
.wddl-calc__bar span { display: block; height: 100%; background: var(--wddl-accent); transition: width .25s ease; }
.wddl-calc__card .wddl-step__title { outline: none; margin-bottom: 12px; }
.wddl-calc__options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.wddl-calc__options .wddl-chip { text-align: left; padding: 12px 14px; width: 100%; }
.wddl-calc__range { font-size: 2em; font-weight: 800; color: var(--wddl-accent); margin: 4px 0 6px; line-height: 1.15; overflow-wrap: anywhere; }
.wddl-calc__att { margin: 0 0 10px; }
.wddl-calc .wddl-actions { margin-top: 14px; }
@media (max-width: 480px) {
	.wddl-calc__options { grid-template-columns: 1fr; }
	.wddl-calc__range { font-size: 1.6em; }
}
@media (prefers-reduced-motion: reduce) { .wddl-calc__bar span { transition: none; } }

/* AI chat extras */
.wddl-msg a { color: inherit; text-decoration: underline; }
.wddl-msg--typing { opacity: .7; font-style: italic; }
.wddl-chat__wa { background: #128c4b !important; }
