.hz-team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.hz-team-tile {
    flex: 0 0 16.666%;
    max-width: 16.666%;
    box-sizing: border-box;
}
@media screen and (max-width: 736px) {
    .hz-team-tile {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
}
@media screen and (max-width: 480px) {
    .hz-team-tile {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

.hz-card {
    position: relative;
    display: flex;
    text-align: center;
    flex-direction: column;
    min-width: 0;
    /*height: $card-height;*/
    word-wrap: break-word;
    margin: 0.125em;
    background-color: white;
    background-clip: border-box;
    border: 1px solid #ddd;
    border-radius: .25em;
}

.hz-card .hz-card-body {
    flex: 1 1 auto;
    padding: .125em;
    color: #39454b;
}
.hz-card .hz-card-img-top {
    width: 100%;
}
.hz-card .hz-card-footer {
    width: 100%;
    bottom: 0;
    padding: 1em 0;
}
.hz-caption {
    background-color: #39454b;
    color: white;
    min-height: 3.5em;
    display: flex;
    justify-content: center;
    align-items: center;
}
.gallery .hz-image-thumbnail {
    padding: .05em;
    position: relative;
}

.gallery .hz-image-thumbnail .hz-image-container:hover {
    z-index: 10;
    top: -.125em;
    left: -.125em;
    right: -.125em;
    position: absolute;
    border: .125em solid white;
}

.hz-descr {
    display: none;
}
.poptrox-overlay .poptrox-popup .caption .hz-descr {
    display: block;
}
.poptrox-overlay .poptrox-popup .caption {
    background-color: #39454b;
    color: white;
    overflow: scroll;
    padding: .5em;
    display: block;
    height: 30%;
    line-height: 1.5;
    font-size: 1.25em;
    text-align: left;
}
.button.small {
    line-height: 2em;
    height: 2em;
    font-size: 1em;
    padding: 0 1em;
}
.button.mini {
    display: inline-block;
    line-height: 1.5em;
    height: 1.5em;
    border-width: .75px;
    font-size: .75em;
    padding: 0 .5em;
}
.hz-u {
    width: 30%;
}

@media screen and (min-width: 736px) {
    .poptrox-popup {
        width: 75vw !important;
        height: 80vh !important;
        background-color: #39454b;
    }

    .poptrox-popup .pic {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 30%;
        overflow: hidden;
    }

    .poptrox-popup .pic img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain;
    }
}

#nav-toggle {
    display: none;
}
#nav-mobile {
    display: none;
    opacity: 0;
    visibility: hidden;
}
body.nav-mobile-open {
    overflow: hidden;
}

@media screen and (max-width: 736px) {
    #nav-kurse {
        display: none !important;
    }
    #header:has(#nav-kurse) {
        height: 2.5em !important;
    }
    body:has(#nav-kurse) {
        padding-top: 2.5em !important;
    }

    #nav-toggle {
        display: flex;
        align-items: center;
        position: absolute;
        right: 0.5em;
        top: 0;
        height: 100%;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 10001;
        font-size: 1.25em;
        color: #39454b;
        padding: 0 0.25em;
    }

    #nav-mobile {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.98);
        z-index: 10000;
        padding-top: 3em;
        text-align: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    #nav-mobile.active {
        opacity: 1;
        visibility: visible;
    }
    .nav-mobile-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2.5em;
        line-height: 2.5em;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 0 0.15em 0 rgba(0, 0, 0, 0.1);
        text-align: center;
    }
    .nav-mobile-logo {
        font-size: 1em;
        font-weight: 700;
        color: #39454b;
        text-decoration: none;
        letter-spacing: -1px;
    }
    #nav-mobile-close {
        position: absolute;
        right: 0.75em;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        font-size: 1.5em;
        color: #39454b;
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }
    #nav-mobile ul {
        list-style: none;
        margin: 0;
        padding: 1em 0;
    }
    #nav-mobile ul li {
        margin: 0.5em 0;
    }
    #nav-mobile ul li a {
        font-size: 1.25em;
        color: #39454b;
        text-decoration: none;
        padding: 0.5em 1em;
        display: inline-block;
    }
    #nav-mobile ul li.active a {
        font-weight: bold;
    }
    #nav-mobile .nav-mobile-kurse {
        border-top: 1px solid #ddd;
        margin-top: 1em;
    }
    #nav-mobile .nav-mobile-kurse li a {
        font-size: 1em;
        color: #666;
    }
    #nav-mobile .nav-mobile-kurse li.active a {
        color: #39454b;
        font-weight: bold;
    }

    .hz-u {
        width: 100%;
    }

    .poptrox-popup {
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .poptrox-popup .pic {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 40%;
        overflow: hidden;
    }

    .poptrox-popup .pic img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain;
    }

    .poptrox-popup .closer {
        position: absolute;
        top: 0.5em;
        right: 0.5em;
        z-index: 10;
        color: #fff;
        font-size: 1.5em;
        cursor: pointer;
    }

    .poptrox-overlay .poptrox-popup .caption {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40%;
        font-size: 0.9em;
        line-height: 1.3;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

#nav ul li.active a {
    font-weight: bold;
}

#nav-kurse {
    position: fixed;
    top: 3em;
    left: 0;
    right: 0;
    height: 2.5em;
    line-height: 2.5em;
    background: transparent;
    text-align: center;
    z-index: 9999;
}
#nav-kurse ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
#nav-kurse ul li {
    display: inline-block;
    margin: 0 0.5em;
    font-size: 0.85em;
}
#nav-kurse ul li a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0 0.5em;
}
#nav-kurse ul li a:hover {
    color: #fff;
}
#nav-kurse ul li.active a {
    color: #fff;
    font-weight: bold;
}

#intro {
    min-height: 100%;
}

th {
    text-align: left;
}
small {
    font-size: .75em;
}

.info .box {
}

.main.fullscreen {
    height: 95vh;
}

/* Registration Wizard */
.registration-intro {
    max-width: 600px;
    margin: 0 auto;
    text-align: justify;
}

.registration-intro h3 {
    text-align: left;
}

.registration-status {
    text-align: center;
    margin: 1.5em 0;
    padding: 1em;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.25em;
}

.registration-wizard {
    max-width: 600px;
    margin: 0 auto;
    text-align: justify;
}

.registration-wizard h3 {
    text-align: left;
}

#start-registration {
    font-size: 1.2em;
    padding: 0 2.5em;
}

.registration-nojs {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 1.5em;
    border-radius: 0.25em;
    margin-bottom: 2em;
}

.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2em;
    padding: 0;
    list-style: none;
}

.wizard-progress-step {
    flex: 1;
    text-align: center;
    padding: 0.5em;
    font-size: 0.85em;
    color: #999;
    border-bottom: 3px solid #ddd;
    white-space: nowrap;
}

.wizard-progress-step.active {
    color: #39454b;
    font-weight: bold;
    border-bottom-color: #39454b;
}

.wizard-progress-step.completed {
    color: #28a745;
    border-bottom-color: #28a745;
}

.wizard-step {
    display: none;
    border: none;
    padding: 0;
    margin: 0;
}

.wizard-step.active {
    display: block;
}

.wizard-step h3 {
    margin-bottom: 0.5em;
}

.step-description {
    color: #666;
    margin-bottom: 1.5em;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #eee;
}

.wizard-nav .button:only-child {
    margin-left: auto;
}

.wizard-nav-right {
    display: flex;
    gap: 0.5em;
}

.form-group {
    margin-bottom: 1.25em;
}

.form-group label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 0.25em;
    font-size: 1em;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #39454b;
}

.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #dc3545;
}

.form-row {
    display: flex;
    gap: 1em;
}

.form-group.half {
    flex: 1;
}

.required {
    color: #dc3545;
}

.field-notice {
    display: block;
    font-size: 0.85em;
    margin-top: 0.25em;
    color: #666;
}

.field-notice.warning {
    color: #856404;
    background: #fff3cd;
    padding: 0.5em;
    border-radius: 0.25em;
}

.field-notice.error {
    color: #dc3545;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.25em;
}

.consent-group {
    margin-bottom: 1em;
}

/* Participants List */
.participants-list {
    margin-bottom: 1.5em;
}

.participant-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 0.25em;
    padding: 1em;
    margin-bottom: 0.75em;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.participant-info h4 {
    margin: 0 0 0.25em 0;
    font-size: 1.1em;
}

.participant-info p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.participant-actions {
    display: flex;
    gap: 0.5em;
}

.participant-actions button {
    padding: 0.25em 0.5em;
    font-size: 0.85em;
}

.participants-empty {
    text-align: center;
    padding: 2em;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 0.25em;
    color: #666;
}

/* Participant Modal */
.participant-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}

.participant-modal-content {
    background: white;
    padding: 2em;
    border-radius: 0.5em;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.participant-modal-content h3 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5em;
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid #eee;
}

/* Dietary Section */
.dietary-section {
    margin-top: 1em;
    border: 1px solid #ddd;
    border-radius: 0.25em;
}

.dietary-section summary {
    padding: 0.75em 1em;
    cursor: pointer;
    background: #f8f9fa;
    font-weight: bold;
}

.dietary-options {
    padding: 1em;
}

.dietary-options .checkbox-label {
    margin-bottom: 0.5em;
}

.dietary-options .form-group {
    margin-top: 1em;
    margin-bottom: 0;
}

/* Summary */
.registration-summary {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 0.25em;
    padding: 1.5em;
    margin-bottom: 1.5em;
}

.summary-section {
    margin-bottom: 1.5em;
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-section h4 {
    margin: 0 0 0.5em 0;
    padding-bottom: 0.25em;
    border-bottom: 1px solid #ddd;
}

.summary-participant {
    background: white;
    padding: 0.75em;
    margin-bottom: 0.5em;
    border-radius: 0.25em;
}

/* Mobile adjustments for embedded wizard */
@media screen and (max-width: 736px) {
    .wizard-progress {
        flex-wrap: wrap;
    }

    .wizard-progress-step {
        flex: 0 0 33.333%;
        font-size: 0.75em;
        padding: 0.25em;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .participant-card {
        flex-direction: column;
    }

    .participant-actions {
        margin-top: 0.75em;
    }
}

/* Mobile fullscreen modal */
@media screen and (max-width: 736px) {
    .participant-modal-content {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
        padding-top: 4em;
    }
}

/* Jugendhilfe badges */
.jugendhilfe-badge {
    display: inline-block;
    padding: 0.4em 0.8em;
    margin-top: 0.5em;
    font-size: 0.85em;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.jugendhilfe-badge:hover {
    opacity: 0.8;
}

.jugendhilfe-badge.filled {
    background-color: #4CAF50;
    color: white;
}

.jugendhilfe-badge.skipped {
    background-color: #FF9800;
    color: white;
}

.jugendhilfe-badge.missing {
    background-color: #2196F3;
    color: white;
}

/* Jugendhilfe badge styling in participant info - distinct from regular text */
.participant-info .field-notice {
    display: inline-block;
    padding: 0.5em 0.75em;
    margin-top: 0.5em;
    font-size: 0.85em;
    font-weight: 600;
    background-color: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.participant-info .field-notice:hover {
    background-color: #e8e8e8;
    border-color: #999;
}

/* Dedicated Registration Page */
.registration-page {
    position: fixed;
    top: 3em;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 100;
}

.registration-page .form-wrapper {
    height: 100%;
}

.registration-page #registration-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.registration-page .wizard-header {
    flex-shrink: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 1em;
}

.registration-page .wizard-logo {
    display: block;
    text-align: center;
    font-size: 1.1em;
    font-weight: 700;
    color: #39454b;
    text-decoration: none;
    margin-bottom: 0.75em;
}

.registration-page .wizard-progress {
    display: flex;
    justify-content: center;
    gap: 0.25em;
    margin: 0;
    padding: 0;
    list-style: none;
}

.registration-page .wizard-progress-step {
    padding: 0.5em 0.75em;
    font-size: 0.8em;
    color: #999;
    border-bottom: 3px solid #ddd;
    white-space: nowrap;
}

.registration-page .wizard-progress-step.active {
    color: #39454b;
    font-weight: bold;
    border-bottom-color: #39454b;
}

.registration-page .wizard-progress-step.completed {
    color: #28a745;
    border-bottom-color: #28a745;
}

.registration-page .wizard-content {
    flex: 1;
    overflow-y: auto;
    padding: 2em;
}

.registration-page .wizard-step {
    max-width: 600px;
    margin: 0 auto;
    display: none;
}

.registration-page .wizard-step.active {
    display: block;
}

.registration-page .wizard-step h2 {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.registration-page .wizard-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 2em;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.registration-page .wizard-nav-right {
    display: flex;
    gap: 0.5em;
}

.registration-page .late-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 1em;
    border-radius: 0.25em;
    margin-top: 1.5em;
}

.registration-page .registration-closed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2em;
}

/* Mobile adjustments for dedicated page */
@media screen and (max-width: 736px) {
    .registration-page {
        top: 2.5em;
    }

    .registration-page .wizard-header {
        padding: 0.5em;
    }

    .registration-page .wizard-logo {
        font-size: 0.9em;
        margin-bottom: 0.5em;
    }

    .registration-page .wizard-progress {
        flex-wrap: wrap;
        gap: 0.15em;
        justify-content: center;
    }

    .registration-page .wizard-progress-step {
        flex: 0 0 auto;
        padding: 0.2em 0.4em;
        font-size: 0.65em;
        border-bottom-width: 2px;
    }

    .registration-page .wizard-content {
        padding: 1em;
    }

    .registration-page .wizard-footer {
        padding: 0.5em 0.75em;
        gap: 0.5em;
    }

    .registration-page .wizard-footer .button {
        font-size: 0.75em;
        padding: 0 0.75em;
        height: 2.25em;
        line-height: 2.25em;
    }

    .registration-page .wizard-nav-right {
        gap: 0.35em;
    }
}

/* Page Transition Styles */
main {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

/* Progressive Background Image Loading */
.progressive-bg {
  position: relative;
}

/* Pseudo-element for the background image that fades in */
.progressive-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: inherit;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  z-index: 0;
  pointer-events: none;
}

/* Ensure content is above the background layers */
.progressive-bg > * {
  position: relative;
  z-index: 1;
}

/* When image is loaded, fade in the pseudo-element */
.progressive-bg.bg-loaded::after {
  opacity: 1;
}

/* Active course category indicator */
#nav-kurse a.active {
  border-bottom: 2px solid currentColor;
  font-weight: bold;
}

/* Loading spinner (appears after 200ms) */
body.loading::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  z-index: 10000;
  pointer-events: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
