/*
 * AutoExam — base structural styles.
 * Layout, spacing and states only. Colors and typography come from the
 * custom properties below, which the theme is expected to override
 * (e.g. --autoexam-accent: var(--color-accent)). The theme can also disable
 * this file entirely via the `autoexam/enqueue_base_styles` filter.
 */
:root {
	--autoexam-gap: 1rem;
	--autoexam-radius: 4px;
	--autoexam-accent: #0088b0;
	--autoexam-accent-soft: #e9f8ff;
	--autoexam-surface: #f1f1f1;
	--autoexam-text: inherit;
	--autoexam-muted: #6b6b6b;
	--autoexam-error: #b3261e;
	--autoexam-border: rgba(0, 0, 0, 0.12);
}

.autoexam { display: block; box-sizing: border-box; margin-block: var(--autoexam-gap); color: var(--autoexam-text); }
.autoexam *, .autoexam *::before, .autoexam *::after { box-sizing: inherit; }
.autoexam-empty { margin: 0; color: var(--autoexam-muted); }
.autoexam-price-old { color: var(--autoexam-muted); margin-right: 0.35em; }

/* Upcoming day cards */
.autoexam-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: calc(var(--autoexam-gap) * 0.75); }
.autoexam-card { display: flex; flex-direction: column; gap: 0.5em; padding: var(--autoexam-gap); border-radius: var(--autoexam-radius); background: var(--autoexam-surface); border: 1px solid transparent; text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s; }
.autoexam-card:hover, .autoexam-card:focus-visible { border-color: var(--autoexam-accent); }
.autoexam-card__kicker { font-size: 0.75em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--autoexam-accent); }
.autoexam-card__title { font-size: 1.25em; font-weight: 600; line-height: 1.2; }
.autoexam-card__meta { display: flex; justify-content: space-between; gap: 0.75em; font-size: 0.875em; color: var(--autoexam-muted); }
.autoexam-card__price { color: var(--autoexam-text); font-weight: 600; }

/* Schedule list */
.autoexam-schedule { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.autoexam-schedule__item { display: grid; grid-template-columns: 1fr auto auto; gap: var(--autoexam-gap); padding: 0.6em 0; border-bottom: 1px solid var(--autoexam-border); }
.autoexam-schedule__item--full { opacity: 0.55; }
.autoexam-schedule__time { color: var(--autoexam-muted); }
.autoexam-schedule__price { font-weight: 600; text-align: right; }

/* Booking widget */
.autoexam-booking { scroll-margin-top: 80px; }
.autoexam-form { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: calc(var(--autoexam-gap) * 2.5); align-items: start; }
.autoexam-booking__form { display: grid; gap: var(--autoexam-gap); position: sticky; top: 20px; }
@media (max-width: 900px) {
	.autoexam-form { grid-template-columns: minmax(0, 1fr); }
	.autoexam-booking__form { position: static; }
}

/* Day grid */
.autoexam-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: calc(var(--autoexam-gap) * 0.6); }
.autoexam-day { display: flex; flex-direction: column; position: relative; padding: 0.75em 0.9em; border-radius: var(--autoexam-radius); background: var(--autoexam-surface); border: 1px solid transparent; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.autoexam-day__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.autoexam-day:hover { border-color: var(--autoexam-accent); }
.autoexam-day.is-selected, .autoexam-day:has(.autoexam-day__input:checked) { background: var(--autoexam-accent-soft); border-color: var(--autoexam-accent); box-shadow: inset 0 0 0 1px var(--autoexam-accent); }
.autoexam-day:has(.autoexam-day__input:focus-visible) { outline: 2px solid var(--autoexam-accent); outline-offset: 2px; }
.autoexam-day[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
.autoexam-day[aria-disabled="true"]:hover { border-color: transparent; }
.autoexam-day__weekday { display: block; font-size: 0.7em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--autoexam-muted); }
.autoexam-day__date { display: block; margin-top: 0.2em; font-size: 1.35em; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.autoexam-day__month { font-size: 0.7em; font-weight: 400; }
.autoexam-day__price { display: block; margin-top: 0.5em; font-size: 0.85em; }

/* Form */
.autoexam-chosen { display: flex; justify-content: space-between; gap: 0.75em; align-items: baseline; padding-top: 0.75em; border-top: 2px solid currentColor; }
.autoexam-chosen__label { font-size: 0.8em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--autoexam-muted); }
.autoexam-field { display: grid; gap: 0.35em; margin: 0; padding: 0; border: 0; min-width: 0; }
.autoexam-field__label { font-size: 0.9em; }
.autoexam-fields--2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--autoexam-gap); }
.autoexam-input { width: 100%; padding: 0.6em 0.75em; border: 1px solid var(--autoexam-border); border-radius: var(--autoexam-radius); background: var(--autoexam-surface); font: inherit; color: inherit; }
.autoexam-input:focus-visible { outline: 2px solid var(--autoexam-accent); outline-offset: 2px; }
.has-error .autoexam-input { border-color: var(--autoexam-error); }
.autoexam-error { margin: 0; font-size: 0.85em; color: var(--autoexam-error); }
.autoexam-error[hidden] { display: none; }
.autoexam-segments { display: flex; flex-wrap: wrap; gap: 0.4em; }
.autoexam-segment { position: relative; }
.autoexam-segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.autoexam-segment span { display: inline-block; padding: 0.45em 0.9em; border-radius: var(--autoexam-radius); background: var(--autoexam-surface); border: 1px solid transparent; cursor: pointer; }
.autoexam-segment input:checked + span { background: var(--autoexam-accent-soft); border-color: var(--autoexam-accent); }
.autoexam-segment input:focus-visible + span { outline: 2px solid var(--autoexam-accent); outline-offset: 2px; }
.autoexam-checkbox { display: flex; gap: 0.6em; align-items: flex-start; cursor: pointer; font-size: 0.95em; line-height: 1.5; }
.autoexam-checkbox input { margin: 0.3em 0 0; accent-color: var(--autoexam-accent); }
.autoexam-button { display: inline-flex; justify-content: center; align-items: center; gap: 0.35em; min-height: 44px; padding: 0.6em 1.4em; border: 1px solid transparent; border-radius: var(--autoexam-radius); font: inherit; font-weight: 600; cursor: pointer; }
.autoexam-button--primary { background: var(--autoexam-accent); color: #fff; }
.autoexam-button--block { width: 100%; }
.autoexam-button[disabled] { opacity: 0.6; cursor: wait; }
.autoexam-button:focus-visible { outline: 2px solid var(--autoexam-accent); outline-offset: 2px; }
.autoexam-note { margin: 0; font-size: 0.8em; line-height: 1.5; color: var(--autoexam-muted); }
.autoexam-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.autoexam-success__title { margin: 0 0 0.4em; }
.autoexam-success__text > :first-child { margin-top: 0; }
.autoexam-success__text > :last-child { margin-bottom: 0; }

/* Day labels */
.autoexam-tag { display: block; width: 100%; box-sizing: border-box; padding: 0.35em 0.4em; border-radius: var(--autoexam-radius); font-size: 10px; line-height: 1.4; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; text-align: center; font-weight: 600; background: var(--autoexam-tag-bg, var(--autoexam-surface)); color: var(--autoexam-tag-color, inherit); }
.autoexam-tag--cyan { --autoexam-tag-bg: var(--autoexam-accent-soft); --autoexam-tag-color: var(--autoexam-accent); }
.autoexam-tag--magenta { --autoexam-tag-bg: #ffdee6; --autoexam-tag-color: #aa0b56; }
.autoexam-tag--yellow { --autoexam-tag-bg: #fff3c4; --autoexam-tag-color: #7a5a00; }
.autoexam-tag--green { --autoexam-tag-bg: #d9f0e0; --autoexam-tag-color: #0f5f34; }
.autoexam-tag--ink { --autoexam-tag-bg: #2d2b2b; --autoexam-tag-color: #f3f2f2; }
.autoexam-day__tags { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 0.6em; }
.autoexam-day__tags:empty { display: none; }
.autoexam-tag--full { --autoexam-tag-bg: #d1242f; --autoexam-tag-color: #fff; }
.autoexam-schedule .autoexam-tag { display: inline-block; width: auto; margin-left: 0.5em; vertical-align: middle; }
[hidden] { display: none !important; }

/* A labelled day is tinted with the label colour; the tag turns solid on top of it. */
.autoexam-day.has-label.autoexam-day--label-cyan, .autoexam-card--label-cyan { background: #e9f8ff; }
.autoexam-day.has-label.autoexam-day--label-magenta, .autoexam-card--label-magenta { background: #ffe9ef; }
.autoexam-day.has-label.autoexam-day--label-yellow, .autoexam-card--label-yellow { background: #fff6d6; }
.autoexam-day.has-label.autoexam-day--label-green, .autoexam-card--label-green { background: #e3f3e8; }
.autoexam-day.has-label.autoexam-day--label-ink, .autoexam-card--label-ink { background: #e5e5e5; }
.autoexam-day.has-label.autoexam-day--label-cyan .autoexam-tag, .autoexam-card--label-cyan .autoexam-tag { --autoexam-tag-bg: #0088b0; --autoexam-tag-color: #fff; }
.autoexam-day.has-label.autoexam-day--label-magenta .autoexam-tag, .autoexam-card--label-magenta .autoexam-tag { --autoexam-tag-bg: #d6006c; --autoexam-tag-color: #fff; }
.autoexam-day.has-label.autoexam-day--label-yellow .autoexam-tag, .autoexam-card--label-yellow .autoexam-tag { --autoexam-tag-bg: #e6b400; --autoexam-tag-color: #2b2100; }
.autoexam-day.has-label.autoexam-day--label-green .autoexam-tag, .autoexam-card--label-green .autoexam-tag { --autoexam-tag-bg: #1f7a45; --autoexam-tag-color: #fff; }
.autoexam-day.has-label.autoexam-day--label-ink .autoexam-tag, .autoexam-card--label-ink .autoexam-tag { --autoexam-tag-bg: #2d2b2b; --autoexam-tag-color: #f3f2f2; }
/* Full days are tinted like labelled days (wins over a label tint). */
.autoexam-day.autoexam-day--full[aria-disabled="true"] { background: #fde8ea; }
