body {
    font-family: Arial, sans-serif;
    background: #1a1a1a;
    color: white;
    text-align: center;
    margin: 0;
}

body.is-transitioning {
    pointer-events: none;
    cursor: progress;
}

.hm-page-transition {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top left, rgba(91, 141, 239, 0.35), transparent 55%),
        radial-gradient(circle at bottom right, rgba(30, 64, 175, 0.35), transparent 45%),
        #0b0f1a;
    opacity: 0;
    transform: scale(1);
    transition: opacity 260ms ease, transform 360ms ease;
    z-index: 2147483647;
}

.hm-page-transition.is-active {
    opacity: 1;
    transform: scale(1.02);
}

@media (prefers-reduced-motion: reduce) {
    .hm-page-transition {
        transition: none;
    }
}

.container, #login {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #1e1e1e;
    border-radius: 10px;
}

input, button, select, textarea{
    padding: 10px;
    width: 80%;
    margin: 10px auto;
    display: block;
}

button {
    cursor: pointer;
}

:root {
    --header-bg: rgba(15, 15, 15, 0.85);
    --header-border: rgba(255, 255, 255, 0.05);
    --accent: #007bff;
    --header-radius: 8px;
    --header-gap: clamp(0.75rem, 2vw, 1.1rem);
}

.hm-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--header-border);
    display: flex;
    justify-content: flex-start;
}

.hm-navbar__inner {
    width: min(1200px, 100%);
    max-width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(0.75rem, 3vw, 2rem);
    padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
    text-align: left;
    box-sizing: border-box;
    flex: 1 1 auto;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex: 0 0 auto;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.logo-link img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.brand {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: calc(var(--header-gap) * 0.85);
    flex: 1 1 auto;
    min-height: 44px;
    margin-left: clamp(0.75rem, 2.5vw, 1.25rem);
    min-width: 0;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem 1.1rem;
    border-radius: var(--header-radius);
    color: #f6f6f6;
    text-decoration: none;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.nav-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 3px;
}

.nav-link.active,
.nav-link[aria-current="page"] {
    color: #fff;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -6px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0;
    transform: scaleX(0.75);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-link:hover::after {
    opacity: 0.5;
    transform: scaleX(1);
}

.nav-link.active::after,
.nav-link[aria-current="page"]::after {
    opacity: 1;
    transform: scaleX(1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 1.5vw, 0.85rem);
    flex: 0 0 auto;
    margin-left: auto;
}

.language-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.45rem 0.85rem;
    border-radius: var(--header-radius);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lang-switch:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.12);
}

.lang-switch:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 3px;
}

.lang-switch__caret {
    width: 0.75rem;
    height: 0.75rem;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.language-switcher.is-open .lang-switch__caret {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.35rem;
    min-width: 200px;
    border-radius: calc(var(--header-radius) + 2px);
    border: 1px solid var(--header-border);
    background: rgba(15, 15, 18, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1200;
}

.language-switcher.is-open .language-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: var(--header-radius);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.language-option:hover,
.language-option:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: none;
}

.language-option[aria-current="true"] {
    background: rgba(0, 123, 255, 0.25);
}

.language-option__text {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-weight: 600;
}

.language-option__name {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
}

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem 1.1rem;
    border-radius: var(--header-radius);
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(0, 123, 255, 0.35);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-login:hover {
    filter: brightness(1.1);
}

.btn-login:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 3px;
}

.hm-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--header-radius);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.hm-back-link:hover {
    background: rgba(255, 255, 255, 0.12);
}

.hm-back-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 3px;
}

.is-hidden {
    display: none !important;
}

.auth-role-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.auth-role-hint[data-role="admin"] {
    color: #fbbf24;
}

.auth-role-hint[data-role="teacher"] {
    color: #c084fc;
}

.auth-role-hint[data-role="class_admin"] {
    color: #60a5fa;
}

.auth-role-hint[data-role="student"] {
    color: #a7f3d0;
}

.auth-role-hint.is-hidden {
    display: none;
}

.nav-link--admin {
    font-weight: 600;
}

@media (max-width: 900px) {
    .hm-navbar__inner {
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 0.75rem;
    }

    .nav-links {
        order: 2;
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        scrollbar-width: thin;
        scroll-snap-type: x proximity;
    }

    .nav-links::-webkit-scrollbar {
        height: 6px;
    }

    .nav-links::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 999px;
    }

    .nav-right {
        order: 3;
        width: 100%;
        justify-content: flex-end;
    }
}

.content {
  margin-top: 10vh;
}

#description {
    max-width: 800px;
    margin: 20px 20px;
    padding: 0 20px;
    text-align: left;
}

#meldung {
    color: red;
}

/* Spezieller Stil f\xC3\xBCr das Loginfenster */
.login-container {
    background: #100f0f;
    max-width: 420px;
    margin: 60px auto;
    padding: 32px 36px;
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.32s ease, box-shadow 0.32s ease;
}

.login-container.is-switching {
    transform: translateY(-6px);
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55);
}

.login-container.is-switching .login-form {
    animation: auth-switch-fade 0.36s ease forwards;
}

@keyframes auth-switch-fade {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-container.is-switching .login-form {
        animation: none;
    }
}

.login-container [hidden] {
    display: none !important;
}

.login-container input,
.login-container select,
.login-container textarea {
    width: 100%;
    margin: 0;
}

.login-container .form-control {
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #2b2b2b;
    background: #151515;
    color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-container .form-control:focus {
    outline: none;
    border-color: #5b8def;
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.25);
}

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.76);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    padding: clamp(1rem, 3vw, 2rem);
}

.auth-overlay.is-visible {
    display: flex;
}

.auth-overlay__backdrop {
    position: absolute;
    inset: 0;
}

.auth-overlay .login-container {
    margin: 0;
    width: min(420px, 95vw);
    position: relative;
    box-shadow: 0 36px 72px rgba(0, 0, 0, 0.55);
}

.auth-overlay__close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.auth-overlay__close:hover,
.auth-overlay__close:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    outline: none;
}

body.has-auth-overlay {
    overflow: hidden;
}

.login-logo {
    width: 160px;
    margin: 0 auto 24px;
    display: block;
}

.login-title {
    margin: 0 0 24px;
    font-size: 1.75rem;
    font-weight: 700;
}

.login-status {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #9ca3af;
    text-align: center;
}

.login-status.is-authenticated {
    color: #a7f3d0;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.login-form .auth-section {
    transition: opacity 0.28s ease, transform 0.28s ease, max-height 0.32s ease;
}

.login-form .auth-section-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    max-height: 0;
    pointer-events: none;
}

.login-form .auth-section-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: 520px;
    pointer-events: auto;
}

.login-form [data-auth-register-only] {
    display: none;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    pointer-events: none;
}

.login-form.is-register-mode [data-auth-register-only] {
    display: flex;
    opacity: 1;
    visibility: visible;
    max-height: 520px;
    pointer-events: auto;
}

.login-form [data-auth-register-only].auth-section-active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.login-form [data-auth-login-only] {
    overflow: hidden;
}

.login-banner {
    display: none;
    flex-direction: column;
    gap: 8px;
    background: rgba(91, 141, 239, 0.12);
    border: 1px solid rgba(91, 141, 239, 0.45);
    border-radius: 12px;
    padding: 16px;
    color: #d1e3ff;
}

.login-banner[hidden] {
    display: none !important;
}

.login-banner:not([hidden]) {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    text-align: left;
}

.form-group label {
    font-weight: 600;
    letter-spacing: 0.03em;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field .form-control {
    padding: 12px 52px 12px 16px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: #b8b8b8;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.3s ease, background 0.3s ease;
    padding: 0;
}

.toggle-password:hover,
.toggle-password:focus,
.toggle-password:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.toggle-password.visible {
    color: #5b8def;
}

.toggle-password::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: currentColor;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toggle-password.visible::after {
    opacity: 1;
}

.eye-icon {
    position: relative;
    width: 22px;
    height: 14px;
}

.eye-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid currentColor;
    border-radius: 12px / 8px;
}

.eye-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.3s ease, border 0.3s ease;
}

.toggle-password.visible .eye-icon::after {
    background: transparent;
    border: 2px solid currentColor;
}

.login-feedback {
    min-height: 20px;
    font-size: 0.9rem;
    color: #9ca3af;
}

.login-feedback.error {
    color: #ff6b6b;
}

.login-feedback.success {
    color: #34d399;
}

.login-feedback[hidden] {
    display: none;
}

.login-links {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 14px;
}

.login-link {
    background: none;
    border: none;
    color: #5b8def;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    text-decoration: underline;
}

.login-link:hover,
.login-link:focus,
.login-link:focus-visible {
    color: #82a8ff;
    outline: none;
}

.login-link:disabled {
    opacity: 0.6;
    cursor: default;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-actions button {
    width: 100%;
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, border-color 0.3s ease;
}

.login-button {
    background: linear-gradient(135deg, #3763ff, #5b8def);
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 12px 24px rgba(55, 99, 255, 0.35);
}

.login-button:hover,
.login-button:focus,
.login-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(55, 99, 255, 0.45);
    outline: none;
}

.guest-button {
    background: transparent;
    color: #ffffff;
    border: 1px solid #333333;
}

.guest-button:hover,
.guest-button:focus,
.guest-button:focus-visible {
    border-color: #5b8def;
    background: rgba(91, 141, 239, 0.18);
    outline: none;
}

.guest-info {
    margin: -8px 0 0;
    font-size: 0.9rem;
    color: #b5b5b5;
    text-align: center;
}

@media (max-width: 520px) {
    .login-container {
        margin: 40px auto;
        padding: 28px 24px;
    }

    .login-title {
        font-size: 1.5rem;
    }
}

/* Overlay styles for messages */
.overlay {
    position: fixed;
    top: clamp(1rem, 3vw, 1.5rem);
    right: clamp(1rem, 3vw, 1.5rem);
    width: min(360px, calc(100vw - 2rem));
    display: none;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
}

.overlay.overlay--visible,
.overlay.overlay--hiding {
    display: block;
}

.overlay-content {
    background: rgba(23, 30, 45, 0.95);
    padding: 1rem 1.2rem;
    border-radius: 10px;
    color: #fff;
    border-left: 4px solid rgba(91, 141, 239, 0.75);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    font-size: 0.95rem;
    line-height: 1.4;
    pointer-events: auto;
    backdrop-filter: blur(8px);
}

.overlay p {
    margin: 0;
}

.overlay.overlay--visible {
    opacity: 1;
}

.overlay.overlay--visible .overlay-content {
    animation: overlay-toast-in 240ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.overlay.overlay--hiding .overlay-content {
    animation: overlay-toast-out 200ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

.overlay--info .overlay-content {
    border-left-color: rgba(91, 141, 239, 0.9);
    background: rgba(91, 141, 239, 0.12);
}

.overlay--success .overlay-content {
    border-left-color: rgba(46, 165, 107, 0.85);
    background: rgba(46, 165, 107, 0.12);
}

.overlay--error .overlay-content {
    border-left-color: rgba(227, 87, 87, 0.85);
    background: rgba(227, 87, 87, 0.12);
}

.overlay--warning .overlay-content {
    border-left-color: rgba(219, 167, 45, 0.85);
    background: rgba(219, 167, 45, 0.12);
}

@keyframes overlay-toast-in {
    from {
        opacity: 0;
        transform: translate3d(30px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes overlay-toast-out {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
    to {
        opacity: 0;
        transform: translate3d(30px, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .overlay.overlay--visible,
    .overlay.overlay--hiding {
        opacity: 1;
    }

    .overlay.overlay--visible .overlay-content,
    .overlay.overlay--hiding .overlay-content {
        animation: none;
    }
}

/* --------- Tagesübersicht --------- */
.page-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 5vw;
}

.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    text-align: left;
}

.page-header h1,
.page-header h2 {
    margin: 0;
}

.page-date {
    color: #b5b5b5;
    font-size: 0.95rem;
}

.overview-grid {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

@media (min-width: 700px) {
    .overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

.day-card {
    background: #1f1f1f;
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid #2a2a2a;
}

.day-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.day-card.current-day {
    border-color: #1e90ff;
    box-shadow: 0 0 18px rgba(30, 144, 255, 0.35);
    background: rgba(30, 144, 255, 0.12);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.schedule-table th,
.schedule-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #2e2e2e;
    text-align: left;
}

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

.schedule-table .no-entry {
    text-align: center;
    color: #9c9c9c;
}

.site-footer,
.current-subject__footer {
    display: none !important;
}

.hm-footer {
    margin: clamp(3rem, 6vh, 4.5rem) auto 2rem;
    padding: 1.5rem clamp(1.5rem, 4vw, 3.5rem) 0;
    max-width: min(1100px, 90vw);
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.hm-footer__legal {
    display: flex;
    gap: 0.35rem;
    white-space: nowrap;
}

.hm-footer__links {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: auto;
}

.hm-footer__link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

.hm-footer__link:hover,
.hm-footer__link:focus-visible {
    color: rgba(96, 165, 250, 0.9);
    outline: none;
}

.hm-footer__divider {
    opacity: 0.4;
    font-size: 1.1em;
}

.hm-toast-container {
    position: fixed;
    inset-inline-end: clamp(1rem, 4vw, 3rem);
    inset-block-start: clamp(1rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1400;
    pointer-events: none;
}

.hm-toast {
    min-width: 240px;
    max-width: 360px;
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    background: rgba(15, 23, 42, 0.85);
    color: #f8fafc;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.35);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
    position: relative;
}

.hm-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hm-toast--success {
    border-color: rgba(74, 222, 128, 0.5);
}

.hm-toast--error {
    border-color: rgba(248, 113, 113, 0.5);
}

.hm-toast__close {
    position: absolute;
    inset-inline-end: 0.25rem;
    inset-block-start: 0.1rem;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
}

.hm-contact-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.hm-contact-modal.is-visible {
    display: flex;
}

.hm-contact-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
}

.hm-contact-modal__dialog {
    position: relative;
    background: #101522;
    border-radius: 18px;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    width: min(640px, 92vw);
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hm-contact-modal__form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 0;
    width: 100%;
}

.hm-contact-modal__close {
    position: absolute;
    inset-inline-end: 1rem;
    inset-block-start: 1rem;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
}

.hm-contact-modal__header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hm-contact-modal__lead {
    margin: 0;
    color: rgba(148, 163, 184, 0.85);
    font-size: 0.95rem;
}

.hm-contact-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.hm-contact-modal__meta {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hm-contact-modal__note {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(148, 163, 184, 0.9);
}

.hm-contact-modal__note.is-warning {
    color: rgba(248, 113, 113, 0.9);
}

.hm-contact-modal__field--full {
    grid-column: 1 / -1;
}

.hm-contact-modal__field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.hm-contact-modal__field input,
.hm-contact-modal__field textarea {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.85);
    color: inherit;
    padding: 0.75rem 1rem;
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hm-contact-modal__field textarea {
    resize: vertical;
}

.hm-contact-modal__field input:focus,
.hm-contact-modal__field textarea:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.65);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.hm-contact-modal__hint {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: rgba(148, 163, 184, 0.75);
}

.hm-contact-modal__hint--info {
    color: rgba(148, 163, 184, 0.8);
}

.hm-contact-modal__error {
    min-height: 1em;
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: rgba(248, 113, 113, 0.9);
}

.hm-contact-modal__privacy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hm-contact-modal__checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.hm-contact-modal__checkbox input {
    margin-top: 0.2rem;
}

.hm-contact-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hm-contact-modal__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 999px;
    padding: 0.75rem 1.75rem;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.hm-contact-modal__button--primary {
    background: rgba(59, 130, 246, 0.9);
    color: #f8fafc;
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.3);
}

.hm-contact-modal__button--primary[data-loading] {
    cursor: progress;
    opacity: 0.7;
}

.hm-contact-modal__button--primary:hover,
.hm-contact-modal__button--primary:focus-visible {
    background: rgba(37, 99, 235, 0.95);
    outline: none;
}

.hm-contact-modal__button--secondary {
    background: rgba(30, 41, 59, 0.8);
    color: rgba(226, 232, 240, 0.85);
    border-color: rgba(148, 163, 184, 0.25);
}

.hm-contact-modal__button--secondary:hover,
.hm-contact-modal__button--secondary:focus-visible {
    background: rgba(30, 41, 59, 0.95);
    outline: none;
}

.hm-contact-modal__spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 2px solid rgba(248, 250, 252, 0.45);
    border-top-color: transparent;
    display: none;
}

.hm-contact-modal__button--primary[data-loading] .hm-contact-modal__spinner {
    display: inline-block;
    animation: hm-contact-spin 0.75s linear infinite;
}

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

.hm-contact-modal__fallback {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hm-contact-modal__fallback-link {
    color: rgba(96, 165, 250, 0.9);
    text-decoration: underline;
}

.hm-contact-modal__honeypot {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.hm-contact-modal-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .hm-contact-modal__grid {
        grid-template-columns: 1fr;
    }

    .hm-footer {
        justify-content: center;
        gap: 0.75rem;
    }

    .hm-toast-container {
        inset-inline-end: 1rem;
        inset-block-start: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hm-footer__link,
    .hm-toast,
    .hm-contact-modal__button,
    .hm-contact-modal__spinner {
        transition: none;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Admin dashboard */
.admin-dashboard {
    max-width: 1100px;
    margin: clamp(1.5rem, 4vw, 3rem) auto;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    background: rgba(12, 16, 26, 0.92);
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(3, 6, 14, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

.admin-dashboard__header {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.admin-dashboard__header h1 {
    font-size: clamp(1.6rem, 3vw, 2rem);
    margin: 0;
}

.admin-dashboard__header p {
    margin: 0;
    color: rgba(226, 232, 240, 0.75);
}

.admin-dashboard__nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.admin-dashboard__actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.15rem;
    font: inherit;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(14, 116, 144, 0.35));
    color: inherit;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.admin-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(14, 116, 144, 0.35);
}

.admin-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.admin-button--ghost {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.22);
}

.admin-button--ghost:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.admin-button.is-active {
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.45);
}

.admin-table-container {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(11, 15, 26, 0.8);
}

.admin-table th,
.admin-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.admin-table th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.72);
}

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

.admin-table-container.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.admin-table-empty {
    padding: 2rem;
    text-align: center;
    color: rgba(226, 232, 240, 0.7);
}

.admin-table-container.is-empty .admin-table {
    display: none;
}

.admin-table__actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.admin-message {
    margin-top: 1.25rem;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.12);
    color: #f0fdfa;
    border: 1px solid rgba(45, 212, 191, 0.35);
}

.admin-message[data-type="error"] {
    background: rgba(239, 68, 68, 0.12);
    color: #fee2e2;
    border-color: rgba(239, 68, 68, 0.45);
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.admin-pagination__buttons {
    display: flex;
    gap: 0.5rem;
}

.admin-dialog-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 20, 0.65);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 2000;
}

.admin-dialog-backdrop.is-visible {
    opacity: 1;
}

.admin-dialog {
    width: min(520px, 92vw);
    background: #0f172a;
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 25px 60px rgba(2, 6, 23, 0.55);
}

.admin-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.admin-dialog__title {
    margin: 0;
    font-size: 1.25rem;
}

.admin-dialog__close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
}

.admin-dialog__body {
    margin-bottom: 1rem;
}

.admin-dialog__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.admin-dialog__message {
    margin-right: auto;
    color: rgba(248, 113, 113, 0.9);
    display: none;
}

.admin-dialog__message:not(:empty) {
    display: block;
}

.admin-form {
    display: grid;
    gap: 1rem;
}

.admin-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-form__field--checkbox {
    flex-direction: row;
    align-items: center;
}

.admin-form__label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(226, 232, 240, 0.7);
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.75);
    color: inherit;
    font: inherit;
}

.admin-form textarea {
    resize: vertical;
}

.admin-form__help {
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.65);
}

@media (max-width: 720px) {
    .admin-dashboard {
        padding: 1.25rem;
    }
    .admin-dashboard__actions {
        justify-content: center;
    }
    .admin-pagination {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-table__actions {
        flex-wrap: wrap;
    }
}
