/* ============================================
   Website - Globale Stylesheet
   ============================================ */

/* ===== Reset & Basis ===== */
:root {
    --site-width: 1200px;
    --site-gutter: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.65;
    color: #24312e;
    background:
        radial-gradient(ellipse at 12% 0%, rgba(196, 224, 214, 0.42), transparent 34rem),
        #f6f7f4;
}

/* ===== Layout ===== */
.container {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 var(--site-gutter);
}

.main-content {
    flex: 1;
    min-height: calc(100vh - 200px);
    padding: clamp(2rem, 5vw, 4.5rem) 0;
}

.content-wrapper {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 var(--site-gutter);
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 1.5rem;
}

.home-intro,
.recent-users-panel,
.page-panel {
    background: #fff;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid #e7ece8;
    border-radius: 1.25rem;
    box-shadow: 0 14px 40px rgba(30, 55, 45, 0.06);
}

.recent-users-list {
    list-style: none;
    padding: 0;
}

.recent-users-list li + li {
    margin-top: 0.75rem;
}

.recent-users-list a {
    color: #007bff;
    text-decoration: none;
}

.recent-users-list a:hover {
    text-decoration: underline;
}

.empty-state {
    color: #687571;
}

.error-state {
    color: #721c24;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    color: #20352d;
    margin-bottom: 1rem;
}

p {
    color: #687571;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* ===== Components ===== */
.page-eyebrow {
    margin: 0 0 0.65rem;
    color: var(--eyebrow-color, #38745f);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.text-link,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #24674f;
    font-weight: 650;
    text-decoration: none;
    transition: color 0.18s ease;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.text-link:hover,
.back-link:hover {
    color: #143f31;
    text-decoration: none;
}

.text-link i,
.back-link i {
    font-size: 0.85em;
    transition: transform 0.2s ease;
}

.text-link:hover i {
    transform: translateX(3px);
}

.back-link:hover i {
    transform: translateX(-3px);
}

/* ===== Site Header ===== */
.site-header {
    background: rgba(255, 255, 255, 0.92);
    color: #24312e;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(215, 225, 219, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 4px 24px rgba(29, 91, 75, 0.06);
}

.header-container {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 var(--site-gutter);
    gap: 2rem;
    min-height: 68px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: var(--site-width);
    margin: 0 auto;
}

/* ===== Logo / Crest ===== */
.logo {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 0.75rem;
    color: #1d5b4b;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.82;
}

/* Coat-of-arms crest badge */
.logo-crest {
    display: none; /* Wrapper entfernt – SVG direkt im .logo */
}

.logo-crest-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
    flex-shrink: 0;
}

/* Logo text stack */
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-name {
    font-size: 1.15rem;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d5b4b;
}

.logo-tagline {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #68917e;
    margin-top: 1px;
}

.site-nav {
    justify-self: center;
}

.site-nav ul {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: block;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    color: #43504b;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
    color: #15513f;
    background: #eaf3ee;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 0.5rem;
}

.header-actions .theme-toggle,
.header-actions .header-contact-icon,
.header-actions .menu-toggle {
    width: 2.55rem;
    height: 2.55rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    color: var(--link);
    background: var(--surface);
    box-shadow: 0 3px 12px rgba(28, 72, 54, 0.08);
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.header-actions .theme-toggle:hover,
.header-actions .header-contact-icon:hover,
.header-actions .menu-toggle:hover {
    border-color: #b7d1c1;
    color: var(--link);
    background: var(--surface-muted);
    box-shadow: 0 5px 16px rgba(28, 72, 54, 0.12);
}

.header-contact-icon {
    display: none;
    place-items: center;
    text-decoration: none;
}

.header-contact-icon i {
    font-size: 1rem;
}

.menu-toggle {
    display: none;
}

.menu-toggle.is-open {
    border-color: var(--link);
    color: var(--link);
    background: var(--surface-muted);
}

.brand-mark {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 0.7rem;
    color: white;
    background: #1d5b4b;
    font-size: 1.1rem;
    font-weight: 700;
}

.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.32rem 0.38rem 0.32rem 1.05rem;
    border-radius: 999px;
    color: white;
    background: #1d5b4b;
    font-size: 0.85rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 10px rgba(29, 91, 75, 0.25);
}

.header-cta:hover {
    color: white;
    background: #154638;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(29, 91, 75, 0.35);
}

.cta-arrow {
    display: grid;
    width: 1.9rem;
    height: 1.9rem;
    place-items: center;
    border-radius: 50%;
    color: #1d5b4b;
    background: white;
    font-size: 1rem;
}

.header-contact-icon {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid #dce7df;
    border-radius: 50%;
    color: #24312e;
}

.header-contact-icon svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    color: #24312e;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.menu-toggle:hover {
    background: #eaf3ee;
}

.burger-icon {
    display: grid;
    gap: 5px;
    width: 26px;
}

.burger-icon span {
    display: block;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.search-form input[type="text"] {
    width: auto;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-item a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-item a:hover,
.nav-item.active a {
    color: #007bff;
}

/* ===== Formular-Styles ===== */
.form-group {
    margin-bottom: 1.1rem;
}

label {
    display: block;
    font-weight: bold;
    color: #34423d;
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid #d5dfd9;
    border-radius: 0.7rem;
    color: #24312e;
    background: #fff;
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(38, 113, 88, 0.16);
    border-color: #39816a;
}

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background-color: #1d5b4b;
    color: white;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.7rem;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

button:hover, .btn:hover {
    color: white;
    background-color: #154638;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(21, 70, 56, 0.2);
}

button:active, .btn:active {
    transform: translateY(0);
}

button i, .btn i {
    font-size: 0.9em;
}

/* ===== User Info Box ===== */
.user-info {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
}

/* ===== Error Pages ===== */
.error-page .container {
    text-align: center;
    padding: 60px 20px;
}

.error-code {
    font-size: 4rem;
    color: #e74c3c;
    font-weight: bold;
}

/* ===== Debug Info ===== */
.debug-info {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

/* ===== Footer ===== */
.site-footer {
    margin-top: auto;
    padding: clamp(2.75rem, 6vw, 4.25rem) 0 1.25rem;
    color: #e9f1ed;
    background:
        radial-gradient(ellipse at 85% 0%, rgba(67, 133, 105, 0.2), transparent 32rem),
        #142720;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 var(--site-gutter);
}

.footer-main {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
    padding-bottom: clamp(2rem, 4vw, 3rem);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: grid;
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    place-items: center;
    padding: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-container, 15px);
    background: #f8faf8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-logo-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.footer-logo:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
}

.footer-brand-name {
    color: #f0f6f2;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.footer-brand-tagline {
    margin-top: 0.2rem;
    color: #a8c2b5;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
}

.footer-heading {
    margin: 0;
    color: #eaf3ed;
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.footer-nav-links {
    display: grid;
    gap: 0.65rem;
}

.footer-nav a,
.footer-legal a {
    color: #b6c9bf;
    text-decoration: none;
    transition: color 0.18s ease;
}

.footer-nav a:hover,
.footer-legal a:hover {
    color: #fff;
}

.footer-social-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
}

.footer-social {
    display: flex;
    gap: 0.65rem;
}

.social-link {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.8rem;
    color: #d4e4da;
    background: rgba(255, 255, 255, 0.06);
    font-size: 1.05rem;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-link:hover {
    border-color: rgba(183, 226, 205, 0.45);
    color: #fff;
    background: rgba(97, 165, 130, 0.24);
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 2rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.copyright {
    margin: 0;
    color: #9fb6aa;
    font-size: 0.82rem;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.4rem;
    font-size: 0.82rem;
}

.footer-account {
    font-size: 0.82rem;
}

.footer-account a {
    color: #8fa99b;
    text-decoration: none;
    transition: color 0.18s ease;
}

.footer-account a:hover {
    color: #dcebe1;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

@media (max-width: 760px) {
    .footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1.25rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .site-header {
        padding: 0;
    }

    .header-container {
        grid-template-areas: "brand actions";
        grid-template-columns: 1fr auto;
        gap: 0 0.5rem;
        min-height: 54px;
        padding: 0.6rem var(--site-gutter);
    }

    .logo {
        grid-area: brand;
        gap: 0.5rem;
        align-self: center;
    }

    .logo-tagline {
        display: none;
    }

    .logo-crest-img {
        width: 32px;
        height: 32px;
    }

    .logo-name {
        font-size: 1rem;
    }

    .site-nav {
        position: absolute;
        z-index: 101;
        grid-column: 1 / -1;
        justify-self: stretch;
        top: calc(100% + 0.5rem);
        right: -0.5rem;
        left: -0.5rem;
        width: auto;
        max-height: calc(100vh - 5rem);
        overflow-y: auto;
        padding: 0.75rem;
        border: 1px solid var(--border);
        border-radius: 1.15rem;
        background: var(--surface);
        box-shadow: 0 22px 50px rgba(20, 45, 34, 0.22);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-0.35rem);
        visibility: hidden;
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    }

    .site-nav.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        visibility: visible;
    }

    .site-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .site-nav a {
        display: flex;
        min-height: 3.4rem;
        align-items: center;
        padding: 0.85rem 1rem;
        border-radius: 0.75rem;
        font-size: 1.02rem;
    }

    .header-actions {
        grid-area: actions;
        gap: 0.4rem;
        align-self: center;
    }

    .header-contact-icon {
        display: grid;
    }

    .header-actions .theme-toggle,
    .header-actions .header-contact-icon,
    .header-actions .menu-toggle {
        width: 2.4rem;
        height: 2.4rem;
    }

    .header-cta {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.is-open .burger-icon span:first-child {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-toggle.is-open .burger-icon span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.is-open .burger-icon span:last-child {
        transform: translateY(-7px) rotate(-45deg);
    }

    .home-layout {
        grid-template-columns: 1fr;
    }

    .navbar-menu {
        gap: 1rem;
    }
}
