/* =========================================================
   FAV Group — Global Stylesheet
   ========================================================= */

:root {
    /* Brand & surfaces */
    --bg-main:    #f7f6f3;   /* warm off-white canvas        */
    --mint:       #ffffff;   /* card / surface white         */
    --orange:     #ff6a2b;   /* primary accent               */
    --orange-600: #e85716;   /* accent hover                 */
    --blue-main:  #16223a;   /* headings / ink               */
    --gray-btn:   #2a3142;   /* neutral dark button          */
    --text-body:  #353a45;   /* body copy                    */
    --text-light: #8a8f9a;   /* muted / secondary            */
    --border:     #ebe9e4;   /* hairline borders             */
    --border-2:   #e3e1db;

    /* Spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 96px;

    /* Radius */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 28px;
    --radius-pill: 999px;

    /* Layout */
    --content-sm: 560px;
    --content-md: 880px;
    --content-lg: 1120px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
    --shadow-lg: 0 24px 60px rgba(16, 24, 40, .14);

    /* Hero overlay */
    --hero-overlay: linear-gradient(105deg, rgba(8,12,22,.82) 0%, rgba(8,12,22,.55) 45%, rgba(8,12,22,.20) 100%);

    --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html { scroll-behavior: smooth; }

/* hidden-Attribut durchsetzen (sonst überschreibt z.B. form{display:flex} es) */
[hidden] { display: none !important; }

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

::selection {
    background: var(--orange);
    color: #fff;
}

img { max-width: 100%; }

.container {
    max-width: var(--content-lg);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-bg {
    max-width: var(--content-lg);
    width: calc(100% - 2 * var(--space-md));
    margin: var(--space-xl) auto;
    background: var(--mint);
    padding: var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ---------- Typography ---------- */
h1, h2, h3 {
    color: var(--blue-main);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.hero-title {
    font-size: clamp(2.4rem, 5.5vw, 3.75rem);
    margin-bottom: var(--space-sm);
}

.section-title {
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.card-title {
    margin-top: var(--space-md);
    font-size: 1.35rem;
}

/* ---------- Header ---------- */
.site-header {
    background: rgba(255, 255, 255, .8);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container,
.footer-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

nav,
.footer-links,
.footer-socials { display: flex; }

nav {
    gap: var(--space-md);
    justify-content: center;
}

.logo,
.footer-logo { justify-self: start; }

.logo img,
.footer-logo img {
    max-height: 56px;
    width: auto;
    display: block;
}

nav a,
.footer-links a {
    text-decoration: none;
    color: var(--blue-main);
    font-weight: 500;
    position: relative;
    transition: color .2s var(--ease);
}

nav a { font-size: 1rem; }

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--orange);
    border-radius: 2px;
    transition: width .25s var(--ease);
}

nav a:hover,
nav a.active { color: var(--orange); }
nav a:hover::after,
nav a.active::after { width: 100%; }
.footer-links a:hover { color: var(--orange); }

.header-actions {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    justify-self: end;
}

.header-actions span {
    color: var(--text-light);
    font-size: .95rem;
    margin-right: var(--space-xs);
}

.header-actions .btn {
    padding: 10px var(--space-sm);
    font-size: .9rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px var(--space-lg);
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: .98rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .18s var(--ease), background .2s var(--ease),
                box-shadow .2s var(--ease), color .2s var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--orange);
    color: #fff;
    box-shadow: 0 8px 18px rgba(255, 106, 43, .32);
}
.btn-primary:hover {
    background: var(--orange-600);
    box-shadow: 0 12px 26px rgba(255, 106, 43, .4);
}

.btn-secondary {
    background: transparent;
    color: var(--blue-main);
    border-color: var(--border-2);
}
.btn-secondary:hover {
    background: var(--blue-main);
    color: #fff;
    border-color: var(--blue-main);
}

.btn-white {
    background: #fff;
    color: var(--blue-main);
}
.btn-white:hover { background: #f1efe9; }

button.btn {
    border: none;
    font-family: inherit;
}
button.btn-secondary { border: 1px solid var(--border-2); }

.btn-sm {
    padding: 9px var(--space-sm);
    font-size: .85rem;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: var(--space-xl) 0;
    background-image: url('../assets/bild1.jpeg');
    background-size: cover;
    background-position: center;
    min-height: 78vh;
    display: flex;
    align-items: center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-grid { max-width: 640px; }

.hero-content .hero-title { color: #fff; }

.hero-content p {
    color: rgba(255, 255, 255, .9);
    font-size: 1.2rem;
    margin-bottom: var(--space-md);
    max-width: 32ch;
}

.hero-btns {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

/* ---------- Cards (home) ---------- */
.cards-section { padding: var(--space-xl) 0; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.card {
    background: var(--mint);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    box-shadow: var(--shadow-sm);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease),
                border-color .25s var(--ease);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-2);
}

.card-img-wrapper {
    overflow: hidden;
    border-radius: var(--radius-sm);
    width: 100%;
    aspect-ratio: 4 / 3;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s var(--ease);
}

.card:hover .card-img-wrapper img { transform: scale(1.05); }

.card p {
    font-size: 1rem;
    color: var(--text-light);
    padding: 0 var(--space-xs) var(--space-xs);
}

.card-title { padding: 0 var(--space-xs); }

/* ---------- Highlight ---------- */
.highlight-text {
    text-align: center;
    padding: var(--space-lg) 0 var(--space-xl);
}

/* ---------- About ---------- */
.about-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.about-text { max-width: 540px; }
.about-text h1 { margin-bottom: var(--space-md); }
.about-text h3 {
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
    font-size: 1.2rem;
}
.about-text p {
    line-height: 1.7;
    margin-bottom: var(--space-sm);
    color: var(--text-body);
}

.about-image img {
    width: 320px;
    border-radius: var(--radius-lg);
    display: block;
    box-shadow: var(--shadow-md);
}

/* ---------- Forms ---------- */
form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

form label {
    font-size: .92rem;
    font-weight: 600;
    color: var(--blue-main);
    margin-bottom: -8px;
}

.req { color: var(--orange); }

form input,
form select,
.event-search {
    width: 100%;
    padding: 13px var(--space-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-2);
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    color: var(--blue-main);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

form input:focus,
form select:focus,
.event-search:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(255, 106, 43, .14);
}

/* Custom select with chevron */
form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2316223a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-sm) center;
}

.event-search { margin-bottom: var(--space-md); }

.form-error {
    background: #fff4ef;
    color: var(--orange-600);
    border-left: 3px solid var(--orange);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: .92rem;
}

.form-success {
    background: #eefaf2;
    color: #1c7a48;
    border-left: 3px solid #28a96a;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: .92rem;
}

/* ---------- Event & Form cards ---------- */
.event-card,
.form-card {
    background: var(--mint);
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
    transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}

.event-card:hover,
.form-card:hover {
    box-shadow: var(--shadow-md);
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: var(--content-sm);
    margin: 0 auto;
}

.event-card h3,
.form-card h3 {
    margin-bottom: var(--space-sm);
    font-size: 1.3rem;
}

.form-card-centered {
    max-width: var(--content-sm);
    margin: var(--space-xl) auto;
}

.auth-grid .form-card { flex: 1; }

/* ---------- Events management layout ---------- */
.events-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: start;
    margin: var(--space-lg) 0;
}

.events-column { min-width: 0; }

.column-title {
    margin-bottom: var(--space-md);
    font-size: 1.5rem;
}

/* Zweite (und weitere) Überschrift in einer Spalte klar als neuer Block */
.events-column .column-title ~ .column-title {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.card-section {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.card-section-title {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card-actions {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-top: var(--space-sm);
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .95rem;
    padding: 8px 0;
    color: var(--text-body);
    border-bottom: 1px dashed var(--border);
}
.task-item:last-child { border-bottom: none; }

.task-assigned {
    color: var(--text-light);
    font-size: .82rem;
}

.task-status {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: #f1efe9;
    color: var(--text-light);
}

.icon-btn-danger {
    color: var(--text-light);
    transition: color .2s var(--ease);
}

.icon-btn-danger:hover {
    color: #d64545;
}

.task-status.is-member,
.task-status.status-done,
.task-status.status-accepted {
    background: #eefaf2;
    color: #1c7a48;
}

.task-status.status-open,
.task-status.status-pending {
    background: #fdeede;
    color: #9a5b13;
}

.task-status.status-declined {
    background: #fce9e9;
    color: #a32d2d;
}

.event-creator {
    font-size: .82rem;
    color: var(--text-light);
}

.inline-form {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
    flex-direction: row;
}

.inline-form input,
.inline-form select {
    flex: 1;
    padding: 9px var(--space-sm);
    font-size: .9rem;
}

.inline-form .btn { flex-shrink: 0; }

.invite-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 10px var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--mint);
    margin-bottom: var(--space-xs);
}

.invite-row span { color: var(--text-body); }

.empty-state {
    color: var(--text-light);
    font-size: 1rem;
}

.empty-state-sm {
    color: var(--text-light);
    font-size: .85rem;
    margin-bottom: var(--space-xs);
}

/* ---------- Auth ---------- */
.auth-grid {
    display: flex;
    gap: var(--space-lg);
    max-width: var(--content-md);
    margin: var(--space-xl) auto;
}

/* ---------- Text blocks ---------- */
.text-block {
    max-width: var(--content-sm);
    margin: 0 auto;
    line-height: 1.75;
}

.text-block h2 {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xs);
    font-size: 1.6rem;
}

.text-block h3 {
    margin-bottom: var(--space-xs);
    font-size: 1.25rem;
}

.text-block p,
.text-block ul { margin-bottom: var(--space-sm); }

.text-block ul { padding-left: var(--space-md); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--blue-main);
    padding: var(--space-lg) 0;
    margin-top: var(--space-xl);
}

.site-footer .footer-logo img {
    max-height: 48px;
    filter: brightness(0) invert(1);
    opacity: .92;
}

.footer-links {
    gap: var(--space-lg);
    justify-content: center;
}

.footer-links a {
    color: rgba(255, 255, 255, .8);
    font-weight: 500;
}
.footer-links a:hover { color: #fff; }

.footer-socials {
    gap: var(--space-sm);
    justify-self: end;
}

.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    text-decoration: none;
    transition: background .2s var(--ease), transform .2s var(--ease);
}
.footer-socials a:hover {
    background: var(--orange);
    transform: translateY(-2px);
}

/* ---------- Accessibility ---------- */
:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .events-layout { grid-template-columns: 1fr; }
    .auth-grid { flex-direction: column; }
}

@media (max-width: 768px) {
    :root { --space-xl: 64px; }

    .container-bg { margin-top: var(--space-lg); margin-bottom: var(--space-lg); padding: var(--space-md); }

    .nav-container,
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-sm);
        justify-items: center;
    }

    .logo,
    .footer-logo,
    .header-actions,
    .footer-socials { justify-self: center; }

    nav { flex-wrap: wrap; }

    .footer-links {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: center;
    }

    .cards-grid { grid-template-columns: 1fr; }

    .about-layout { flex-direction: column; gap: var(--space-lg); }
    .about-image img { width: 100%; }

    .hero { min-height: 70vh; }
    .hero-content p { font-size: 1.05rem; }
}
