/* ProofDay — Apple/iOS-Stil: helle Grouped-Lists, Systemschrift, Blur-Bars,
   ein Akzentblau, viel Weißraum, dezente Schatten statt harter Rahmen. */

:root {
    --system-bg: #f2f2f7;
    --card-bg: rgba(255,255,255,0.92);
    --card-bg-solid: #ffffff;
    --text-primary: #1c1c1e;
    --text-secondary: #6e6e73;
    --text-tertiary: #aeaeb2;
    --separator: rgba(60,60,67,0.12);
    --blue: #007aff;
    --green: #34c759;
    --red: #ff3b30;
    --orange: #ff9500;
    --purple: #af52de;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --maxw: 600px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    --font-mono: "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html { min-height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--system-bg);
    color: var(--text-primary);
    line-height: 1.45;
    min-height: 100vh;
    /* Platz für die fixe Tab-Bar unten + iPhone-Home-Indicator, damit der
       letzte Inhalt beim Runterscrollen nicht dahinter verschwindet */
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

a { color: inherit; text-decoration: none; }

/* ---------- Topbar: iOS Large-Title-Style ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(242,242,247,0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--separator);
}
.topbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}
.brand {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}
.brand span { color: var(--blue); }
.brand-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ---------- Nav: iOS Tab Bar (fixed unten) ---------- */
.mainnav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 30;
    background: rgba(249,249,251,0.86);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--separator);
    display: flex;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.mainnav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 2px 2px;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-tertiary);
}
.mainnav a svg { width: 24px; height: 24px; }
.mainnav a.active { color: var(--blue); }

/* ---------- Layout ---------- */
.content {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 20px 16px 32px;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 4px 0 18px;
    color: var(--text-primary);
}
h2 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin: 0 0 8px;
    padding-left: 4px;
}
.eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

/* ---------- Cards: iOS Grouped Table Style ---------- */
.card {
    background: var(--card-bg-solid);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 16px 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 8px rgba(0,0,0,0.03);
}
.card h2 { color: var(--text-secondary); }

/* Liste im iOS-Stil: erste/letzte Zeile abgerundet, Trennlinien dazwischen */
.ios-list { background: var(--card-bg-solid); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 8px rgba(0,0,0,0.03); }
.ios-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--separator); }
.ios-row:last-child { border-bottom: none; }

/* ---------- Formulare ---------- */
label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 14px 0 5px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font);
    background: var(--system-bg);
    color: var(--text-primary);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.choices label {
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 0.98rem;
    color: var(--text-primary);
    padding: 11px 0;
    margin: 0;
    border-bottom: 1px solid var(--separator);
}
.choices label:last-child { border-bottom: none; }
.choices input { width: auto; accent-color: var(--blue); }

/* ---------- Buttons: iOS Filled/Pill ---------- */
button, .btn {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    text-align: center;
    transition: transform 0.1s ease, opacity 0.15s ease;
}
button:hover, .btn:hover { opacity: 0.9; }
button:active, .btn:active { transform: scale(0.97); opacity: 0.85; }
.btn-secondary { background: rgba(0,122,255,0.1); color: var(--blue); }
.btn-danger { background: rgba(255,59,48,0.1); color: var(--red); }
.btn-block { width: 100%; margin-top: 16px; }

/* ---------- Badges (iOS Pill) ---------- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}
.badge-ok { background: rgba(52,199,89,0.15); color: #248a3d; }
.badge-danger { background: rgba(255,59,48,0.15); color: #d70015; }
.badge-muted { background: rgba(142,142,147,0.15); color: var(--text-secondary); }

.msg {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}
.msg-error { background: rgba(255,59,48,0.1); color: #d70015; }
.msg-ok { background: rgba(52,199,89,0.12); color: #248a3d; }

.list-item { padding: 13px 0; border-bottom: 1px solid var(--separator); }
.list-item:last-child { border-bottom: none; }
.muted { color: var(--text-secondary); font-size: 0.85rem; }

/* ---------- Dashboard ---------- */
.stat-row { display: flex; gap: 10px; margin: 4px 0 2px; }
.stat {
    flex: 1;
    text-align: center;
    background: var(--system-bg);
    border-radius: var(--radius-sm);
    padding: 14px 6px;
}
.stat-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.mood-picker { display: flex; gap: 8px; margin: 8px 0 2px; }
.mood-picker button {
    flex: 1;
    background: var(--system-bg);
    color: var(--text-primary);
    border: none;
    font-size: 1.5rem;
    padding: 10px 0;
    border-radius: var(--radius-sm);
}
.mood-picker button.selected { background: var(--blue); box-shadow: 0 0 0 2px var(--blue); }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip {
    background: var(--system-bg);
    border: none;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}
.chip.selected { background: var(--blue); color: #fff; }

.nora-insight { display: flex; gap: 12px; align-items: flex-start; }
.nora-avatar {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.95rem;
}
.nora-insight .who {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--purple);
    display: block;
    margin-bottom: 3px;
}

/* ---------- Chat ---------- */
.chat-log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; max-height: 55vh; overflow-y: auto; }
.chat-bubble { padding: 10px 14px; border-radius: 18px; max-width: 82%; font-size: 0.95rem; }
.chat-user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.chat-nora { align-self: flex-start; background: var(--system-bg); color: var(--text-primary); border-bottom-left-radius: 4px; }

/* ---------- Login/Setup ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(180deg, #eef1f6 0%, #f2f2f7 100%);
}
.login-card { width: 100%; max-width: 380px; }
.login-wrap .brand-lockup { text-align: center; margin-bottom: 26px; }
.login-wrap .brand-lockup .brand { font-size: 1.9rem; font-weight: 700; }
.login-wrap .brand-lockup .claim { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }

details summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--blue); margin-top: 10px; list-style: none; }
details summary::-webkit-details-marker { display: none; }

/* ---------- Reise-Visualisierung: 30-Tage-Punktegrid, rein informativ ---------- */
.journey-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin: 6px 0 2px;
}
.journey-dot {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: var(--system-bg);
}
.journey-dot.done { background: var(--green); }
.journey-dot.missed { background: rgba(255,59,48,0.35); }
.journey-dot.heute { box-shadow: 0 0 0 2px var(--blue); }
.journey-caption { display: flex; gap: 14px; margin-top: 10px; font-size: 0.72rem; color: var(--text-secondary); }
.journey-caption span { display: flex; align-items: center; gap: 5px; }
.journey-caption i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.journey-milestones { display: flex; gap: 10px; margin-top: 14px; }
.milestone { flex: 1; text-align: center; background: var(--system-bg); border-radius: var(--radius-sm); padding: 10px 4px; }
.milestone.reached { background: rgba(52,199,89,0.14); }
.milestone-num { display: block; font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.milestone-label { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-secondary); }

/* ---------- Selbstverpflichtung ---------- */
.commitment-points { margin: 10px 0 0; padding: 0; list-style: none; }
.commitment-points li {
    display: flex;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--separator);
    font-size: 0.95rem;
}
.commitment-points li:last-child { border-bottom: none; }
.commitment-points .num {
    flex-shrink: 0;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.commitment-tap {
    margin-top: 20px;
    width: 100%;
    padding: 15px;
    border-radius: var(--radius-sm);
    background: var(--system-bg);
    border: 2px dashed var(--text-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}
.commitment-tap.confirmed { background: var(--green); border: none; color: #fff; }

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    .content { padding: 16px 14px 20px; }
}
