/* ===========================================================
   40. Geburtstag – Tickets App
   Mobile-first design system, shared by guest + admin pages.
   =========================================================== */

:root {
    --color-bg: #faf7f2;
    --color-surface: #ffffff;
    --color-text: #24312b;
    --color-text-muted: #6b7a72;
    --color-border: #e7e0d4;

    --color-primary: #2f6f5e;
    --color-primary-dark: #24594b;
    --color-primary-contrast: #ffffff;

    --color-accent: #e07a3f;
    --color-accent-dark: #c5652f;

    --color-success: #2f6f5e;
    --color-success-bg: #e7f3ee;
    --color-warning: #b06a1a;
    --color-warning-bg: #fbeee0;

    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --shadow-card: 0 2px 10px rgba(36, 49, 41, 0.06);
    --shadow-elevated: 0 8px 30px rgba(36, 49, 41, 0.12);

    --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-system);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 96px; /* room for sticky action bar */
}

img { max-width: 100%; }

h1, h2, h3 { margin: 0 0 0.4em; line-height: 1.25; }
p { margin: 0 0 1em; }

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

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* ---------- Header ---------- */

.page-header {
    text-align: center;
    padding: 28px 16px 8px;
}

.page-header .event-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.greeting {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.intro-text {
    color: var(--color-text-muted);
    font-size: 0.97rem;
}

/* ---------- Cards ---------- */

.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 20px;
    margin-bottom: 16px;
}

.card + .card { margin-top: 16px; }

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.section-title .emoji { font-size: 1.2em; }

/* ---------- Booking line items (view / summary) ---------- */

.ticket-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    gap: 12px;
}

.ticket-line:last-child { border-bottom: none; }

.ticket-line .qty-label {
    font-weight: 600;
}

.ticket-line .sub-label {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.group-block + .group-block { margin-top: 20px; }

/* ---------- Status badge ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
}

.badge.confirmed {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge.pending {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 1.02rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform 0.05s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.98); }

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

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-border);
}

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

.btn-link {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-weight: 600;
    min-height: 44px;
    text-decoration: underline;
}

.btn-sm {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 0.9rem;
    width: auto;
}

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Sticky action bar ---------- */

.action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 -4px 16px rgba(36, 49, 41, 0.06);
    z-index: 20;
}

.action-bar .btn { margin: 0; }

/* ---------- Stepper ---------- */

.stepper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
}

.stepper-row:last-child { border-bottom: none; }

.stepper-row .label {
    font-weight: 600;
    flex: 1;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--color-bg);
    border-radius: 999px;
    padding: 4px;
    flex-shrink: 0;
}

.stepper button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(36, 49, 41, 0.15);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--color-primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.stepper button:active { transform: scale(0.94); }
.stepper button.plus { color: var(--color-accent-dark); }

.stepper .value {
    min-width: 34px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.group-card.is-empty {
    opacity: 0.55;
}
.group-card.is-empty:focus-within,
.group-card.is-empty:active {
    opacity: 1;
}

/* ---------- Total row ---------- */

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid var(--color-border);
    font-size: 1.1rem;
    font-weight: 700;
}

/* ---------- Success screen ---------- */

.success-hero {
    text-align: center;
    padding: 24px 16px 8px;
}

.success-hero .icon {
    font-size: 3rem;
    margin-bottom: 4px;
}

.success-hero h2 { font-size: 1.4rem; }

/* ---------- Utility ---------- */

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
[hidden] { display: none !important; }

.back-link {
    display: inline-block;
    padding: 8px 4px;
    margin-bottom: 4px;
    color: var(--color-text-muted);
    font-weight: 600;
    text-decoration: none;
}

.field-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: -6px;
    margin-bottom: 14px;
}

.error-box {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 0.92rem;
    margin-bottom: 14px;
}

@media (min-width: 640px) {
    .container { padding: 32px 20px; }
}
