/* Clinic Dashboard — front-end forms & WhatsApp button.
   Uses the theme's colours when available (Diana Care), with safe fallbacks for any theme. */
.dd-form {
	--dd-c-text: var(--wp--preset--color--contrast, #1F2A2B);
	--dd-c-muted: var(--wp--preset--color--muted, #5B6B6C);
	--dd-c-line: rgba(126, 148, 150, .45);
	--dd-c-field: #fff;
	--dd-c-brand: var(--wp--preset--color--primary, #4E6E71);
	--dd-c-btn: var(--wp--preset--color--accent, #A8573A);
	color: var(--dd-c-text);
	width: 100%;
}
.dd-form--dark {
	--dd-c-text: #fff;
	--dd-c-muted: rgba(255, 255, 255, .75);
	--dd-c-line: rgba(255, 255, 255, .28);
	--dd-c-field: rgba(255, 255, 255, .08);
}
.dd-form p { margin: 0 0 .9rem; }
.dd-form label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.dd-form input[type=text], .dd-form input[type=email], .dd-form input[type=tel], .dd-form input[type=date], .dd-form select, .dd-form textarea {
	width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; color: var(--dd-c-text);
	background: var(--dd-c-field); border: 1.5px solid var(--dd-c-line); border-radius: 12px;
	padding: .8rem .95rem; min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
.dd-form textarea { min-height: 120px; resize: vertical; }
.dd-form input:focus, .dd-form select:focus, .dd-form textarea:focus { outline: none; border-color: var(--dd-c-brand); box-shadow: 0 0 0 3px rgba(78, 110, 113, .18); }
.dd-form--dark input:focus, .dd-form--dark textarea:focus, .dd-form--dark select:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); }
.dd-form--dark ::placeholder { color: rgba(255, 255, 255, .6); }
.dd-form [aria-invalid="true"] { border-color: #C0392B !important; }
.dd-form button[type=submit], .dd-form .wp-element-button {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem; cursor: pointer;
	background: var(--dd-c-btn); color: #fff; border: 0; border-radius: 999px; padding: .9rem 1.6rem; min-height: 48px;
	font: inherit; font-weight: 600; transition: transform .15s, filter .15s;
}
.dd-form button[type=submit]:hover { filter: brightness(.93); transform: translateY(-1px); }
.dd-form button[disabled] { opacity: .6; cursor: progress; }
.dd-form .dd-check label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .9rem; color: var(--dd-c-muted); }
.dd-form .dd-check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--dd-c-brand); flex: 0 0 auto; }
.dd-form .dd-fine { font-size: .8rem; color: var(--dd-c-muted); margin: .25rem 0 0; }
.dd-form .dd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.dd-form--compact .dd-grid { grid-template-columns: 1fr; }
.dd-form--compact .dd-field--phone { display: none; }
.dd-form--compact textarea { min-height: 80px; }
@media (max-width: 600px) { .dd-form .dd-grid { grid-template-columns: 1fr; } }
.dd-form fieldset { border: 0; padding: 0; margin: 0 0 .5rem; }
.dd-form legend { font-family: var(--wp--preset--font-family--heading, inherit); font-size: 1.15rem; font-weight: 600; margin-bottom: .6rem; color: var(--wp--preset--color--primary-dark, inherit); padding: 0; }

/* Newsletter inline layout */
.dd-form--inline .dd-row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.dd-form--inline .dd-row > p { margin: 0; }
.dd-form--inline .dd-field--first_name { flex: 1 1 160px; }
.dd-form--inline .dd-field--email { flex: 2 1 220px; }
.dd-form--inline .dd-submit { flex: 0 0 auto; }
@media (max-width: 600px) { .dd-form--inline .dd-submit, .dd-form--inline .dd-submit button { width: 100%; } }

/* Messages */
.dd-form__msg:empty { display: none; }
.dd-form__msg, .dd-form { scroll-margin-top: 130px; }
.dd-form input[type=checkbox][aria-invalid="true"] { outline: 2px solid #C0392B; outline-offset: 2px; }
.dd-form__msg p { padding: .85rem 1rem; border-radius: 12px; font-weight: 600; margin: 0 0 1rem; }
.dd-ok { background: #E4F3EC; color: #1E5E42; }
.dd-err { background: #FBE9E7; color: #8E1F16; }
.dd-form--dark .dd-ok { background: rgba(228, 243, 236, .15); color: #fff; }
.dd-form--dark .dd-err { background: rgba(251, 233, 231, .15); color: #fff; }
.dd-form.is-done .dd-grid, .dd-form.is-done .dd-row, .dd-form.is-done .dd-field, .dd-form.is-done fieldset, .dd-form.is-done .dd-check, .dd-form.is-done .dd-submit { display: none; }

/* Honeypot */
.dd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Referral share box */
.dd-share { margin-top: 1rem; padding: 1rem; border-radius: 14px; background: var(--wp--preset--color--sage-light, #E7EFEE); }
.dd-share__row { display: flex; gap: .5rem; flex-wrap: wrap; }
.dd-share__link { flex: 1 1 220px; }
.dd-share button, .dd-wa-share { border: 0; border-radius: 999px; padding: .7rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.dd-share button { background: var(--dd-c-brand); color: #fff; }
.dd-wa-share { background: #25D366; color: #fff !important; }

/* ---------------- WhatsApp floating button ---------------- */
.dd-wa { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 9990; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.dd-wa--right { right: 18px; }
.dd-wa--left { left: 18px; align-items: flex-start; }
.dd-wa__btn {
	display: inline-flex; align-items: center; gap: 10px; background: #25D366; color: #fff !important; text-decoration: none !important;
	border-radius: 999px; padding: 12px; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .45); transition: transform .2s, padding .2s;
	font: 600 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.dd-wa__btn:hover, .dd-wa__btn:focus-visible { transform: translateY(-2px); }
.dd-wa__btn:focus-visible { outline: 3px solid #128C7E; outline-offset: 3px; }
.dd-wa__label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s, margin .3s; }
.dd-wa__btn:hover .dd-wa__label, .dd-wa__btn:focus-visible .dd-wa__label { max-width: 200px; margin-right: 6px; }
.dd-wa__bubble {
	position: relative; max-width: 240px; background: #fff; color: #1F2A2B; padding: 12px 34px 12px 14px; border-radius: 14px 14px 4px 14px;
	box-shadow: 0 12px 28px -14px rgba(0, 0, 0, .4); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	animation: ddPop .35s ease both;
}
.dd-wa--left .dd-wa__bubble { border-radius: 14px 14px 14px 4px; }
.dd-wa__close { position: absolute; top: 4px; right: 6px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: #5B6B6C; line-height: 1; padding: 4px; }
@keyframes ddPop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@media (min-width: 782px) { .dd-wa--no-desktop { display: none; } }
@media (max-width: 781px) { .dd-wa--no-mobile { display: none; } .dd-wa__bubble { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .dd-wa__btn, .dd-wa__label { transition: none; } .dd-wa__bubble { animation: none; } }
@media print { .dd-wa { display: none; } }
