/* Event Tickets Manager — public styles (purchase form + [etm_events])
 * Inherits the theme's font. Brand colour comes from --etm-accent (Settings → Brand colour).
 */

.etm-purchase,
.etm-events-list {
	--etm-accent: #0f5f4f;
	--etm-accent-hover: #0c4e41;
	--etm-accent-press: #0a4337;
	--etm-ink: #1c2024;
	--etm-muted: #5b636b;
	--etm-line: #e3e6e9;
	--etm-wash: #f6f7f8;
	--etm-surface: #ffffff;
	--etm-danger: #b42318;
	--etm-tint: color-mix(in srgb, var(--etm-accent) 7%, #fff);
	--etm-radius: 14px;
	color: var(--etm-ink);
	font-family: inherit;
	line-height: 1.5;
}

.etm-purchase *,
.etm-purchase *::before,
.etm-purchase *::after { box-sizing: border-box; }

.etm-purchase { margin: 2.5rem 0; container-type: inline-size; }

.etm-icon { flex: none; vertical-align: middle; }
.etm-num { font-variant-numeric: tabular-nums; }

/* ---------- Card ---------- */

.etm-card {
	background: var(--etm-surface);
	border: 1px solid var(--etm-line);
	border-radius: var(--etm-radius);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
	overflow: hidden;
}

/* ---------- Header ---------- */

.etm-head {
	display: flex;
	gap: 18px;
	align-items: center;
	padding: 24px 28px;
	border-bottom: 1px solid var(--etm-line);
}

.etm-date {
	flex: none;
	width: 60px;
	border: 1.5px solid var(--etm-accent);
	border-radius: 10px;
	text-align: center;
	overflow: hidden;
	line-height: 1;
}
.etm-date__month {
	display: block;
	padding: 5px 0 4px;
	background: var(--etm-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .02em;
}
.etm-date__day {
	display: block;
	padding: 8px 0 9px;
	font-size: 24px;
	font-weight: 700;
	color: var(--etm-ink);
}

.etm-purchase .etm-head__title {
	margin: 0 0 6px;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--etm-ink);
}

.etm-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: var(--etm-muted);
}
.etm-facts li { display: flex; gap: 6px; align-items: center; margin: 0; }
.etm-facts .etm-icon { color: var(--etm-accent); }

/* ---------- Notices ---------- */

.etm-notice {
	display: flex;
	gap: 12px;
	margin: 20px 28px 0;
	padding: 14px 16px;
	border-radius: 10px;
	border: 1px solid;
	font-size: 14px;
}
.etm-notice .etm-icon { width: 22px; height: 22px; margin-top: 1px; }
.etm-notice strong { display: block; font-size: 15px; margin-bottom: 2px; }
.etm-notice p { margin: 0; }
.etm-notice + .etm-form,
.etm-notice + .etm-closed { margin-top: 20px; border-top: 1px solid var(--etm-line); }
.etm-notice--success { background: #ecfdf3; border-color: #abefc6; color: #085d3a; }
.etm-notice--info    { background: #eff4ff; border-color: #c7d7fe; color: #1d3a8a; }
.etm-notice--warning { background: #fffaeb; border-color: #fedf89; color: #7a4504; }
.etm-notice--error   { background: #fef3f2; border-color: #fecdca; color: #912018; }

.etm-closed {
	display: flex;
	gap: 12px;
	align-items: center;
	margin: 24px 28px 28px;
	padding: 18px 20px;
	background: var(--etm-wash);
	border-radius: 10px;
	color: var(--etm-muted);
	font-size: 15px;
}
.etm-closed p { margin: 0; color: var(--etm-ink); font-weight: 500; }

/* ---------- Form layout ---------- */

.etm-form { display: grid; grid-template-columns: 1fr; }
.etm-main { padding: 8px 28px 28px; }

@container (min-width: 700px) {
	.etm-form { grid-template-columns: minmax(0, 1fr) 300px; }
	.etm-stub { border-left: 1px dashed var(--etm-line); }
}

.etm-group { margin: 20px 0 0; padding: 0; border: 0; min-width: 0; }
.etm-purchase .etm-group__title {
	float: left; /* lets legend sit inside the fieldset flow */
	width: 100%;
	margin: 0 0 12px;
	padding: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--etm-ink);
}
.etm-group__title + * { clear: both; }

#etm_tickets_err:not(:empty) { display: block; margin-top: 8px; }
.etm-hint { margin: 8px 0 0; font-size: 13px; color: var(--etm-muted); }

/* Ticket tier rows */
.etm-tiers { display: grid; gap: 10px; }
.etm-tier.is-picked { border-color: var(--etm-accent); box-shadow: inset 3px 0 0 var(--etm-accent); }
.etm-tier.is-soldout { opacity: .55; }
.etm-tier__meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--etm-muted); }
.etm-tier__days { display: inline-flex; align-items: center; gap: 5px; }
.etm-tier__days .etm-icon { width: 14px; height: 14px; color: var(--etm-accent); }
.etm-tier__price { font-weight: 600; color: var(--etm-ink) !important; }

/* Combo suggestion */
.etm-combo {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: 10px;
	background: var(--etm-tint);
	border: 1px solid color-mix(in srgb, var(--etm-accent) 25%, #fff);
	font-size: 14px;
}
.etm-combo[hidden] { display: none; }
.etm-combo__text { margin: 0; flex: 1 1 260px; color: var(--etm-ink); }
#etm-purchase-form .etm-combo__btn,
#etm-purchase-form .etm-combo__btn:hover,
#etm-purchase-form .etm-combo__btn:focus,
#etm-purchase-form .etm-combo__btn:active {
	margin: 0;
	padding: 8px 14px;
	border: 1.5px solid var(--etm-accent);
	border-radius: 8px;
	background: #fff;
	color: var(--etm-accent);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: none;
	text-decoration: none;
}
#etm-purchase-form .etm-combo__btn:hover { background: var(--etm-accent); color: #fff; }

.etm-tier {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 16px;
	border: 1px solid var(--etm-line);
	border-radius: 10px;
}
.etm-tier__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.etm-tier__name { font-weight: 600; font-size: 15px; }
.etm-tier__price { font-size: 14px; color: var(--etm-muted); font-variant-numeric: tabular-nums; }
.etm-tier__left { font-size: 12.5px; font-weight: 600; color: #b54708; }

/* Quantity stepper */
.etm-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--etm-line);
	border-radius: 999px;
	padding: 3px;
	flex: none;
}
.etm-purchase .etm-stepper__btn {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--etm-wash);
	color: var(--etm-ink);
	cursor: pointer;
	transition: background-color .15s;
}
#etm-purchase-form .etm-stepper__btn,
#etm-purchase-form .etm-stepper__btn:focus,
#etm-purchase-form .etm-stepper__btn:active { background: var(--etm-wash); color: var(--etm-ink); border: 0; box-shadow: none; }
#etm-purchase-form .etm-stepper__btn:hover:not(:disabled) { background: var(--etm-tint); color: var(--etm-accent); }
#etm-purchase-form .etm-stepper__btn:disabled { background: var(--etm-wash); color: var(--etm-ink); opacity: .35; cursor: not-allowed; }
.etm-purchase .etm-stepper__input {
	width: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: center;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	color: var(--etm-ink);
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
	appearance: textfield;
	box-shadow: none;
}
.etm-stepper__input::-webkit-outer-spin-button,
.etm-stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Fields */
.etm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
@container (max-width: 460px) { .etm-grid { grid-template-columns: 1fr; } }

.etm-field { display: flex; flex-direction: column; min-width: 0; }
.etm-purchase .etm-field label {
	margin: 0 0 6px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--etm-ink);
}
.etm-optional { font-weight: 400; color: var(--etm-muted); margin-left: 4px; }
.etm-purchase .etm-field input {
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 13px;
	border: 1px solid #cfd4d9;
	border-radius: 8px;
	background: #fff;
	color: var(--etm-ink);
	font: inherit;
	font-size: 15px;
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
}
.etm-purchase .etm-field input::placeholder { color: #9aa1a8; }
.etm-purchase .etm-field input:focus {
	outline: none;
	border-color: var(--etm-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--etm-accent) 20%, transparent);
}
.etm-purchase .etm-field input[aria-invalid="true"] { border-color: var(--etm-danger); }
.etm-purchase .etm-field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }
.etm-field__hint { margin-top: 5px; font-size: 12.5px; color: var(--etm-muted); }
.etm-field__error { margin-top: 5px; font-size: 12.5px; font-weight: 500; color: var(--etm-danger); }
.etm-field__error:empty { display: none; }
.etm-field__error:not(:empty) ~ .etm-field__hint,
.etm-field__hint:has(+ .etm-field__error:not(:empty)) { display: none; }

/* ---------- Ticket stub (order summary) ---------- */

.etm-stub {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--etm-tint);
	border-top: 1px dashed color-mix(in srgb, var(--etm-accent) 30%, #fff);
}
.etm-stub__top { padding: 24px 24px 18px; }
.etm-stub__event {
	margin: 0 0 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--etm-accent);
	line-height: 1.35;
}
.etm-stub__lines { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.etm-stub__lines li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	font-size: 14px;
	color: var(--etm-muted);
}
.etm-stub__lines .etm-stub__empty { font-style: italic; }

/* Perforation with punched notches */
.etm-stub__bottom {
	position: relative;
	padding: 18px 24px 24px;
	border-top: 2px dashed color-mix(in srgb, var(--etm-accent) 28%, #fff);
}
.etm-stub__bottom::before,
.etm-stub__bottom::after {
	content: "";
	position: absolute;
	top: -10px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--etm-surface);
}
.etm-stub__bottom::before { left: -10px; }
.etm-stub__bottom::after { right: -10px; }

.etm-stub__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 16px;
	font-size: 15px;
	font-weight: 600;
}
.etm-stub__total strong { font-size: 26px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }

.etm-purchase .etm-pay {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 12px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--etm-accent);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: filter .15s, transform .05s;
}
/*
 * Some themes (e.g. Hello Elementor) colour every button:hover / :focus pink.
 * These ID-scoped rules keep the plugin's buttons in the brand colour in every state.
 */
#etm-purchase-form .etm-pay,
#etm-purchase-form .etm-pay:focus { background: var(--etm-accent); color: #fff; border: 0; box-shadow: none; text-decoration: none; }
#etm-purchase-form .etm-pay:hover:not(:disabled) { background: var(--etm-accent-hover); color: #fff; }
#etm-purchase-form .etm-pay:active:not(:disabled) { background: var(--etm-accent-press); color: #fff; transform: translateY(1px); }
#etm-purchase-form .etm-pay:disabled { background: var(--etm-accent); color: #fff; cursor: progress; opacity: .85; }
#etm-purchase-form .etm-pay:focus-visible { outline: 2px solid var(--etm-accent); outline-offset: 2px; }
.etm-pay[aria-busy="true"] .etm-icon { display: none; }
.etm-pay[aria-busy="true"]::before {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: etm-spin .7s linear infinite;
}
@keyframes etm-spin { to { transform: rotate(360deg); } }

.etm-purchase :focus-visible { outline: 2px solid var(--etm-accent); outline-offset: 2px; }
.etm-purchase .etm-field input:focus-visible { outline: none; }

.etm-form-error {
	margin-top: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fef3f2;
	color: #912018;
	font-size: 13.5px;
}

.etm-secure {
	display: flex;
	gap: 8px;
	margin: 14px 0 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--etm-muted);
}
.etm-secure .etm-icon { width: 16px; height: 16px; color: var(--etm-accent); margin-top: 1px; }

/* ---------- Free registration done ---------- */

.etm-done {
	padding: 40px 28px 44px;
	text-align: center;
}
.etm-done:focus { outline: none; }
.etm-done .etm-icon { width: 48px; height: 48px; color: var(--etm-accent); }
.etm-purchase .etm-done h3 { margin: 12px 0 6px; font-size: 20px; color: var(--etm-ink); }
.etm-done__text { margin: 0 auto; max-width: 40ch; color: var(--etm-muted); }

.etm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Narrow screens ---------- */

@container (max-width: 520px) {
	.etm-head { padding: 20px; gap: 14px; align-items: flex-start; }
	.etm-main { padding: 4px 20px 24px; }
	.etm-notice { margin: 16px 20px 0; }
	.etm-closed { margin: 20px; }
	.etm-stub__top { padding: 20px 20px 16px; }
	.etm-stub__bottom { padding: 16px 20px 20px; }
	.etm-date { width: 52px; }
	.etm-date__day { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
	.etm-purchase * { transition: none !important; animation-duration: .01ms !important; }
}

/* ---------- [etm_events] list ---------- */

.etm-events-list { display: grid; gap: 14px; }
.etm-event-card {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px;
	padding: 20px 22px;
	background: var(--etm-surface);
	border: 1px solid var(--etm-line);
	border-radius: var(--etm-radius);
}
.etm-events-list .etm-event-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--etm-ink);
	text-decoration: none;
}
.etm-events-list .etm-event-title:hover { color: var(--etm-accent); }
.etm-event-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: 14px; color: var(--etm-muted); }
.etm-event-meta .etm-icon { color: var(--etm-accent); }
.etm-event-buy { display: flex; align-items: center; gap: 16px; }
.etm-event-price { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.etm-events-list .etm-button {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 9px;
	background: var(--etm-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.etm-events-list a.etm-button:hover, .etm-events-list a.etm-button:focus { background: var(--etm-accent-hover); color: #fff; }
