/* Adorian Booking — frontend widget.
   Theme-agnostic: every visible token is a CSS var so themes (or page CSS)
   can override without touching the plugin. */

/* Hide the page title on pages that use [adorian_booking hide_page_title="1"].
   Covers the most common WP theme selectors (entry-title, page-title, etc.).
   Scoped to .ab-hide-page-title so unrelated pages are never affected. */
body.ab-hide-page-title .entry-title,
body.ab-hide-page-title .entry-header,
body.ab-hide-page-title .page-title,
body.ab-hide-page-title .page-header,
body.ab-hide-page-title h1.post-title,
body.ab-hide-page-title .ast-archive-title,
body.ab-hide-page-title .ast-archive-description { display: none !important; }

.ab-booking {
	--ab-primary: #bc99ff;
	--ab-primary-soft: rgba(188, 153, 255, 0.16);
	--ab-accent: #e52ed4;
	--ab-text: #f4f1ea;
	--ab-text-muted: rgba(244, 241, 234, 0.6);
	--ab-bg: rgba(255, 255, 255, 0.03);
	--ab-border: rgba(244, 241, 234, 0.15);
	--ab-border-strong: rgba(244, 241, 234, 0.3);
	--ab-radius: 14px;
	--ab-radius-sm: 10px;
	--ab-gap: 14px;
	--ab-disabled-text: rgba(244, 241, 234, 0.25);
	--ab-error: #ff6b8a;
	--ab-success: #8be9a8;

	box-sizing: border-box;
	max-width: 640px;
	margin: 0 auto;
	padding: clamp(20px, 4vw, 32px);
	color: var(--ab-text);
	background: var(--ab-bg);
	border: 1px solid var(--ab-border);
	border-radius: var(--ab-radius);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
}

.ab-booking *, .ab-booking *::before, .ab-booking *::after { box-sizing: border-box; }

/* ── shared ───────────────────────────── */
.ab-h3 {
	margin: 0 0 16px;
	font-size: 1.1rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.ab-intro {
	margin: 0 0 20px;
	color: var(--ab-text-muted);
	font-size: 0.95rem;
}

.ab-step { animation: ab-fadein 0.18s ease both; }
.ab-step[hidden] { display: none; }

@keyframes ab-fadein {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: none; }
}

.ab-loading {
	text-align: center;
	color: var(--ab-text-muted);
	padding: 30px 0;
	font-size: 0.95rem;
}

.ab-helper {
	margin: 14px 0 0;
	color: var(--ab-text-muted);
	font-size: 0.85rem;
	text-align: center;
}

.ab-step-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin: 0 0 18px;
	flex-wrap: wrap;
}
.ab-step-title {
	font-size: 0.95rem;
	color: var(--ab-text);
	font-weight: 500;
}

.ab-back {
	background: none;
	border: none;
	color: var(--ab-primary);
	cursor: pointer;
	font: inherit;
	font-size: 0.9rem;
	padding: 4px 2px;
}
.ab-back:hover, .ab-back:focus-visible { text-decoration: underline; outline: none; }

/* ── call type selector ──────────────── */
.ab-calltype-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--ab-gap);
}
.ab-calltype-card {
	background: none;
	border: 1px solid var(--ab-border);
	border-radius: var(--ab-radius-sm);
	color: inherit;
	padding: 16px 18px;
	text-align: left;
	cursor: pointer;
	font: inherit;
	transition: border-color 0.15s, background 0.15s;
}
.ab-calltype-card:hover, .ab-calltype-card:focus-visible {
	border-color: var(--ab-primary);
	background: var(--ab-primary-soft);
	outline: none;
}
.ab-calltype-name { font-weight: 600; margin: 0 0 4px; }
.ab-calltype-meta {
	font-size: 0.85rem;
	color: var(--ab-text-muted);
	margin: 0 0 6px;
}
.ab-calltype-desc { font-size: 0.9rem; color: var(--ab-text-muted); margin: 0; }

/* ── calendar (month) ────────────────── */
.ab-calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 12px;
}
.ab-calendar-title {
	font-weight: 600;
	font-size: 1rem;
	text-transform: capitalize;
}
.ab-nav {
	background: none;
	color: var(--ab-text);
	border: 1px solid var(--ab-border);
	border-radius: 8px;
	width: 34px;
	height: 34px;
	cursor: pointer;
	font-size: 1.1rem;
	line-height: 1;
	font: inherit;
	font-weight: 600;
}
.ab-nav:hover:not([disabled]) { border-color: var(--ab-primary); color: var(--ab-primary); }
.ab-nav[disabled] { opacity: 0.3; cursor: not-allowed; }

.ab-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	margin: 0 0 6px;
	color: var(--ab-text-muted);
	font-size: 0.8rem;
	text-align: center;
}
.ab-days {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}
.ab-day {
	background: none;
	border: 1px solid transparent;
	color: var(--ab-text);
	border-radius: 8px;
	font: inherit;
	font-size: 0.95rem;
	height: 40px;
	cursor: pointer;
	transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.ab-day:hover:not([disabled]),
.ab-day:focus-visible {
	border-color: var(--ab-primary);
	outline: none;
}
.ab-day.is-available { background: var(--ab-primary-soft); border-color: transparent; font-weight: 600; }
.ab-day.is-available:hover { border-color: var(--ab-primary); }
.ab-day.is-today {
	box-shadow: inset 0 0 0 1px var(--ab-primary);
}
.ab-day.is-selected {
	background: var(--ab-primary);
	color: #1a0a3e;
	border-color: var(--ab-primary);
}
.ab-day[disabled] {
	color: var(--ab-disabled-text);
	cursor: not-allowed;
}
.ab-day.is-empty { visibility: hidden; }
.ab-day.is-holiday {
	text-decoration: line-through;
	color: var(--ab-disabled-text);
}

/* ── hours grid ──────────────────────── */
.ab-hours-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 10px;
}
.ab-hour {
	background: none;
	border: 1px solid var(--ab-border);
	color: var(--ab-text);
	border-radius: var(--ab-radius-sm);
	padding: 12px 6px;
	cursor: pointer;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 500;
	transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.ab-hour:hover, .ab-hour:focus-visible {
	border-color: var(--ab-primary);
	background: var(--ab-primary-soft);
	outline: none;
}
.ab-no-slots {
	color: var(--ab-text-muted);
	text-align: center;
	padding: 20px 0;
	font-size: 0.95rem;
	grid-column: 1 / -1;
}

/* ── form ────────────────────────────── */
.ab-form { display: grid; gap: 14px; width: 100%; }
.ab-field { display: grid; gap: 6px; width: 100%; }
.ab-label {
	font-size: 0.85rem;
	color: var(--ab-text-muted);
	letter-spacing: 0.02em;
}
.ab-field input,
.ab-field textarea {
	background: rgba(255, 255, 255, 0.04);
	color: var(--ab-text);
	border: 1px solid var(--ab-border);
	border-radius: 10px;
	padding: 12px 14px;
	font: inherit;
	font-size: 1rem;
	width: 100%;
	transition: border-color 0.12s, background 0.12s;
}
.ab-field input:focus,
.ab-field textarea:focus {
	border-color: var(--ab-primary);
	outline: none;
	background: rgba(255, 255, 255, 0.06);
}
.ab-field textarea { resize: vertical; min-height: 90px; }

.ab-hp {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.ab-submit {
	background: var(--ab-accent);
	color: #000;
	border: none;
	border-radius: 999px;
	padding: 14px 26px;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	margin-top: 4px;
	width: 100%;
	transition: filter 0.15s, transform 0.1s;
}
.ab-submit:hover { filter: brightness(1.08); }
.ab-submit:active { transform: translateY(1px); }
.ab-submit[disabled] { opacity: 0.6; cursor: not-allowed; }

.ab-form-feedback {
	margin: 0;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 0.9rem;
	background: rgba(255, 107, 138, 0.1);
	color: var(--ab-error);
	border: 1px solid rgba(255, 107, 138, 0.3);
}
.ab-form-feedback[data-tone="good"] {
	background: rgba(139, 233, 168, 0.1);
	color: var(--ab-success);
	border-color: rgba(139, 233, 168, 0.3);
}

/* ── confirmation ────────────────────── */
.ab-confirmation { text-align: center; padding: 16px 0; }
.ab-check {
	display: inline-flex;
	color: var(--ab-success);
	margin: 0 0 14px;
}
.ab-confirmation-msg {
	color: var(--ab-text-muted);
	margin: 0 0 20px;
	font-size: 1rem;
}
.ab-ics {
	display: inline-block;
	color: var(--ab-primary);
	text-decoration: none;
	border: 1px solid var(--ab-border);
	padding: 10px 18px;
	border-radius: 999px;
	font-size: 0.9rem;
	transition: border-color 0.12s, background 0.12s;
}
.ab-ics:hover { border-color: var(--ab-primary); background: var(--ab-primary-soft); }
