/*
 * BCW Booking Portal – Kundenoberfläche. Mobile First, WCAG 2.2 AA.
 *
 * Alle Regeln sind unter #bcw-portal gekapselt (ID-Spezifität schlägt Theme-Klassenregeln wie
 * ".entry-content ul" oder "button" bei Divi). Es werden keine globalen Selektoren verändert.
 * Fokusindikatoren bleiben sichtbar; nur die programmatisch fokussierte, nicht interaktive
 * Hauptüberschrift (data-bcw-focus) zeigt keinen Rahmen.
 */
#bcw-portal.bcw-portal {
	--bcw-green: #009037;        /* Markenfarbe: Akzente, Linien */
	--bcw-green-dark: #00722c;   /* Text/Buttons: Kontrast 6,1:1 auf Weiß (#009037 erreicht nur 4,2:1) */
	--bcw-grey: #ebebeb;         /* Markenfarbe: Flächen, Trennlinien */
	--bcw-text: #1d2327;
	--bcw-muted: #50575e;
	--bcw-border: #767676;       /* >= 3:1 für Bedienelemente */
	--bcw-error: #b32d2e;
	--bcw-radius: 12px;
	box-sizing: border-box;
	display: block;
	max-width: 760px;
	margin: 0 auto;
	padding: 24px 16px 64px;
	color: var(--bcw-text);
	background: none;
	border: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.55;
	text-align: left;
	-webkit-text-size-adjust: 100%;
}
#bcw-portal *, #bcw-portal *::before, #bcw-portal *::after { box-sizing: border-box; }

/* ---- Theme-Reset innerhalb des Portals ---- */
#bcw-portal ul, #bcw-portal li { list-style: none !important; margin: 0; padding: 0; background: none; }
#bcw-portal li::marker { content: none; }
#bcw-portal li::before, #bcw-portal li::after { content: none !important; }
#bcw-portal h1, #bcw-portal h2, #bcw-portal h3, #bcw-portal h4, #bcw-portal h5, #bcw-portal h6 {
	margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
	color: inherit; font-family: inherit; font-style: normal; font-variant: normal;
	letter-spacing: normal; text-transform: none; text-shadow: none; text-align: left;
}
#bcw-portal p { margin: 0; padding: 0; }
#bcw-portal button, #bcw-portal select, #bcw-portal input, #bcw-portal textarea {
	font-family: inherit; text-transform: none; letter-spacing: normal; text-shadow: none; margin: 0;
}
#bcw-portal button { -webkit-appearance: none; appearance: none; }

/* ---- Kopf ---- */
#bcw-portal .bcw-head { margin-bottom: 16px; }
#bcw-portal .bcw-eyebrow { margin: 0 0 8px; font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--bcw-green-dark); }
#bcw-portal .bcw-title { font-size: 1.5rem; line-height: 1.2; font-weight: 700; }
#bcw-portal .bcw-lead { margin: 8px 0 0; color: var(--bcw-muted); }

/* ---- Monate und Tageskarten ---- */
#bcw-portal .bcw-month { margin-top: 20px; }
#bcw-portal .bcw-month__title { margin: 0 0 10px; padding-bottom: 6px; font-size: 1rem; line-height: 1.3; font-weight: 700; border-bottom: 3px solid var(--bcw-green); }
#bcw-portal .bcw-days { display: grid; gap: 10px; }
#bcw-portal .bcw-day {
	padding: 10px 12px 12px; background: #fff; border: 1px solid var(--bcw-grey); border-left: 5px solid var(--bcw-green);
	border-radius: var(--bcw-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
#bcw-portal .bcw-day__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 1.0625rem; line-height: 1.25; font-weight: 700; }
#bcw-portal .bcw-day__weekday { color: var(--bcw-green-dark); }
#bcw-portal .bcw-group { margin-top: 8px; }
#bcw-portal .bcw-group + .bcw-group { padding-top: 8px; border-top: 1px solid var(--bcw-grey); }
#bcw-portal .bcw-group__title { margin: 0 0 6px; font-size: .875rem; font-weight: 600; color: var(--bcw-muted); }
#bcw-portal .bcw-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }

/* Startzeit-Schaltfläche */
#bcw-portal .bcw-time {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
	width: 100%; min-height: 48px; min-width: 44px; padding: 4px 8px;
	font-size: 1rem; line-height: 1.25; color: var(--bcw-text); text-align: center; cursor: pointer;
	background: #fff; border: 2px solid var(--bcw-border); border-radius: 10px; box-shadow: none;
	transition: background-color .12s ease, border-color .12s ease;
}
#bcw-portal .bcw-time__start { font-size: 1rem; font-weight: 700; }
#bcw-portal .bcw-time__end { font-size: .75rem; color: var(--bcw-muted); }
#bcw-portal .bcw-time:hover { border-color: var(--bcw-green-dark); background: #f6faf7; }
#bcw-portal .bcw-time[aria-pressed="true"], #bcw-portal .bcw-time--selected {
	color: #fff; background: var(--bcw-green-dark); border-color: var(--bcw-green-dark);
}
#bcw-portal .bcw-time[aria-pressed="true"] .bcw-time__end, #bcw-portal .bcw-time--selected .bcw-time__end { color: #fff; }

/* ---- Buttons ---- */
#bcw-portal .bcw-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; min-width: 44px; padding: 12px 24px;
	font-size: 1rem; font-weight: 700; line-height: 1.25; color: #fff; cursor: pointer; text-decoration: none;
	background: var(--bcw-green-dark); border: 2px solid var(--bcw-green-dark); border-radius: var(--bcw-radius); box-shadow: none;
}
#bcw-portal .bcw-btn:hover { background: #005c24; border-color: #005c24; color: #fff; }
#bcw-portal .bcw-btn--secondary { color: var(--bcw-green-dark); background: #fff; }
#bcw-portal .bcw-btn--secondary:hover { background: var(--bcw-grey); color: #005c24; }
#bcw-portal .bcw-btn[disabled] { opacity: .65; cursor: progress; }
#bcw-portal .bcw-more { display: flex; margin: 28px auto 0; }

/* ---- Fokus: überall sichtbar, außer auf der nur programmatisch fokussierten Überschrift ---- */
#bcw-portal a:focus-visible, #bcw-portal button:focus-visible, #bcw-portal input:focus-visible,
#bcw-portal select:focus-visible, #bcw-portal textarea:focus-visible, #bcw-portal [tabindex]:focus-visible {
	outline: 3px solid #1d2327; outline-offset: 2px; box-shadow: 0 0 0 5px #fff;
}
#bcw-portal .bcw-title[data-bcw-focus]:focus, #bcw-portal .bcw-title[data-bcw-focus]:focus-visible { outline: none; box-shadow: none; }

/* ---- Formular ---- */
#bcw-portal .bcw-summary { margin: 0 0 24px; padding: 16px; background: var(--bcw-grey); border-left: 5px solid var(--bcw-green); border-radius: var(--bcw-radius); }
#bcw-portal .bcw-summary__event { font-weight: 700; }
#bcw-portal .bcw-field { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
#bcw-portal .bcw-field label, #bcw-portal .bcw-fieldset legend { display: block; margin: 0 0 6px; padding: 0; font-weight: 600; color: var(--bcw-text); }
#bcw-portal .bcw-req { color: var(--bcw-error); }
#bcw-portal .bcw-input {
	display: block; width: 100%; min-height: 48px; padding: 10px 12px; max-width: none;
	font-size: 1rem; line-height: 1.4; color: var(--bcw-text); background: #fff;
	border: 2px solid var(--bcw-border); border-radius: 8px; box-shadow: none;
}
#bcw-portal textarea.bcw-input { min-height: 120px; }
#bcw-portal .bcw-input[readonly], #bcw-portal .bcw-input[aria-disabled="true"] { background: var(--bcw-grey); color: var(--bcw-muted); }
#bcw-portal .bcw-input[aria-invalid="true"] { border-color: var(--bcw-error); }
#bcw-portal .bcw-field--check { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px; min-height: 44px; }
#bcw-portal .bcw-field--check label { margin: 0; padding-top: 10px; font-weight: 400; }
#bcw-portal .bcw-check { flex: 0 0 24px; width: 24px; height: 24px; margin: 10px 0 0; accent-color: var(--bcw-green-dark); }
#bcw-portal .bcw-hint { margin: 6px 0 0; font-size: .875rem; color: var(--bcw-muted); }
#bcw-portal .bcw-error { margin: 6px 0 0; font-size: .9375rem; font-weight: 600; color: var(--bcw-error); }
#bcw-portal .bcw-actions { display: flex; flex-direction: column-reverse; gap: 12px; margin-top: 28px; }
#bcw-portal .bcw-note { margin-top: 16px; font-size: .875rem; color: var(--bcw-muted); }
#bcw-portal .bcw-filter { margin-bottom: 8px; max-width: 420px; }
#bcw-portal .bcw-filter label { display: block; margin-bottom: 6px; font-weight: 600; }

/* ---- Daten zum Schulungsort ---- */
#bcw-portal [hidden] { display: none !important; }
#bcw-portal .bcw-section, #bcw-portal .bcw-location { margin: 0 0 18px; padding: 14px 14px 2px; background: #fff; border: 1px solid var(--bcw-grey); border-left: 5px solid var(--bcw-green); border-radius: var(--bcw-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
#bcw-portal .bcw-section legend, #bcw-portal .bcw-location legend { float: left; width: 100%; margin: 0 0 8px; padding: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
#bcw-portal .bcw-section legend + *, #bcw-portal .bcw-location legend + * { clear: both; }
#bcw-portal .bcw-location > .bcw-hint { margin: 0 0 16px; }
#bcw-portal .bcw-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
#bcw-portal .bcw-loc-select { margin-bottom: 14px; }

/* ---- Meldungen ---- */
#bcw-portal .bcw-alert { padding: 14px 16px; margin: 0 0 20px; border-radius: var(--bcw-radius); border: 2px solid; }
#bcw-portal .bcw-alert--error { color: #6d1b1c; background: #fcf0f0; border-color: var(--bcw-error); }
#bcw-portal .bcw-alert p { margin: 0 0 6px; font-weight: 600; }
#bcw-portal .bcw-alert ul { margin: 0; padding-left: 20px; }
#bcw-portal .bcw-alert li { list-style: disc !important; }
#bcw-portal .bcw-alert a { color: inherit; text-decoration: underline; display: inline-block; min-height: 24px; }
#bcw-portal .bcw-empty { padding: 32px 16px; text-align: center; background: var(--bcw-grey); border-radius: var(--bcw-radius); }
#bcw-portal .bcw-empty > :first-child { margin: 0 0 8px; font-size: 1.125rem; font-weight: 700; text-align: center; }
#bcw-portal .bcw-empty p { color: var(--bcw-muted); }

/* ---- Ladezustand ---- */
#bcw-portal .bcw-list { display: grid; gap: 12px; }
#bcw-portal .bcw-skeleton { height: 72px; margin-bottom: 12px; border-radius: var(--bcw-radius); background: linear-gradient(90deg, var(--bcw-grey) 25%, #f6f6f6 50%, var(--bcw-grey) 75%); background-size: 200% 100%; animation: bcw-shimmer 1.4s infinite linear; }
@keyframes bcw-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- Bestätigung ---- */
#bcw-portal .bcw-success-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 0 0 16px; font-size: 2rem; color: #fff; background: var(--bcw-green-dark); border-radius: 50%; }
#bcw-portal .bcw-details { margin: 0 0 8px; padding: 8px 16px; background: var(--bcw-grey); border-radius: var(--bcw-radius); }
#bcw-portal .bcw-details dt { margin: 12px 0 0; padding: 0; font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--bcw-muted); }
#bcw-portal .bcw-details dd { margin: 2px 0 12px; padding: 0; font-size: 1.0625rem; font-weight: 600; }
#bcw-portal .bcw-portal__noscript { padding: 16px; background: var(--bcw-grey); border-radius: var(--bcw-radius); }

/* Nur für Screenreader (liegt außerhalb des Portals, daher ohne Präfix mit eindeutigem Namen) */
.bcw-sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Doppelten Seitentitel auf der Portalseite ausblenden (nur dort, per body-Klasse) */
body.bcw-portal-page article.page > .entry-title,
body.bcw-portal-page article.type-page > .entry-title,
body.bcw-portal-page article.page .et_post_meta_wrapper > h1.entry-title,
body.bcw-portal-page article.type-page .et_post_meta_wrapper > h1.entry-title,
body.bcw-portal-page .et_pb_title_container { display: none; }

@media (min-width: 480px) {
	#bcw-portal .bcw-grid { grid-template-columns: repeat(12, 1fr); }
	#bcw-portal .bcw-grid > .bcw-field { grid-column: span 12; }
	#bcw-portal .bcw-grid > .bcw-w-half { grid-column: span 6; }
	#bcw-portal .bcw-grid > .bcw-w-wide { grid-column: span 8; }
	#bcw-portal .bcw-grid > .bcw-w-narrow { grid-column: span 4; }
	#bcw-portal .bcw-grid > .bcw-w60 { grid-column: span 8; }
	#bcw-portal .bcw-grid > .bcw-w30 { grid-column: span 4; }
	#bcw-portal .bcw-grid > .bcw-w50 { grid-column: span 6; }
}
@media (min-width: 640px) {
	#bcw-portal.bcw-portal { padding-top: 48px; }
	#bcw-portal .bcw-day { padding: 10px 16px 12px; }
	#bcw-portal .bcw-title { font-size: 1.75rem; }
	#bcw-portal .bcw-actions { flex-direction: row; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
	#bcw-portal .bcw-skeleton { animation: none; }
	#bcw-portal .bcw-time { transition: none; }
}
@media (forced-colors: active) {
	#bcw-portal .bcw-time, #bcw-portal .bcw-input, #bcw-portal .bcw-btn { border: 2px solid ButtonText; }
	#bcw-portal .bcw-time[aria-pressed="true"] { outline: 3px solid Highlight; }
}

/* ---- Erfolgsbanner (persönliche Übersicht) ---- */
#bcw-portal .bcw-banner { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 20px; padding: 16px; color: #0b3d1c; background: #eaf6ee; border: 2px solid var(--bcw-green-dark); border-left-width: 8px; border-radius: var(--bcw-radius); }
#bcw-portal .bcw-banner__icon { flex: 0 0 40px; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-size: 1.5rem; font-weight: 700; color: #fff; background: var(--bcw-green-dark); border-radius: 50%; }
#bcw-portal .bcw-banner__body { min-width: 0; }
#bcw-portal .bcw-banner__title { margin: 0 0 4px; font-size: 1.375rem; line-height: 1.25; font-weight: 700; color: #0b3d1c; }
#bcw-portal .bcw-banner__text { font-size: 1.0625rem; font-weight: 600; }
#bcw-portal .bcw-banner__meta { margin-top: 2px; font-size: .9375rem; }
#bcw-portal .bcw-alert--info { color: var(--bcw-text); background: var(--bcw-grey); border-color: var(--bcw-border); }
#bcw-portal .bcw-section > .bcw-grid { margin-top: 0; }
