:root {
    --color-bg: #eef1f4;
    --color-surface: #ffffff;
    --color-surface-muted: #f2f4f7;
    --color-text: #1a2233;
    --color-muted: #64748b;
    --color-border: #e3e7ed;
    --color-primary: #c10b2d;
    --color-primary-dark: #8c0821;
    --color-primary-light: #fbe7ea;
    --color-danger: #c2410c;
    --color-danger-light: #fef3eb;
    --color-success: #0f6d4c;
    --color-success-light: #e5f3ec;
    --color-warning: #a66a00;
    --color-warning-light: #fdf1da;
    /* Offizielle Plattform-Markenfarben fuer die Share-Icons (footer.php) - bewusst fest und
       nicht pro Theme abgestuft, da es die jeweils erkennbare Markenfarbe der Plattform ist. */
    --whatsapp-green: #25d366;
    --telegram-blue: #229ed9;
    --facebook-blue: #1877f2;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.10);
    color-scheme: light;
}

/*
 * Dark-Theme wird ausschliesslich ueber das data-theme-Attribut auf <html> aktiviert
 * (per Umschalter in Header/Sidebar, siehe .theme-toggle). Light bleibt so unabhaengig
 * von der Betriebssystem-Einstellung immer das Standard-Theme.
 */
:root[data-theme="dark"] {
    --color-bg: #0f1720;
    --color-surface: #1a232e;
    --color-surface-muted: #232e3b;
    --color-text: #e6e9ef;
    --color-muted: #94a3b8;
    --color-border: #2c3a4a;
    --color-primary: #e8546c;
    --color-primary-dark: #d93b57;
    --color-primary-light: #33121a;
    --color-danger: #e8722a;
    --color-danger-light: #3a2410;
    --color-success: #2bb583;
    --color-success-light: #163526;
    --color-warning: #f0a93a;
    --color-warning-light: #3a2c11;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 clamp(1.1rem, 4vw, 1.5rem);
}

.site-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 1.35rem 0;
    box-shadow: var(--shadow-md);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.site-nav a:focus-visible,
.site-header .site-title:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Theme-Umschalter (Light/Dark) --------------------------------------------- */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
}

.theme-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.theme-toggle-icon-dark {
    display: none;
}

:root[data-theme="dark"] .theme-toggle-icon-light {
    display: none;
}

:root[data-theme="dark"] .theme-toggle-icon-dark {
    display: block;
}

/* Theme-Umschalter in der Admin-Sidebar (dunkler Farbverlauf als Hintergrund) */

.admin-sidebar .theme-toggle {
    align-self: flex-start;
}

.site-header .site-title {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.site-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 6px;
    padding: 3px 5px;
    box-shadow: var(--shadow-sm);
    line-height: 0;
}

.site-logo {
    height: 28px;
    width: auto;
    display: block;
}

.site-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    padding: 2.5rem 0 2rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
    margin-top: 2rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.footer-share {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.footer-share-label {
    font-weight: 600;
}

.footer-share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-surface-muted);
    color: var(--color-muted);
    transition: background 0.15s ease, color 0.15s ease;
}

.footer-share-link:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.footer-links a {
    color: var(--color-muted);
    text-decoration: underline;
}

main.container {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.05rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
    text-wrap: balance;
}

h2 {
    font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-wrap: balance;
}

h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    line-height: 1.35;
}

p {
    text-wrap: pretty;
}

a {
    color: var(--color-primary);
    text-underline-offset: 0.15em;
    text-decoration-thickness: from-font;
}

:where(a):hover {
    color: var(--color-primary-dark);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.course-list {
    display: grid;
    gap: 1.1rem;
}

.course-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .course-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
    }
}

.course-card.course-cancelled {
    border-left-color: var(--color-danger);
    opacity: 0.85;
}

.course-card.course-closed {
    border-left-color: var(--color-muted);
}

.course-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.course-card h2 {
    margin: 0 0 0.35rem;
}

.course-meta {
    color: var(--color-muted);
    margin: 0.15rem 0 0.85rem;
    font-size: 0.95rem;
}

.course-deadline {
    font-size: 0.88rem;
    color: var(--color-muted);
    margin-bottom: 0.75rem;
}

.countdown {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin: -0.5rem 0 1.1rem;
}

.course-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-cancelled {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.badge-closed {
    background: var(--color-surface-muted);
    color: var(--color-muted);
}

.badge-draft {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-open {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.badge-waitlist {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-scheduled {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-count {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.badge-category {
    background: var(--color-surface-muted);
    color: var(--color-muted);
}

.badge svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    min-height: 44px;
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 480px) {
    .button {
        width: 100%;
    }
}

.button:hover {
    background: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
}

.button:active {
    transform: scale(0.98);
}

.button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .button:hover {
        transform: translateY(-1px);
    }
}

.button-danger {
    background: var(--color-danger);
}

.button-danger:hover {
    background: #9c2b23;
}

.button-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: none;
}

.button-secondary:hover {
    background: var(--color-surface-muted);
    box-shadow: none;
    transform: none;
}

form {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 480px;
    box-shadow: var(--shadow-sm);
}

.form-wide {
    max-width: none;
}

.form-medium {
    max-width: 640px;
}

.form-row {
    margin-bottom: 1.6rem;
    display: flex;
    flex-direction: column;
}

.form-row label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
}

.form-row input:not([type="checkbox"]):not([type="radio"]),
.form-row select {
    min-height: 44px;
}

.form-row input:not([type="checkbox"]):not([type="radio"]),
.form-row textarea,
.form-row select {
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-row label:has(input[type="checkbox"]),
.form-row label:has(input[type="radio"]) {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
    cursor: pointer;
}

.form-row input[type="checkbox"],
.form-row input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.field-error {
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.notice {
    padding: 0.95rem 1.15rem;
    border-radius: var(--radius);
    margin-bottom: 1.4rem;
    font-size: 0.95rem;
}

.notice-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.notice-error,
.notice-cancelled {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.notice-closed,
.notice-maintenance {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.install-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.install-progress li {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: var(--color-surface-muted);
}

.install-progress li.is-current {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-weight: 600;
}

.install-progress li.is-done {
    color: var(--color-success);
}

.install-checklist {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.flash {
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.4rem;
    font-size: 0.95rem;
}

.flash-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.flash-error {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
}

.calendar-nav h2 {
    margin: 0;
}

.calendar-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.25rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    min-width: 100%;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar-weekday {
    background: var(--color-surface-muted);
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem 0.25rem;
}

.calendar-day {
    background: var(--color-surface);
    min-height: 96px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.calendar-day.is-empty {
    background: var(--color-surface-muted);
}

.calendar-day.is-today {
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.calendar-day-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-muted);
}

.calendar-event {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    padding: 0.28rem 0.45rem;
    border-radius: 6px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.calendar-event:hover {
    filter: brightness(0.95);
}

@media (hover: hover) and (pointer: fine) {
    .calendar-event:hover {
        transform: translateY(-1px);
    }
}

.calendar-event.badge-open {
    border-color: var(--color-primary);
}

.calendar-event.badge-closed {
    border-color: var(--color-border);
    box-shadow: none;
}

.calendar-event.badge-scheduled {
    border-color: var(--color-warning);
}

.calendar-event.badge-cancelled {
    border-color: var(--color-danger);
    text-decoration: line-through;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
    /* Scroll-Schatten an den Kanten (nur sichtbar, wenn dort noch etwas zu scrollen ist) */
    background:
        linear-gradient(to right, var(--color-surface) 30%, rgba(0, 0, 0, 0)) 0 0,
        linear-gradient(to left, var(--color-surface) 30%, rgba(0, 0, 0, 0)) 100% 0,
        linear-gradient(to right, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0)) 0 0,
        linear-gradient(to left, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0)) 100% 0;
    background-repeat: no-repeat;
    background-color: var(--color-surface);
    background-size: 32px 100%, 32px 100%, 12px 100%, 12px 100%;
    background-attachment: local, local, scroll, scroll;
}

table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    background: var(--color-surface);
}

.table-responsive table {
    box-shadow: none;
    border-radius: 0;
    background: none;
}

table th,
table td {
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.93rem;
}

@media (max-width: 480px) {

    table th,
    table td {
        padding: 0.55rem 0.6rem;
        font-size: 0.87rem;
    }
}

table th {
    background: var(--color-surface-muted);
    font-weight: 600;
    color: var(--color-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr:hover {
    background: var(--color-surface-muted);
}

.toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
    max-width: none;
}

.filter-bar {
    align-items: flex-end;
}

.pagination-bar {
    justify-content: center;
    margin-top: 2rem;
}

.filter-bar .form-row {
    margin-bottom: 0;
    min-width: 200px;
}

.status-cancelled {
    color: var(--color-danger);
    font-weight: 600;
}

.status-draft {
    color: var(--color-warning);
    font-weight: 600;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0.35rem 0 0.6rem;
}

.password-field-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.password-field-row input {
    flex: 1;
    min-width: 0;
}

.password-field-row .button {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 400px) {
    .password-field-row {
        flex-wrap: wrap;
    }

    .password-field-row input {
        flex-basis: 100%;
    }

    .password-field-row .button {
        width: 100%;
    }
}

.share-course {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    max-width: 480px;
    margin-top: 1.5rem;
}

.share-course h2 {
    margin-top: 0;
}

.share-course form {
    box-shadow: none;
    border: none;
    padding: 0;
    max-width: none;
}

/* Icons ------------------------------------------------------------------ */

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    vertical-align: -3px;
}

.icon-sm {
    width: 15px;
    height: 15px;
    vertical-align: -2px;
}

.icon-lg {
    width: 28px;
    height: 28px;
}

.icon-xl {
    width: 40px;
    height: 40px;
}

/* Stat tiles (Dashboard-KPIs) --------------------------------------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.75rem;
}

.stat-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.stat-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    flex-shrink: 0;
}

.stat-tile.is-warning .stat-tile-icon {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.stat-tile.is-danger .stat-tile-icon {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.stat-tile-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-tile-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: proportional-nums;
}

.stat-tile-label {
    font-size: 0.82rem;
    color: var(--color-muted);
}

.dashboard-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
    margin: 0 0 0.75rem;
}

.dashboard-section-title:not(:first-of-type) {
    margin-top: 0.25rem;
}

/* Zeilenaktionen / Inline-Formulare in Tabellen --------------------------- */

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
}

.inline-form {
    display: inline-flex;
    margin: 0;
    max-width: none;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* Action chips (Tabellen-Zeilenaktionen) ---------------------------------- */

.action-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--color-surface-muted);
    color: var(--color-text);
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    line-height: 1.4;
}

.action-chip:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

@media (hover: hover) and (pointer: fine) {
    .action-chip:hover {
        transform: translateY(-1px);
    }
}

.action-chip:active {
    transform: scale(0.96);
}

.action-chip:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.action-chip.is-danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.action-chip.is-danger:hover {
    background: var(--color-danger);
    color: #fff;
}

/* Toast-Flash-Messages ----------------------------------------------------- */

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 380px;
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    font-size: 0.92rem;
    animation: toast-in 0.25s ease;
}

.toast.toast-error {
    border-left-color: var(--color-danger);
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    padding: 0.2rem;
    line-height: 0;
}

.toast.is-leaving {
    animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@media (max-width: 480px) {
    .toast-stack {
        align-items: stretch;
    }

    .toast {
        max-width: none;
    }
}

/* Wartungsseite ------------------------------------------------------------ */

.maintenance-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 480px;
    margin: 1.5rem auto;
}

.maintenance-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: maintenance-spin 3.5s linear infinite;
}

.maintenance-view h1 {
    margin-bottom: 0.5rem;
}

.maintenance-view p {
    color: var(--color-muted);
}

.maintenance-dots {
    display: flex;
    gap: 0.4rem;
    margin-top: 1rem;
}

.maintenance-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: maintenance-bounce 1.2s ease-in-out infinite;
}

.maintenance-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.maintenance-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes maintenance-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes maintenance-bounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {

    .maintenance-icon,
    .maintenance-dots span,
    .toast {
        animation: none;
    }

    .button,
    .action-chip,
    .course-card {
        transition: none;
    }

    .button:hover,
    .button:active,
    .action-chip:hover,
    .action-chip:active,
    .course-card:hover {
        transform: none;
    }
}

/* Lehrgangs-Infokarte -------------------------------------------------------- */

.course-info-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.3rem;
    box-shadow: var(--shadow-sm);
    margin: 1rem 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.95rem;
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    flex-shrink: 0;
}

.info-icon svg {
    width: 15px;
    height: 15px;
}

.info-row-notes {
    padding-top: 0.3rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 0.9rem;
}

/* Konto-Banner --------------------------------------------------------------- */

.account-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.account-banner-icon {
    display: flex;
}

.account-banner-link {
    margin-left: auto;
    font-weight: 600;
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Formular-Unterabschnitt (z.B. optionale Kontoerstellung) ------------------- */

.form-subsection {
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem 0.2rem;
    margin: 0.5rem 0 1.1rem;
}

.form-subsection-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    color: var(--color-text);
}

.custom-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.custom-field-row[hidden] {
    display: none;
}

.custom-field-row input[type="text"] {
    flex: 1 1 140px;
}

.custom-field-row select {
    flex: 1 1 140px;
}