/* Gemeinsames Stylesheet fuer oeffentliche Seiten und die Teilnehmeransicht. */

:root {
    --primary: #1c5d99;
    --primary-dark: #0f3d66;
    --secondary: #4fb8d6;
    --background: #eef3f8;
    --surface: #ffffff;
    --text: #1c2b3a;
    --text-muted: #6b7a8d;
    --border: #e2e8f0;

    --success-bg: #e3f5ea;
    --success-fg: #1f9d55;
    --danger-bg: #fbe7e7;
    --danger-fg: #d64545;
    --neutral-bg: #eef1f4;
    --neutral-fg: #5b6b7c;

    /* Rueckwaertskompatible Aliase (frueher verwendete Variablennamen). */
    --mv-primary: var(--primary);
    --mv-primary-dark: var(--primary-dark);
    --mv-bg: var(--background);
}

html, body {
    height: 100%;
}

body {
    background-color: var(--background);
    color: var(--text);
}

a {
    color: var(--primary);
}

.app-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
}

.app-footer__admin-link {
    font-size: 0.8rem;
    opacity: 0.65;
}

.app-footer__admin-link:hover {
    opacity: 1;
}

/* =====================================================================
   Teilnehmeransicht
   ===================================================================== */

.member-body {
    background-color: var(--background);
}

.member-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.member-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem 2.5rem;
}

/* --- Kopfbereich mit Logo --- */

.member-header {
    background-color: var(--surface);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem;
}

.member-header__logo {
    height: 40px;
    width: auto;
    max-width: 90vw;
}

.member-header__brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

@media (max-width: 575.98px) {
    .member-header {
        padding: 1rem;
    }

    .member-header__logo {
        height: 28px;
    }
}

/* --- MV-Banner --- */

.mv-banner {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1.5rem 1rem 3rem;
    overflow: hidden;
}

.mv-banner__inner {
    position: relative;
    z-index: 1;
}

.mv-banner__title {
    color: #fff;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.mv-banner__wave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 48px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30 Q150 0 300 22 T600 20 T900 28 T1200 12 V60 H0 Z' fill='%23ffffff' fill-opacity='0.16'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 40 Q200 10 400 34 T800 30 T1200 38 V60 H0 Z' fill='%23eef3f8'/%3E%3C/svg%3E");
}

@media (max-width: 575.98px) {
    .mv-banner {
        padding: 1rem 1rem 2.5rem;
    }

    .mv-banner__title {
        font-size: 1.15rem;
    }
}

/* --- Zentrale Card --- */

.member-card {
    background-color: var(--surface);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(15, 61, 102, 0.08), 0 8px 24px rgba(15, 61, 102, 0.06);
    padding: 1.75rem 1.5rem;
    width: 100%;
    max-width: 720px;
    margin-top: -2.25rem;
    position: relative;
    z-index: 2;
}

@media (max-width: 575.98px) {
    .member-card {
        padding: 1.5rem 1.1rem;
        border-radius: 0.85rem;
        margin-top: -1.75rem;
    }
}

.member-state {
    animation: mv-fade-in 0.25s ease-in;
}

.member-state--center {
    text-align: center;
}

@keyframes mv-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.member-card__kicker {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.member-card__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.member-card__question {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 1.1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}

.member-card__lead {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.member-card__text {
    color: var(--text);
    margin-bottom: 0.35rem;
}

.member-card__muted {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* --- Waiting-Indikator (dezent statt Spinner) --- */

.waiting-indicator {
    width: 14px;
    height: 14px;
    margin: 0 auto 1.25rem;
}

.waiting-indicator span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--secondary);
    animation: mv-pulse 1.8s ease-in-out infinite;
}

@keyframes mv-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* --- Beschreibung ein-/ausklappen --- */

.description-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.6rem 0;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    text-align: left;
}

.description-toggle__label {
    flex: 1 1 auto;
}

.description-toggle__chevron {
    display: inline-flex;
    transition: transform 0.2s ease;
}

.description-toggle.is-expanded .description-toggle__chevron {
    transform: rotate(180deg);
}

.member-description {
    background-color: var(--background);
    border-radius: 0.6rem;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.member-description :first-child {
    margin-top: 0;
}

.member-description :last-child {
    margin-bottom: 0;
}

.poll-not-eligible {
    font-size: 0.9rem;
}

/* --- Antwortmoeglichkeiten --- */

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.poll-option {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 64px;
    padding: 0.6rem 1.1rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.poll-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (hover: hover) {
    .poll-option:not(:disabled):hover {
        border-color: var(--primary);
        background-color: color-mix(in srgb, var(--primary) 6%, var(--surface));
    }
}

.poll-option:not(:disabled):active {
    transform: scale(0.99);
    background-color: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.poll-option__icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--neutral-bg);
    color: var(--neutral-fg);
}

.poll-option--positive .poll-option__icon {
    background-color: var(--success-bg);
    color: var(--success-fg);
}

.poll-option--negative .poll-option__icon {
    background-color: var(--danger-bg);
    color: var(--danger-fg);
}

.poll-option__text {
    flex: 1 1 auto;
}

.poll-option__chevron {
    flex: 0 0 auto;
    color: var(--text-muted);
}

/* --- Bestaetigungsdialog --- */

.confirm-choice {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.confirm-actions {
    max-width: 420px;
    margin: 1.25rem auto 0;
}

.btn-vote {
    min-height: 56px;
    border-radius: 0.65rem;
    font-weight: 700;
    font-size: 1.02rem;
    border: 1px solid transparent;
}

.btn-vote--primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-vote--primary:hover,
.btn-vote--primary:focus-visible {
    background-color: var(--primary-dark);
    color: #fff;
}

.btn-vote--secondary {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-vote--secondary:hover,
.btn-vote--secondary:focus-visible {
    background-color: var(--background);
}

/* --- Status-Icons (VOTED / MEETING_FINISHED) --- */

.status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon--success {
    background-color: var(--success-bg);
    color: var(--success-fg);
}

.status-icon--neutral {
    background-color: var(--neutral-bg);
    color: var(--neutral-fg);
}

.voted-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* --- Ergebnisansicht --- */

.result-options {
    margin-top: 0.75rem;
}

.result-item {
    margin-bottom: 1.1rem;
}

.result-item__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--text);
}

.result-item__stats {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.result-item__track {
    background-color: var(--neutral-bg);
    border-radius: 999px;
    height: 0.85rem;
    overflow: hidden;
}

.result-item__fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.result-summary {
    text-align: center;
    color: var(--text-muted);
    margin-top: 1.25rem;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* --- Toast --- */

.member-toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background-color: var(--primary-dark);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0.65rem;
    z-index: 1080;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
    max-width: 90vw;
}

.member-toast__icon {
    display: inline-flex;
    flex: 0 0 auto;
}

/* --- Footer --- */

.member-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem 1.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.member-footer__status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.member-footer__links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.member-footer__links a {
    color: var(--text-muted);
    text-decoration: none;
}

.member-footer__links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.member-footer__logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-size: inherit;
    font-family: inherit;
}

.member-footer__logout:hover {
    color: var(--primary);
    text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
    .member-state,
    .waiting-indicator span,
    .result-item__fill,
    .description-toggle__chevron {
        animation: none !important;
        transition: none !important;
    }
}

/* Alte Klassennamen bleiben als Alias erhalten, falls noch referenziert. */
.result-bar {
    background-color: var(--neutral-bg);
    border-radius: 0.4rem;
    overflow: hidden;
    height: 1.75rem;
    position: relative;
    margin-bottom: 0.75rem;
}

.result-bar__fill {
    background-color: var(--primary);
    height: 100%;
    transition: width 0.4s ease;
}

.result-bar__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.6);
}

.admin-login-bg {
    background-color: var(--background);
}

/* Fokus-Sichtbarkeit fuer Tastaturbedienung */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #ffb703;
    outline-offset: 2px;
}

