/* ============================================================================
   Umfrage Alltagsglueck - Stylesheet
   Branding: Gruen #3D8B28 / Orange #E8842F
   Aesthetik: warm, vertrauenserweckend, klar lesbar
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;500;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
    /* Markenfarben Alltagsglueck */
    --ag-green: #3D8B28;
    --ag-green-dark: #2E6A1E;
    --ag-green-light: #E8F3E3;
    --ag-orange: #E8842F;
    --ag-orange-dark: #C66B1F;
    --ag-orange-light: #FCEFE0;

    /* Neutrale Toene */
    --bg: #FAF8F4;
    --surface: #FFFFFF;
    --border: #E5E0D6;
    --text: #2A2620;
    --text-muted: #6B6359;
    --text-soft: #8A8275;

    /* Funktionale Farben */
    --error: #C5343A;
    --success: var(--ag-green);

    /* Typografie */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Manrope', -apple-system, sans-serif;

    /* Layout */
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(61,139,40,0.08);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Hintergrund-Muster: dezent organisch */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse at top left, rgba(61,139,40,0.06), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(232,132,47,0.05), transparent 50%);
}

/* ============================================================
   Layout
   ============================================================ */

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.container-wide {
    max-width: 1100px;
}

/* ============================================================
   Header / Brand
   ============================================================ */

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ag-green) 0%, var(--ag-green-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    box-shadow: 0 2px 8px rgba(61,139,40,0.25);
    position: relative;
}

.brand-mark::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--ag-orange);
    border-radius: 50%;
    bottom: -3px;
    right: -3px;
    border: 2px solid var(--bg);
}

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

.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text);
    line-height: 1.1;
}

.brand-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ============================================================
   Typografie
   ============================================================ */

h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    color: var(--text);
}

h1 em {
    font-style: italic;
    color: var(--ag-green);
}

h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

h3 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ag-green-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

p { margin-bottom: 1rem; }

p.lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.55;
}

a { color: var(--ag-green-dark); }
a:hover { color: var(--ag-orange-dark); }

/* ============================================================
   Cards
   ============================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.card-accent {
    border-left: 4px solid var(--ag-orange);
    background: var(--ag-orange-light);
    border-color: var(--ag-orange-light);
}

.card-info {
    background: var(--ag-green-light);
    border-color: var(--ag-green-light);
    border-left: 4px solid var(--ag-green);
}

.card h3:first-child { margin-top: 0; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    line-height: 1.2;
}

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

.btn-primary {
    background: var(--ag-green);
    color: white;
    box-shadow: 0 2px 8px rgba(61,139,40,0.25);
}
.btn-primary:hover {
    background: var(--ag-green-dark);
    box-shadow: 0 4px 14px rgba(61,139,40,0.32);
    color: white;
}

.btn-secondary {
    background: var(--ag-orange);
    color: white;
    box-shadow: 0 2px 8px rgba(232,132,47,0.25);
}
.btn-secondary:hover {
    background: var(--ag-orange-dark);
    box-shadow: 0 4px 14px rgba(232,132,47,0.32);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--ag-green);
    color: var(--ag-green-dark);
}

.btn-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn-large {
    padding: 1.1rem 2rem;
    font-size: 1.1rem;
}

/* ============================================================
   Formular
   ============================================================ */

.section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.section:first-of-type { border-top: none; padding-top: 0; }

.section-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ag-orange-dark);
    background: var(--ag-orange-light);
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.q {
    margin-bottom: 2rem;
}

.q-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.45;
}

.q-num {
    display: inline-block;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--ag-orange);
    margin-right: 0.4rem;
    font-weight: 500;
}

.q-hint {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.45;
}

textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 90px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--ag-green);
    box-shadow: 0 0 0 3px rgba(61,139,40,0.12);
}

/* Likert-Skala */
.likert {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.5rem;
}

.likert-pole {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0 0.25rem;
}

.likert-options {
    display: flex;
    gap: 0.4rem;
    flex: 1;
    justify-content: center;
}

.likert input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.likert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.15s ease;
    user-select: none;
}

.likert-btn:hover {
    border-color: var(--ag-green);
    color: var(--ag-green-dark);
}

.likert input[type="radio"]:checked + .likert-btn {
    background: var(--ag-green);
    border-color: var(--ag-green);
    color: white;
    box-shadow: 0 2px 8px rgba(61,139,40,0.3);
}

.likert input[type="radio"]:focus-visible + .likert-btn {
    outline: 2px solid var(--ag-orange);
    outline-offset: 2px;
}

/* Radio-Choice (Single-Choice fuer F14) */
.choice {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.choice label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.choice label:hover {
    border-color: var(--ag-green);
    background: var(--ag-green-light);
}

.choice input[type="radio"] {
    accent-color: var(--ag-green);
    width: 18px;
    height: 18px;
}

.choice input[type="radio"]:checked + span {
    font-weight: 600;
}

.choice label:has(input:checked) {
    border-color: var(--ag-green);
    background: var(--ag-green-light);
}

/* Bereichs-Likert (mehrere Items in einer Frage) */
.likert-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.likert-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.likert-row-label {
    flex: 1 1 200px;
    font-weight: 500;
}

.likert-row .likert {
    margin: 0;
    flex: 0 0 auto;
}

/* Honeypot (Anti-Bot) */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ============================================================
   Hinweise
   ============================================================ */

.notice {
    padding: 1rem 1.25rem;
    background: var(--ag-green-light);
    border-left: 4px solid var(--ag-green);
    border-radius: var(--radius);
    font-size: 0.95rem;
    margin: 1.5rem 0;
}

.notice-warn {
    background: var(--ag-orange-light);
    border-left-color: var(--ag-orange);
}

.notice strong { color: var(--ag-green-dark); }

/* ============================================================
   Danke-Seite
   ============================================================ */

.thanks-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.thanks-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--ag-green) 0%, var(--ag-green-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    box-shadow: 0 8px 24px rgba(61,139,40,0.3);
    animation: pulse-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pulse-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-soft);
}

.footer a { color: var(--text-muted); text-decoration: none; margin: 0 0.5rem; }
.footer a:hover { color: var(--ag-green-dark); }

/* ============================================================
   Admin
   ============================================================ */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--ag-green-dark);
    line-height: 1;
}

.stat-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.admin-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-q-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.admin-q-num {
    color: var(--ag-orange);
    font-family: var(--font-display);
    font-style: italic;
    margin-right: 0.4rem;
}

/* Likert-Verteilung Balken */
.dist {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.75rem 0;
}

.dist-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.dist-label {
    width: 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dist-bar {
    flex: 1;
    height: 22px;
    background: var(--ag-green-light);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.dist-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ag-green) 0%, var(--ag-green-dark) 100%);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.dist-count {
    width: 4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dist-mean {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dist-mean strong { color: var(--ag-green-dark); font-size: 1.1rem; }

/* Freitext-Liste */
.freitext-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.freitext-item {
    background: var(--bg);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--ag-orange);
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.freitext-empty {
    color: var(--text-soft);
    font-style: italic;
    font-size: 0.9rem;
}

/* Login */
.login-card {
    max-width: 400px;
    margin: 5rem auto;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.login-card input:focus {
    outline: none;
    border-color: var(--ag-green);
    box-shadow: 0 0 0 3px rgba(61,139,40,0.12);
}

.error-msg {
    color: var(--error);
    background: #FCE6E7;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 600px) {
    .container { padding: 1.5rem 1rem 3rem; }
    h1 { font-size: 1.75rem; }
    .card { padding: 1.25rem; }
    .likert-btn { width: 40px; height: 40px; font-size: 0.95rem; }
    .likert-options { flex-wrap: wrap; }
    .btn { padding: 0.85rem 1.25rem; font-size: 0.95rem; }
    .btn-row { flex-direction: column; }
    .btn-row .btn { width: 100%; }
}

/* Print: nur fuer Admin-PDF-Export, falls jemand drucken will */
@media print {
    .btn, .btn-row, .admin-header { display: none; }
    body { background: white; }
    .admin-section { page-break-inside: avoid; }
}
