/* ==========================================================
   DESIGN SYSTEM (Modern / Notion / Linear inspired)
   ========================================================== */

:root {
    --bg: #f3f4f6;
    --bg-soft: #eef0f4;
    --card: #ffffff;

    --primary: #2563eb;
    --primary-soft: #e0edff;
    --primary-hover: #1d4ed8;

    --danger: #dc2626;

    --text-main: #111827;
    --text-subtle: #6b7280;

    --border: #e5e7eb;

    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);

    --radius-card: 16px;
    --radius-pill: 999px;
    --radius-input: 10px;
}

/* ==========================================================
   BASE
   ========================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 24px 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e5edff 0, #f9fafb 45%, #f3f4f6 100%);
    color: var(--text-main);
}

/* ==========================================================
   LAYOUT WRAPPER
   ========================================================== */

.shell {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
}

/* ==========================================================
   TOPBAR
   ========================================================== */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.topbar-title {
    font-size: 26px;
    font-weight: 700;
}

.topbar-user {
    font-size: 14px;
    color: var(--text-subtle);
}

.topbar-user a {
    color: var(--primary);
    text-decoration: none;
}

.topbar-user a:hover {
    text-decoration: underline;
}

/* ==========================================================
   NAVIGATION PILLS
   ========================================================== */

.nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.9);
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(15,23,42,0.04);
    transition: background .15s, box-shadow .15s, transform .08s;
}

.nav-pill:hover {
    background: #fff;
    box-shadow: 0 8px 18px rgba(15,23,42,0.08);
    transform: translateY(-1px);
}

.nav-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==========================================================
   CARDS
   ========================================================== */

.card {
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 20px 22px;
    margin-bottom: 20px;
    border: 1px solid rgba(148,163,184,0.18);
}

.card h2, .card h3 {
    margin: 0 0 4px 0;
    font-weight: 600;
}

/* ==========================================================
   TABLE BASE (DESKTOP)
   ========================================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f9fafb;
    font-weight: 600;
}

/* ==========================================================
   LINKS
   ========================================================== */

.table-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.table-link-danger {
    color: var(--danger);
}

/* ==========================================================
   FORM ELEMENTS
   ========================================================== */

label {
    font-size: 14px;
    color: var(--text-subtle);
}

input[type=text],
input[type=email],
input[type=password],
input[type=date],
input[type=number],
textarea,
select {
    width: 100%;
    padding: 10px 11px;
    border-radius: var(--radius-input);
    border: 1px solid var(--border);
    margin-top: 4px;
    font-size: 14px;
    background: #fff;
}

textarea { 
    min-height: 110px; 
    resize: vertical; 
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

/* ==========================================================
   BUTTONS
   ========================================================== */

button,
.button-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 11px 16px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 14px;
    transition: background .15s, box-shadow .15s, transform .08s;
}

button:hover,
.button-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 10px 22px rgba(37,99,235,0.35);
    transform: translateY(-1px);
}

/* ==========================================================
   LOGIN / REGISTER (Authentifizierung)
   ========================================================== */

.container {
    max-width: 420px;
    margin: 40px auto;
    background: #fff;
    padding: 24px 22px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
}

/* ==========================================================
   SURVEY FRONTEND (Design)
   ========================================================== */

.survey-header {
    background: #fff;
    padding: 20px 22px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148,163,184,0.18);
    margin-bottom: 20px;
}

.survey-header h1 {
    margin-top: 0;
    font-size: 22px;
}

.badge-past {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 500;
}

/* ==========================================================
   PARTICIPANT LIST (Cards)
   ========================================================== */

.participants h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
}

.participant-actions button {
    width: auto !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    margin-top: 0 !important;
}

.participant-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 10px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
}

.participant-card.has-answer {
    border-color: #86efac;
    background: #ecfdf3;
}

.participant-card.no-answer {
    border-color: #fecaca;
    background: #fef2f2;
}

.participant-name a {
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    font-size: 15px;
}

.participant-status {
    font-size: 14px;
    color: var(--text-subtle);
    text-align: right;
    max-width: 60%;
}

/* ==========================================================
   OPTION CARDS (Checkbox-Auswahl)
   ========================================================== */

.option-card {
    display: block;
    margin-bottom: 12px;
    cursor: pointer;
}

.option-card input[type="checkbox"] {
    display: none;
}

.option-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    transition: border .15s, background .15s, box-shadow .15s;
}

.option-card input[type="checkbox"]:checked + .option-inner {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.option-main {
    font-size: 14px;
    font-weight: 600;
}

.option-meta {
    font-size: 13px;
    color: var(--text-subtle);
}

.option-tag {
    font-size: 12px;
    color: var(--text-subtle);
}

.limit-warning {
    color: var(--danger);
    font-weight: 600;
}

/* ==========================================================
   MOBILE FIRST OPTIMIERUNG
   ========================================================== */

@media (max-width: 640px) {

    body {
        font-size: 15px;
    }

	 .shell {
    	width: 100%;
    	max-width: 100%;
    	padding: 0 16px 24px 16px; /* ← sauberer Rand */
    	margin: 0 auto;
	}

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .topbar-title {
        font-size: 22px;
    }

    .nav-pill {
        flex: 1 1 calc(50% - 10px);
        justify-content: center;
        padding: 10px 8px;
    }

    .card {
		padding: 16px 16px;
		border-radius: 14px;
		margin-left: 0;
		margin-right: 0;
    }

    /* TABLE → CARD (Mobile) */
    table.responsive {
        border: 0;
    }

    table.responsive thead {
        display: none;
    }

    table.responsive tr {
        display: block;
        margin-bottom: 16px;
        padding: 14px 20px;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: var(--shadow-soft);
    }

    table.responsive td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
        border: 0;
        font-size: 15px;
    }

    table.responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-main);
    }
}

/* ==========================================================
   FIX: Teilnehmerliste Buttons
   ========================================================== */

table.responsive td form button {
    width: auto !important;
    padding: 8px 18px !important;
    margin-top: 0 !important;
    font-size: 14px !important;
    border-radius: var(--radius-pill);
    min-width: 120px;
}

/* Löschen-Button angleichen */
table.responsive .table-link-danger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px 16px !important;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    min-width: 80px;
}

table.responsive .table-link-danger:hover {
    background: #b91c1c;
}