/* TAKEGIVE Basis-Design (Mobile First) */

:root {
    --color-primary: #2e7d32;
    --color-primary-dark: #1b5e20;
    --color-bg: #fafaf7;
    --color-text: #212121;
    --color-muted: #616161;
    --color-surface: #ffffff;
    --radius: 10px;
    --space: 1rem;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space);
    padding: 0.6rem var(--space);
    background: var(--color-primary);
    color: #fff;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    letter-spacing: 0.03em;
}

.main-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 0.4rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    text-decoration: underline;
}

.nav-login {
    font-weight: 600;
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: var(--space);
}

.hero h1 {
    font-size: 1.4rem;
    margin: 0 0 0.4rem;
}

.hero p {
    margin: 0 0 var(--space);
    color: var(--color-muted);
}

/* Kartenseite */

.app-main-full {
    max-width: none;
    padding: 0;
}

.map-page {
    position: relative;
}

.map-full {
    height: calc(100vh - 160px);
    min-height: 420px;
    z-index: 0;
}

.filter-bar {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.5rem var(--space);
    background: var(--color-bg);
}

.chip {
    flex: 0 0 auto;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #c5c5bd;
    background: var(--color-surface);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    min-height: 36px;
}

.chip-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

.fab {
    position: absolute;
    right: 1rem;
    bottom: 1.4rem;
    z-index: 500;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 2rem;
    line-height: 56px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.fab:hover {
    background: var(--color-primary-dark);
}

.guest-teaser {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.4rem;
    z-index: 500;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    max-width: 80%;
}

/* Marker je Ortstyp */

.tg-marker {
    background: transparent;
    border: 0;
}

.tg-marker .tg-marker-dot {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.tg-marker-takegive_spot .tg-marker-dot { background: #2e7d32; }
.tg-marker-spontaneous_box .tg-marker-dot { background: #f57f17; }
.tg-marker-hint .tg-marker-dot { background: #9e9e9e; }
.tg-marker-public_exchange .tg-marker-dot { background: #1565c0; }
.tg-marker-repair_sustainability .tg-marker-dot { background: #6a1b9a; }

.tg-marker-unconfirmed .tg-marker-dot {
    border-style: dashed;
    opacity: 0.85;
}

/* Bottom-Sheet */

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    z-index: 900;
    transition: bottom 0.25s ease;
}

.sheet-open {
    bottom: 0;
}

.sheet-inner {
    position: relative;
    background: var(--color-surface);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.25);
    padding: 1rem;
    max-width: 34rem;
    margin: 0 auto;
    max-height: 70vh;
    overflow-y: auto;
}

.sheet-close {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
    border: 0;
    background: transparent;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--color-muted);
}

.sheet-photo {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
}

.sheet-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

/* Badges */

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #e8e8e2;
    color: var(--color-text);
}

.badge-official { background: #c8e6c9; color: #1b5e20; }
.badge-partner { background: #bbdefb; color: #0d47a1; }
.badge-unconfirmed { background: #eeeeee; color: #616161; border: 1px dashed #9e9e9e; }
.badge-expiring_soon { background: #ffe0b2; color: #e65100; }
.badge-freshness_due { background: #fff9c4; color: #827717; }
.badge-type { background: var(--color-primary); color: #fff; }

/* Ortsdetail */

.place-detail {
    max-width: 44rem;
    margin: 0 auto;
    padding: var(--space);
}

.place-photo-main {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: var(--radius);
}

.place-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
}

.place-facts dt {
    font-weight: 700;
}

.place-facts dd {
    margin: 0;
}

.mini-map {
    height: 220px;
    border-radius: var(--radius);
    margin: 1rem 0;
    z-index: 0;
}

.place-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0;
    align-items: center;
}

.btn-secondary {
    display: inline-block;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    background: var(--color-surface);
    text-decoration: none;
    font-weight: 700;
    min-height: 44px;
    cursor: pointer;
    font-size: inherit;
}

.report-box {
    margin: 1rem 0;
    border: 1px solid #d9d9d2;
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    background: var(--color-surface);
}

.report-box summary {
    cursor: pointer;
    font-weight: 700;
}

.report-box label {
    display: block;
    margin: 0.6rem 0;
    font-weight: 600;
}

.report-box select,
.report-box textarea,
.report-box input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem;
    border: 1px solid #c5c5bd;
    border-radius: 6px;
    font: inherit;
    font-weight: 400;
}

.legal-snippet {
    background: #f4f4ee;
    border-left: 4px solid var(--color-primary);
    border-radius: 4px;
    padding: 0.7rem 1rem;
    margin: 0.8rem 0;
    font-size: 0.85rem;
}

.legal-warn {
    border-left-color: #e65100;
    background: #fff3e0;
}

/* Toast */

.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: -80px;
    z-index: 1200;
    background: #323232;
    color: #fff;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    transition: bottom 0.25s ease;
    max-width: 90%;
}

.toast.show {
    bottom: 1.5rem;
}

.toast-error {
    background: #b71c1c;
}

.inline-form {
    display: inline;
}

/* Eintrags-Flows */

.create-hub {
    max-width: 34rem;
    margin: 0 auto;
    padding: var(--space);
    display: grid;
    gap: 0.9rem;
}

.create-card {
    display: block;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    text-decoration: none;
    color: var(--color-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border-left: 5px solid var(--color-primary);
}

.create-card strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.create-form-page {
    max-width: 40rem;
    margin: 0 auto;
    padding: var(--space);
}

.create-form-page fieldset {
    border: 1px solid #d9d9d2;
    border-radius: var(--radius);
    background: var(--color-surface);
    margin: 0 0 1rem;
    padding: 1rem;
}

.create-form-page legend {
    font-weight: 800;
    padding: 0 0.4rem;
}

.create-form-page label {
    display: block;
    margin: 0.7rem 0;
    font-weight: 600;
}

.create-form-page input[type="text"],
.create-form-page textarea,
.create-form-page select,
.create-form-page input[type="file"] {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.6rem;
    border: 1px solid #c5c5bd;
    border-radius: 6px;
    font: inherit;
    font-weight: 400;
}

.pick-map {
    height: 300px;
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    z-index: 0;
}

.expiry-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.radio-chip input {
    position: absolute;
    opacity: 0;
}

.radio-chip span {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid #c5c5bd;
    background: #fff;
    cursor: pointer;
}

.radio-chip input:checked + span {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

label.checkbox {
    font-weight: 400;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

label.checkbox input {
    width: auto;
    margin-top: 0.2rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.form-success {
    background: #c8e6c9;
    color: #1b5e20;
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
}

/* Mein Bereich */

.me-page,
.info-page,
.print-page {
    max-width: 44rem;
    margin: 0 auto;
    padding: var(--space);
}

.me-section {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.me-attention {
    border-left: 5px solid #e65100;
}

.me-danger {
    border-left: 5px solid #b71c1c;
}

.me-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.me-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid #ecece6;
}

.me-list li:last-child {
    border-bottom: 0;
}

.link-btn {
    background: transparent;
    border: 0;
    color: #b71c1c;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    padding: 0;
    margin-left: 0.5rem;
}

.btn-danger {
    background: #b71c1c;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
}

/* Admin */

.admin-page {
    max-width: 56rem;
    margin: 0 auto;
    padding: var(--space);
}

.admin-nav {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin: 0.8rem 0 1.2rem;
}

.admin-nav a {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: var(--color-surface);
    border: 1px solid #c5c5bd;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.9rem;
}

.admin-nav a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0 1.5rem;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.stat-card strong {
    display: block;
    font-size: 1.8rem;
}

.stat-card span {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.stat-attention {
    border-left: 5px solid #e65100;
}

.admin-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-bottom: 0.9rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #ecece6;
}

.admin-table th {
    background: #ececec;
}

.audit-meta {
    font-family: monospace;
    font-size: 0.75rem;
    word-break: break-all;
}

.decide-form {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-top: 0.6rem;
}

.decide-form label {
    font-size: 0.85rem;
    font-weight: 600;
    flex: 1 1 160px;
}

.decide-form select,
.decide-form input[type="text"],
.decide-form input[type="email"] {
    display: block;
    width: 100%;
    margin-top: 0.2rem;
    padding: 0.45rem;
    border: 1px solid #c5c5bd;
    border-radius: 6px;
    font: inherit;
    font-weight: 400;
}

.decide-form label.checkbox {
    flex: 0 0 auto;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.search-form input,
.search-form select {
    padding: 0.55rem;
    border: 1px solid #c5c5bd;
    border-radius: 6px;
    font: inherit;
}

.role-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.chip-danger {
    border-color: #b71c1c;
    color: #b71c1c;
}

.settings-form label {
    display: block;
    margin: 0.9rem 0;
    font-weight: 600;
}

.settings-form input,
.settings-form select,
.settings-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.55rem;
    border: 1px solid #c5c5bd;
    border-radius: 6px;
    font: inherit;
    font-weight: 400;
}

.settings-form .hint {
    display: block;
    font-weight: 400;
}

/* Druckvorlagen */

.print-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.9rem;
    margin: 1rem 0;
}

.print-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.print-card .btn-primary {
    text-align: center;
    text-decoration: none;
}

/* Info-Seiten */

.info-page details {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 0.8rem 1.1rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.info-page summary {
    font-weight: 700;
    cursor: pointer;
}

.nav-logout {
    background: transparent;
    border: 0;
    color: #fff;
    font: inherit;
    cursor: pointer;
    padding: 0.5rem 0.4rem;
    min-height: 44px;
    text-decoration: underline;
}

.error-page {
    padding: 2rem 0;
    text-align: center;
}

/* Setup / Login / Formulare */

.setup,
.login {
    max-width: 44rem;
    margin: 0 auto;
}

.setup h2 {
    margin-top: 1.6rem;
    font-size: 1.1rem;
}

.setup-form label {
    display: block;
    margin: 0.7rem 0;
    font-weight: 600;
}

.setup-form input,
.setup-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.6rem;
    border: 1px solid #c5c5bd;
    border-radius: 6px;
    font: inherit;
    font-weight: 400;
    background: var(--color-surface);
}

.setup-form fieldset {
    border: 1px solid #d9d9d2;
    border-radius: var(--radius);
    margin: 1rem 0;
    padding: 0.8rem 1rem;
}

.setup-form legend {
    font-weight: 700;
    padding: 0 0.4rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 1rem;
}

@media (min-width: 40rem) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.hint {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.check-list {
    list-style: none;
    padding: 0;
}

.check-ok {
    color: #1b5e20;
}

.check-fail {
    color: #b71c1c;
    font-weight: 700;
}

.form-errors {
    background: #fdecea;
    border: 1px solid #f5c6c2;
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    margin: 1rem 0;
    color: #7f1d1d;
}

/* Deutlicher Warnbalken (z. B. aktives Notfall-Superadmin-Script) */
.alert-danger {
    background: #b71c1c;
    color: #fff;
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.alert-danger code {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
}

.alert-info {
    background: #e8f0fe;
    border: 1px solid #1a56b0;
    color: #123c7a;
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.alert-info p {
    margin: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 600;
    margin-top: 0.6rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 0.2rem;
}

.btn-primary {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1.6rem;
    background: var(--color-primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.secret-box {
    background: var(--color-surface);
    border: 2px dashed var(--color-primary);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1.2rem 0;
}

.secret-value code {
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    user-select: all;
}

.provider-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-width: 22rem;
    margin: 1.4rem 0;
}

.btn-provider {
    display: block;
    text-align: center;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    min-height: 44px;
    border: 1px solid #c5c5bd;
    background: var(--color-surface);
    color: var(--color-text);
}

.btn-provider:hover {
    border-color: var(--color-primary);
}

.app-footer {
    padding: var(--space);
    background: #efefe9;
}

.app-footer .legal {
    margin: 0 auto;
    max-width: 72rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}

@media (min-width: 48rem) {
    .hero h1 {
        font-size: 1.8rem;
    }
}
