/* RXD DRK Form Wizard — Public Form Styles */

.rxd-fw-form-wrap {
	max-width: 640px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

/* ── Progress indicator ──────────────────────────────────────── */
.rxd-fw-progress {
	display: flex;
	justify-content: space-between;
	position: relative;
	margin-bottom: 2.5rem;
}
.rxd-fw-progress::before {
	content: '';
	position: absolute;
	top: 20px;
	left: 5%;
	right: 5%;
	height: 2px;
	background: #e2e8f0;
	z-index: 0;
}
.rxd-fw-progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	z-index: 1;
	flex: 1;
}
.rxd-step-number {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--rxd-fw-step-next-color, #e2e8f0);
	color: var(--rxd-fw-step-next-text, var(--rxd-fw-step-caption-color, #718096));
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
	transition: background .2s, color .2s;
}
.rxd-step-label {
	font-size: var(--rxd-fw-step-caption-size, 13px);
	font-weight: var(--rxd-fw-step-caption-weight, 400);
	color: var(--rxd-fw-step-next-text, var(--rxd-fw-step-caption-color, #718096));
	text-align: center;
	max-width: 110px;
	overflow-wrap: normal;
	word-break: normal;
}
.rxd-fw-progress-step.rxd-active .rxd-step-number { background: var(--rxd-fw-step-active-bg, var(--rxd-fw-step-active-color, #2b6cb0)); color: var(--rxd-fw-step-active-text, #fff); }
.rxd-fw-progress-step.rxd-active .rxd-step-label  { color: var(--rxd-fw-step-active-bg, var(--rxd-fw-step-active-color, #2b6cb0)); }
.rxd-fw-progress-step.rxd-done   .rxd-step-number { background: var(--rxd-fw-step-done-bg, #1a4a7a); color: var(--rxd-fw-step-done-text, #fff); }
.rxd-fw-progress-step.rxd-done   .rxd-step-label  { color: var(--rxd-fw-step-done-bg, #1a4a7a); }
.rxd-fw-progress-step.rxd-done   { cursor: pointer; }
.rxd-fw-progress-step.rxd-done:hover .rxd-step-number { background: color-mix(in srgb, var(--rxd-fw-step-done-bg, #1a4a7a) 80%, #fff); }
.rxd-fw-progress-step.rxd-done:hover .rxd-step-label  { color: color-mix(in srgb, var(--rxd-fw-step-done-bg, #1a4a7a) 80%, #fff); }

/* ── Step fieldsets ──────────────────────────────────────────── */
.rxd-fw-form fieldset {
	border: none;
	padding: 0;
	margin: 0;
}
.rxd-fw-form legend {
	font-size: var(--rxd-fw-title-size, 1.15rem);
	font-family: var(--rxd-fw-title-font, inherit);
	font-weight: 700;
	color: var(--rxd-fw-title-color, #1a202c);
	margin-bottom: 1.5rem;
	padding-bottom: .6rem;
	border-bottom: 2px solid #e2e8f0;
	width: 100%;
	display: block;
}

/* ── Fields ───────────────────────────────────────────────────── */
.rxd-fw-field { margin-bottom: 1.1rem; }

.rxd-fw-field label {
	display: block;
	font-size: var(--rxd-fw-label-size, 14px);
	font-family: var(--rxd-fw-label-font, inherit);
	font-weight: 600;
	color: var(--rxd-fw-label-color, #2d3748);
	margin-bottom: 5px;
}
.rxd-required { color: #e53e3e; margin-left: 2px; }

.rxd-fw-field input[type="text"],
.rxd-fw-field input[type="email"],
.rxd-fw-field input[type="tel"],
.rxd-fw-field input[type="date"],
.rxd-fw-field input[type="number"],
.rxd-fw-field select,
.rxd-fw-field textarea {
	width: 100%;
	padding: .6rem .75rem;
	border: 1.5px solid #cbd5e0;
	border-radius: 6px;
	font-size: var(--rxd-fw-field-size, 15px);
	color: var(--rxd-fw-field-color, #2d3748);
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
	box-sizing: border-box;
	font-family: var(--rxd-fw-field-font, inherit);
}
.rxd-fw-field input:focus,
.rxd-fw-field select:focus,
.rxd-fw-field textarea:focus {
	outline: none;
	border-color: #4299e1;
	border-color: var(--rxd-fw-step-active-color, #4299e1);
	box-shadow: 0 0 0 3px rgba(66,153,225,.18);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rxd-fw-step-active-color, #4299e1) 18%, transparent);
}
.rxd-fw-field input.rxd-invalid,
.rxd-fw-field select.rxd-invalid,
.rxd-fw-field textarea.rxd-invalid {
	border-color: #e53e3e;
	box-shadow: 0 0 0 2px rgba(229,62,62,.15);
}
.rxd-fw-field textarea { resize: vertical; min-height: 100px; }
.rxd-fw-field select   { appearance: auto; height: auto; padding: .75rem .75rem; line-height: 1.5; }

.rxd-field-error {
	display: block;
	font-size: 12px;
	color: #c53030;
	margin-top: 4px;
}

/* ── Input with static prefix (e.g. "D-" for case number) ────── */
.rxd-fw-input-prefix {
	display: flex;
	align-items: stretch;
	border: 1.5px solid #cbd5e0;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.rxd-fw-prefix-text {
	padding: .6rem .65rem;
	font-size: 15px;
	font-weight: 700;
	color: #4a5568;
	background: #f7fafc;
	border-right: 1.5px solid #cbd5e0;
	display: flex;
	align-items: center;
	user-select: none;
	flex-shrink: 0;
}
.rxd-fw-input-prefix input {
	flex: 1;
	min-width: 0;
	border: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	outline: none !important;
}
.rxd-fw-input-prefix:focus-within {
	border-color: #4299e1;
	border-color: var(--rxd-fw-step-active-color, #4299e1);
	box-shadow: 0 0 0 3px rgba(66,153,225,.18);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rxd-fw-step-active-color, #4299e1) 18%, transparent);
}
.rxd-fw-input-prefix:has(input.rxd-invalid) {
	border-color: #e53e3e;
	box-shadow: 0 0 0 2px rgba(229,62,62,.15);
}

/* ── Two-column field row ─────────────────────────────────────── */
.rxd-fw-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}
@media ( max-width: 480px ) { .rxd-fw-row { grid-template-columns: 1fr; } }

/* ── Checkbox ─────────────────────────────────────────────────── */
.rxd-fw-checkbox-label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 14px;
	color: #4a5568;
	cursor: pointer;
	line-height: 1.5;
}
.rxd-fw-checkbox-label input[type="checkbox"] {
	width: auto;
	margin-top: 3px;
	flex-shrink: 0;
}

/* ── Radio group ──────────────────────────────────────────────── */
.rxd-fw-radio-group { display: flex; flex-direction: column; gap: 8px; }
.rxd-fw-radio-option {
	display: flex;
	gap: 10px;
	align-items: center;
	font-size: 14px;
	color: #2d3748;
	cursor: pointer;
}
.rxd-fw-radio-option input[type="radio"] { width: auto; flex-shrink: 0; }

/* ── Navigation buttons ───────────────────────────────────────── */
.rxd-fw-nav {
	display: flex;
	margin-top: 1.75rem;
}
.rxd-fw-nav--split { justify-content: space-between; }
.rxd-fw-top-nav {
	margin-bottom: 1.25rem;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.rxd-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: .6rem 1.5rem;
	border-radius: 6px;
	font-size: var(--rxd-fw-btn-size, 15px);
	font-family: var(--rxd-fw-btn-font, inherit);
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: background .15s, opacity .15s, filter .15s;
}
.rxd-btn--next,
.rxd-btn--submit { background: var(--rxd-fw-btn-primary-bg, #2b6cb0); color: var(--rxd-fw-btn-primary-color, #fff); }
.rxd-btn--next:hover,
.rxd-btn--submit:hover { filter: brightness(0.9); }
.rxd-btn--prev { background: var(--rxd-fw-btn-secondary-bg, #edf2f7); color: var(--rxd-fw-btn-secondary-color, #4a5568); }
.rxd-btn--prev:hover { filter: brightness(0.95); }
.rxd-btn:disabled,
.rxd-btn.rxd-loading { opacity: .6; cursor: not-allowed; pointer-events: none; }

/* ── Messages ─────────────────────────────────────────────────── */
.rxd-fw-messages {
	border-radius: 6px;
	padding: 1rem 1.25rem;
	margin-top: 1.5rem;
	font-size: 15px;
	display: none;
	text-align: center;
}
.rxd-fw-messages.rxd-success {
	display: block;
	background: #f0fff4;
	border: 1px solid #9ae6b4;
	color: #276749;
}
.rxd-fw-messages.rxd-error {
	display: block;
	background: #fff5f5;
	border: 1px solid #fed7d7;
	color: #c53030;
}

/* ── Success panel ────────────────────────────────────────────── */
.rxd-fw-success-panel { text-align: center; }
.rxd-fw-success-tick {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #38a169;
	color: #fff;
	font-size: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 1rem;
}
.rxd-fw-success-panel h3 {
	font-size: 1.2rem;
	font-weight: 700;
	color: #22543d;
	margin: 0 0 .4rem;
}
.rxd-fw-success-intro {
	font-size: 15px;
	font-weight: 600;
	color: #276749;
	margin: 0 0 1rem;
}
.rxd-fw-success-body {
	text-align: left;
	background: #fff;
	border: 1px solid #c6f6d5;
	border-radius: 6px;
	padding: 1rem 1.1rem;
	margin-top: .5rem;
}
.rxd-fw-success-body p {
	font-size: 14px;
	color: #2d3748;
	line-height: 1.65;
	margin: 0 0 .85rem;
	text-align: justify;
}
.rxd-fw-success-body p:last-child { margin: 0; }
.rxd-fw-success-urgent,
.rxd-fw-success-body p.rxd-fw-success-urgent {
	background: #fff5f5;
	border: 1px solid #fed7d7;
	border-radius: 4px;
	padding: .65rem .9rem;
	color: #c53030 !important;
	text-align: center !important;
	font-size: 16px;
}
.rxd-fw-success-urgent a {
	color: #c53030;
	text-decoration: none;
}
.rxd-fw-success-urgent a:hover { text-decoration: underline; }

/* ── Review panel ─────────────────────────────────────────────── */
.rxd-fw-review { margin-bottom: 1.5rem; }
.rxd-fw-review table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rxd-fw-review tr    { border-bottom: 1px solid #e2e8f0; }
.rxd-fw-review th    { padding: 8px 12px; width: 38%; background: #f7fafc; text-align: left; font-weight: 600; color: #4a5568; }
.rxd-fw-review td    { padding: 8px 12px; color: #2d3748; }

/* ── Centered legend variant ──────────────────────────────────── */
.rxd-fw-form .rxd-legend--center {
	text-align: center;
}

/* ── Conditional sections ─────────────────────────────────────── */
.rxd-fw-hidden { display: none !important; }
.rxd-fw-conditional { margin-top: .25rem; }

/* ── FAQ link ─────────────────────────────────────────────────── */
.rxd-fw-faq-link {
	margin: .5rem 0 .75rem;
	font-size: 14px;
}
.rxd-fw-faq-link a {
	color: var(--rxd-fw-step-active-color, #2b6cb0);
	text-decoration: underline;
}
.rxd-fw-faq-link a:hover { filter: brightness(0.8); }

/* ── Character counter hint ───────────────────────────────────── */
.rxd-fw-char-hint {
	display: block;
	text-align: right;
	font-size: 12px;
	color: #a0aec0;
	margin-top: 4px;
}
.rxd-fw-char-hint.rxd-char-warn { color: #c05621; }

/* ── Sub-section label (e.g. "Select preferred pickup location") */
.rxd-fw-sublabel {
	font-size: 15px;
	font-weight: 700;
	color: #1a202c;
	margin: .75rem 0 .5rem;
}

/* ── Block radio options (location picker cards) ─────────────── */
.rxd-radio-label--block {
	display: block;
	padding: .6rem .75rem;
	margin-bottom: 8px;
	border: 1.5px solid #e2e8f0;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 400;
	color: #2d3748;
	cursor: pointer;
	line-height: 1.55;
	transition: border-color .15s, background .15s;
}
/* Restore weight/spacing overridden by .rxd-fw-field label (specificity 0,1,1) */
.rxd-fw-field .rxd-radio-label--block {
	font-weight: 400;
	margin-bottom: 8px;
}
.rxd-radio-label--block:hover {
	border-color: color-mix(in srgb, var(--rxd-fw-step-active-color, #2b6cb0) 45%, white);
	background: #f7fbff;
}
.rxd-radio-label--block:has(input:checked) {
	border-color: var(--rxd-fw-step-active-color, #2b6cb0);
	background: color-mix(in srgb, var(--rxd-fw-step-active-color, #2b6cb0) 5%, white);
}
.rxd-fw-field--locations { margin-top: .25rem; }

/* ── Location header: radio + city name on one line ─────────── */
.rxd-location-header {
	display: flex;
	align-items: center;
	gap: 10px;
}
.rxd-location-header input[type="radio"] {
	flex-shrink: 0;
	accent-color: var(--rxd-fw-step-active-color, #2b6cb0);
	width: 16px;
	height: 16px;
	cursor: pointer;
	margin: 0;
}
.rxd-location-name {
	font-size: 14px;
	font-weight: 700;
	color: #1a202c;
	line-height: 1.4;
}

/* ── Location details: addr / hours / closed, indented ────────── */
.rxd-location-details {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-left: 26px; /* 16px radio + 10px gap */
	margin-top: 4px;
}
.rxd-location-addr {
	display: none;
	font-size: 13px;
	color: #4a5568;
	line-height: 1.5;
}
.rxd-radio-label--block:has(input:checked) .rxd-location-addr {
	display: block;
}
.rxd-location-hours {
	font-size: 12px;
	color: #4a5568;
	line-height: 1.5;
}
.rxd-location-closed {
	font-size: 12px;
	color: #c05621;
	font-weight: 500;
}

/* ── Location info link (map / contact) ──────────────────────── */
.rxd-fw-location-info {
	display: none;
	font-size: 13px;
	color: #4a5568;
	margin: .5rem 0 .25rem;
}
.rxd-fw-conditional:has(.rxd-fw-field--locations input[type="radio"]:checked) .rxd-fw-location-info {
	display: block;
}
.rxd-fw-location-info a {
	color: var(--rxd-fw-step-active-color, #2b6cb0);
	text-decoration: underline;
}
.rxd-fw-location-info a:hover { filter: brightness(0.8); }

/* ── Instructions: hide detail fields when "repeat last rx" checked ── */
.rxd-fw-step:has(#mr_repeat_rx:checked) .rxd-fw-instructions-details {
	display: none;
}

/* ── Delivery "Ship" message ──────────────────────────────────── */
.rxd-fw-delivery-msg {
	font-size: 14px;
	color: var(--rxd-fw-step-active-color, #2b6cb0);
	margin: .5rem 0 .75rem;
}

/* ── Coming-soon placeholder ─────────────────────────────────── */
.rxd-fw-coming-soon {
	font-size: 14px;
	color: #a0aec0;
	font-style: italic;
	padding: .75rem 0;
}

/* ── Inline radio group (Gender etc.) ─────────────────────────── */
.rxd-fw-radio-inline {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 24px;
	margin-top: 4px;
}
.rxd-radio-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 15px;
	font-weight: 400;
	color: #2d3748;
	cursor: pointer;
}
.rxd-radio-label input[type="radio"] {
	width: auto;
	margin: 0;
	accent-color: var(--rxd-fw-step-active-color, #2b6cb0);
	cursor: pointer;
}

/* ── intl-tel-input overrides ─────────────────────────────────── */
.rxd-fw-field .iti {
	width: 100%;
	display: block;
}
.rxd-fw-field .iti input[type="tel"] {
	width: 100%;
	padding-left: 52px; /* room for the flag button */
}
.rxd-fw-field .iti input[type="tel"]:focus {
	outline: none;
	border-color: #4299e1;
	border-color: var(--rxd-fw-step-active-color, #4299e1);
	box-shadow: 0 0 0 3px rgba(66,153,225,.18);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rxd-fw-step-active-color, #4299e1) 18%, transparent);
}
.rxd-fw-field .iti input[type="tel"].rxd-invalid {
	border-color: #e53e3e;
	box-shadow: 0 0 0 2px rgba(229,62,62,.15);
}
.rxd-fw-field .iti__flag-container { z-index: 2; }

/* ── Turnstile wrapper ─────────────────────────────────────────── */
.rxd-fw-turnstile { margin: 1rem 0; }

/* ── Patient type selection cards (Step 1 of Appointment) ────── */
.rxd-fw-type-cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: .25rem 0 .5rem;
}
.rxd-btn--type-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	width: 100%;
	padding: 1.1rem 1.25rem;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	text-align: left;
	transition: border-color .15s, background .15s;
	font-family: inherit;
}
.rxd-btn--type-card:hover:not(.rxd-active) {
	border-color: #90cdf4;
	border-color: color-mix(in srgb, var(--rxd-fw-step-active-color, #2b6cb0) 45%, white);
	background: #f0f8ff;
	background: color-mix(in srgb, var(--rxd-fw-step-active-color, #2b6cb0) 6%, white);
}
.rxd-btn--type-card.rxd-active {
	border-color: var(--rxd-fw-step-active-color, #2b6cb0);
	background: #ebf8ff;
	background: color-mix(in srgb, var(--rxd-fw-step-active-color, #2b6cb0) 10%, white);
}
.rxd-type-card-title {
	font-size: 15px;
	font-weight: 700;
	color: #2d3748;
	line-height: 1.4;
}
.rxd-btn--type-card.rxd-active .rxd-type-card-title {
	color: var(--rxd-fw-step-active-color, #2b6cb0);
}
.rxd-type-card-sub {
	font-size: 13px;
	font-weight: 400;
	color: #718096;
	line-height: 1.4;
}


/* ── Info / charge note ──────────────────────────────────────── */
.rxd-fw-info-note {
	font-size: 13px;
	color: #744210;
	background: #fffbeb;
	border: 1px solid #f6e05e;
	border-radius: 4px;
	padding: .5rem .75rem;
	margin: .5rem 0 .75rem;
}

/* ── Section title (e.g. "ENTER SHIPPING ADDRESS") ───────────── */
.rxd-fw-section-title {
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--rxd-fw-label-color, #2b6cb0);
	font-family: var(--rxd-fw-label-font, inherit);
	text-transform: uppercase;
	letter-spacing: .5px;
	margin: 1.25rem 0 .75rem;
}

/* ── Field description note ──────────────────────────────────── */
.rxd-fw-field-note {
	font-size: 13px;
	color: #718096;
	margin-top: 8px;
	line-height: 1.55;
}

/* ── Doctor availability note (e.g. "first Tuesday of month") ── */
.rxd-fw-avail-note {
	font-size: 12px;
	color: #718096;
	margin-left: 4px;
	font-weight: 400;
}

/* ── Patient section heading (mirrors fieldset legend) ────────── */
.rxd-fw-step-legend {
	font-size: var(--rxd-fw-title-size, 1.15rem);
	font-family: var(--rxd-fw-title-font, inherit);
	font-weight: 700;
	color: var(--rxd-fw-title-color, #1a202c);
	margin-bottom: 1.5rem;
	padding-bottom: .6rem;
	border-bottom: 2px solid #e2e8f0;
	width: 100%;
	display: block;
}

/* ── Date of birth 3-part field (DD / MM / YYYY) ─────────────── */
.rxd-fw-dob-parts {
	display: flex;
	align-items: center;
	gap: .375rem;
}
.rxd-fw-dob-day,
.rxd-fw-dob-month {
	width: 3.5rem !important;
	text-align: center;
	padding-left: .25rem !important;
	padding-right: .25rem !important;
}
.rxd-fw-dob-year {
	width: 5.25rem !important;
	text-align: center;
	padding-left: .25rem !important;
	padding-right: .25rem !important;
}
.rxd-fw-dob-sep {
	color: #a0aec0;
	font-size: 1.1em;
	line-height: 1;
	user-select: none;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media ( max-width: 520px ) {
	.rxd-step-label { display: none; }
}
