/* ============================================================================
   FlowTasks – style.css
   Clean, modernes UI im dunklen Navy-Look mit Pink/Lila-Akzent.
   ----------------------------------------------------------------------------
   Inhalt:
     1. Design-Tokens (CSS-Variablen) für Dark & Light
     2. Reset & Basis
     3. Hintergrund-Glow
     4. Typografie
     5. Buttons & Formularelemente
     6. Card-Komponente
     7. Landing-Page (index.html)
     8. Auth-Seiten (login/register)
     9. Dashboard
    10. Todo-Karten
    11. FAB (Floating Action Button)
    12. Modals
    13. Toasts
    14. Skeleton-Loader & Spinner
    15. Cookie-Banner
    16. Impressum
    17. Responsive (Mobile First -> Desktop)
   ========================================================================== */

/* ============================================================================
   1. DESIGN-TOKENS
   ========================================================================== */
:root {
    /* Marken-Gradient (Pink -> Lila) – das prägende Akzent-Element */
    --grad-start: #ff5e9a;
    --grad-end:   #a85cff;
    --gradient: linear-gradient(135deg, var(--grad-start), var(--grad-end));

    --accent: #a85cff;
    --accent-soft: rgba(168, 92, 255, 0.16);

    /* Prioritätsfarben */
    --priority-high: #ff5e7e;
    --priority-medium: #ffb648;
    --priority-low: #4fd6a8;

    /* Status */
    --danger: #ff5e7e;
    --warning: #ffb648;
    --success: #4fd6a8;
    --info: #6ea8ff;

    /* Radius – betont runde, weiche Formen */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-full: 999px;

    /* Übergänge */
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typografie */
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
            Roboto, Helvetica, Arial, sans-serif;
}

/* DARK THEME (Standard, entspricht der Designvorlage) */
[data-theme='dark'] {
    --bg-base: #161a2b;
    --bg-glow-1: rgba(168, 92, 255, 0.18);
    --bg-glow-2: rgba(255, 94, 154, 0.14);

    --surface: #1e2238;
    --surface-2: #252a45;
    --surface-hover: #2c3252;
    --border: rgba(255, 255, 255, 0.07);
    --glass-blur: 14px;

    --text-primary: #f3f4fb;
    --text-secondary: #a7abca;
    --text-tertiary: #6b6f90;

    --input-bg: #232842;
    --input-border: rgba(255, 255, 255, 0.08);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 12px 30px rgba(168, 92, 255, 0.4);
}

/* LIGHT THEME (cleane helle Variante) */
[data-theme='light'] {
    --bg-base: #f3f4fb;
    --bg-glow-1: rgba(168, 92, 255, 0.12);
    --bg-glow-2: rgba(255, 94, 154, 0.10);

    --surface: #ffffff;
    --surface-2: #f6f7fc;
    --surface-hover: #eef0f9;
    --border: rgba(20, 23, 45, 0.07);
    --glass-blur: 14px;

    --text-primary: #1b1f33;
    --text-secondary: #5c6080;
    --text-tertiary: #9296b3;

    --input-bg: #ffffff;
    --input-border: rgba(20, 23, 45, 0.12);

    --shadow-sm: 0 2px 10px rgba(20, 23, 45, 0.06);
    --shadow-md: 0 12px 30px rgba(20, 23, 45, 0.10);
    --shadow-lg: 0 24px 56px rgba(20, 23, 45, 0.14);
    --shadow-glow: 0 12px 30px rgba(168, 92, 255, 0.32);
}

/* ============================================================================
   2. RESET & BASIS
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-base);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background var(--transition-slow), color var(--transition-slow);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--grad-start); }

img { max-width: 100%; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ============================================================================
   3. HINTERGRUND-GLOW (sehr dezent, cleaner Look)
   ========================================================================== */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.9;
}
.blob-1 { width: 420px; height: 420px; background: var(--bg-glow-1); top: -140px; right: -100px; }
.blob-2 { width: 360px; height: 360px; background: var(--bg-glow-2); bottom: -140px; left: -120px; }
.blob-3 { width: 280px; height: 280px; background: var(--bg-glow-1); top: 45%; left: 55%; opacity: 0.5; }

/* ============================================================================
   4. TYPOGRAFIE
   ========================================================================== */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

/* ============================================================================
   5. BUTTONS & FORMULARE
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.72rem 1.4rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition),
                background var(--transition), opacity var(--transition), filter var(--transition);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.06); }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); transform: translateY(-2px); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-2px); }

.btn-lg { padding: 0.95rem 2rem; font-size: 1.02rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* Formularelemente */
.form-group { margin-bottom: 1.2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
}

input[type='text'], input[type='email'], input[type='password'],
input[type='date'], input[type='time'], input[type='search'],
textarea, .select {
    width: 100%;
    padding: 0.78rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, .select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
textarea { resize: vertical; min-height: 72px; }

.select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b6f90' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.select-sm { padding: 0.5rem 2rem 0.5rem 0.8rem; font-size: 0.85rem; }

.form-hint { display: block; margin-top: 0.35rem; font-size: 0.78rem; color: var(--text-tertiary); }

.checkbox-label {
    display: flex; align-items: center; gap: 0.6rem;
    cursor: pointer; font-weight: 500; color: var(--text-primary); margin-bottom: 0;
}
.checkbox-label input[type='checkbox'] {
    width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer;
}

.password-wrapper { position: relative; }
.password-toggle {
    position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 1.1rem; opacity: 0.7;
    transition: opacity var(--transition);
}
.password-toggle:hover { opacity: 1; }

.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.forgot-link { font-size: 0.82rem; font-weight: 500; }

/* ============================================================================
   6. CARD-KOMPONENTE
   ========================================================================== */
.glass-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Markenlogo */
.brand-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: var(--gradient);
    color: #fff; border-radius: 11px; font-weight: 700;
    box-shadow: var(--shadow-glow);
}
.brand-icon-lg { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 18px; }

/* ============================================================================
   7. LANDING-PAGE (minimal)
   ========================================================================== */
.landing-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 1.5rem;
}
.landing { width: 100%; max-width: 420px; text-align: center; }
.landing-card {
    padding: 3rem 2.2rem 2.4rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.landing-card .brand-icon-lg { margin-bottom: 1rem; }
.landing-card h1 { font-size: 2rem; }
.landing-tagline { color: var(--text-secondary); margin-bottom: 1.8rem; }
.landing-actions { display: flex; flex-direction: column; gap: 0.7rem; width: 100%; }
.landing-footer { margin-top: 1.6rem; font-size: 0.85rem; }
.landing-footer a { color: var(--text-tertiary); }

/* Fixierter Theme-Schalter */
.theme-toggle {
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-full); cursor: pointer;
    transition: transform var(--transition), background var(--transition);
}
.theme-toggle:hover { transform: rotate(18deg) scale(1.08); background: var(--surface-hover); }
.theme-toggle-fixed { position: fixed; top: 1.2rem; right: 1.2rem; z-index: 50; }

/* ============================================================================
   8. AUTH-SEITEN
   ========================================================================== */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 1.5rem;
}
.auth-container { width: 100%; max-width: 430px; }
.auth-card { padding: 2.5rem; }
.auth-brand {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    font-size: 1.3rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1.5rem;
}
.auth-card h1 { text-align: center; font-size: 1.6rem; margin-bottom: 0.4rem; }
.auth-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 2rem; font-size: 0.95rem; }
.auth-switch { text-align: center; margin-top: 1.4rem; font-size: 0.92rem; color: var(--text-secondary); }
.auth-switch a { font-weight: 600; }
.auth-legal { text-align: center; margin-top: 1rem; font-size: 0.8rem; }
.auth-legal a { color: var(--text-tertiary); }

/* ============================================================================
   9. DASHBOARD
   ========================================================================== */
.dashboard-header {
    position: sticky; top: 0; z-index: 100;
    max-width: 1100px; margin: 1rem auto;
    padding: 0.9rem 1.4rem;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: var(--radius-md);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}
.header-brand { display: flex; align-items: center; gap: 0.6rem; }
.header-brand h1 { font-size: 1.25rem; }
.header-actions { display: flex; align-items: center; gap: 0.7rem; }
.user-email {
    font-size: 0.85rem; color: var(--text-secondary);
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dashboard-main { max-width: 1100px; margin: 0 auto; padding: 0 1rem 4rem; }

/* Statistik-Karten */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.9rem; margin-bottom: 1.5rem;
}
.stat-card {
    padding: 1.2rem 1.4rem;
    display: flex; flex-direction: column; gap: 0.3rem;
    border-radius: var(--radius-md);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
/* Erste Karte hervorgehoben (wie die Akzentkarte der Vorlage) */
.stats-grid .stat-card:first-child {
    background: var(--gradient);
    border: none;
    box-shadow: var(--shadow-glow);
}
.stats-grid .stat-card:first-child .stat-label,
.stats-grid .stat-card:first-child .stat-value { color: #fff; }
.stat-label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }
.stat-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-danger .stat-value { color: var(--danger); }
.stat-warning .stat-value { color: var(--warning); }
.stat-info .stat-value { color: var(--info); }

/* Toolbar */
.toolbar {
    display: flex; gap: 1rem; align-items: center;
    padding: 0.9rem 1.1rem; margin-bottom: 1.2rem;
    border-radius: var(--radius-md); flex-wrap: wrap;
}
.search-wrapper { position: relative; flex: 1; min-width: 200px; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); opacity: 0.6; pointer-events: none; }
.search-wrapper input { padding-left: 2.6rem; }
.toolbar-controls { display: flex; gap: 0.7rem; align-items: center; }

/* Filter */
.filters {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap;
}
.filter-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
    padding: 0.45rem 1rem; font-size: 0.85rem; font-weight: 500;
    color: var(--text-secondary); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-full);
    cursor: pointer; transition: all var(--transition);
}
.chip:hover { background: var(--surface-hover); color: var(--text-primary); }
.chip.active { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }
.filter-selects { display: flex; gap: 0.6rem; }

/* Dashboard-Footer (dezent) */
.dashboard-footer {
    max-width: 1100px; margin: 2rem auto 0; padding: 1.2rem;
    text-align: center; font-size: 0.82rem; color: var(--text-tertiary);
}
.dashboard-footer a { color: var(--text-tertiary); }

/* ============================================================================
   10. TODO-KARTEN
   ========================================================================== */
.todo-list { list-style: none; display: flex; flex-direction: column; gap: 0.8rem; }

.todo-card {
    display: flex; align-items: flex-start; gap: 1rem;
    padding: 1.1rem 1.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--priority-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    cursor: grab;
    animation: cardIn 0.3s ease backwards;
}
.todo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.todo-card.priority-high { border-left-color: var(--priority-high); }
.todo-card.priority-medium { border-left-color: var(--priority-medium); }
.todo-card.priority-low { border-left-color: var(--priority-low); }
.todo-card.completed { opacity: 0.55; }
.todo-card.completed .todo-title { text-decoration: line-through; }
.todo-card.dragging { opacity: 0.4; cursor: grabbing; }
.todo-card.drag-over { box-shadow: 0 0 0 2px var(--accent); }

@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Runde Checkbox (Gradient bei "erledigt") */
.todo-checkbox {
    flex-shrink: 0; width: 26px; height: 26px; margin-top: 1px;
    border: 2px solid var(--text-tertiary); border-radius: 50%;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    background: transparent; color: #fff; font-size: 0.85rem;
}
.todo-checkbox:hover { border-color: var(--accent); }
.todo-card.completed .todo-checkbox { background: var(--gradient); border-color: transparent; }

.todo-content { flex: 1; min-width: 0; }
.todo-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.2rem; word-break: break-word; }
.todo-description { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 0.5rem; word-break: break-word; }

.todo-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.todo-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.22rem 0.6rem; font-size: 0.74rem; font-weight: 500;
    border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-secondary);
}
.badge-priority-high { background: rgba(255, 94, 126, 0.16); color: var(--priority-high); }
.badge-priority-medium { background: rgba(255, 182, 72, 0.16); color: var(--priority-medium); }
.badge-priority-low { background: rgba(79, 214, 168, 0.16); color: var(--priority-low); }
.badge-overdue { background: rgba(255, 94, 126, 0.16); color: var(--danger); font-weight: 600; }
.badge-category { background: var(--accent-soft); color: var(--accent); }
.badge-tag { background: var(--surface-2); }
.badge-recurring { background: rgba(110, 168, 255, 0.16); color: var(--info); }

.todo-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.icon-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 1rem; opacity: 0.6; transition: all var(--transition);
}
.icon-btn:hover { opacity: 1; background: var(--surface-hover); }

/* ============================================================================
   11. FAB (Floating Action Button)
   ========================================================================== */
.fab {
    position: fixed; bottom: 1.6rem; right: 1.6rem; z-index: 80;
    width: 60px; height: 60px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2rem; line-height: 1; font-weight: 300;
    color: #fff; background: var(--gradient);
    border: none; border-radius: 50%; cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.fab:hover { transform: translateY(-3px) scale(1.05); filter: brightness(1.08); }
.fab:active { transform: scale(0.95); }

/* ============================================================================
   12. MODALS
   ========================================================================== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
    background: rgba(10, 12, 22, 0.55);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}
.modal-overlay[hidden] { display: none; }
.modal {
    width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
    border-radius: var(--radius-lg);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-sm { max-width: 400px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.4rem 1.6rem 0.8rem; }
.modal-close {
    width: 36px; height: 36px; background: var(--surface-2); border: none; border-radius: 50%;
    font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text-secondary);
    transition: all var(--transition);
}
.modal-close:hover { background: var(--surface-hover); transform: rotate(90deg); }
.modal-body { padding: 1rem 1.6rem 1.6rem; }
.modal-footer { display: flex; gap: 0.8rem; justify-content: flex-end; margin-top: 1.5rem; }
.modal-footer-center { justify-content: center; }
.text-center { text-align: center; }
.delete-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.modal-sm h2 { margin-bottom: 0.5rem; }
.modal-sm p { color: var(--text-secondary); margin-bottom: 0.5rem; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* Tag-Eingabe */
.tag-input-wrapper {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
    padding: 0.5rem; background: var(--input-bg);
    border: 1px solid var(--input-border); border-radius: var(--radius-sm);
}
.tag-input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tag-input-wrapper input { flex: 1; min-width: 120px; border: none; background: transparent; padding: 0.35rem; box-shadow: none; }
.tag-input-wrapper input:focus { box-shadow: none; }
.tag-chips { display: contents; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.5rem 0.25rem 0.7rem; font-size: 0.8rem;
    background: var(--accent-soft); color: var(--accent); border-radius: var(--radius-full);
}
.tag-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; opacity: 0.7; }
.tag-chip button:hover { opacity: 1; }

/* ============================================================================
   13. TOASTS
   ========================================================================== */
.toast-container {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 2000;
    display: flex; flex-direction: column; gap: 0.7rem; max-width: 360px;
}
.toast {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.9rem 1.1rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateX(120%); opacity: 0;
    transition: transform var(--transition), opacity var(--transition);
}
.toast-visible { transform: translateX(0); opacity: 1; }
.toast-hiding { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }
.toast-icon {
    flex-shrink: 0; width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 0.85rem; color: #fff; font-weight: 700;
}
.toast-success .toast-icon { background: var(--success); }
.toast-error .toast-icon { background: var(--danger); }
.toast-warning .toast-icon { background: var(--warning); }
.toast-info .toast-icon { background: var(--info); }
.toast-message { flex: 1; font-size: 0.9rem; }
.toast-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-tertiary); line-height: 1; }

/* ============================================================================
   14. SKELETON-LOADER & SPINNER & EMPTY STATE
   ========================================================================== */
.skeleton-loader { display: flex; flex-direction: column; gap: 0.8rem; }
.skeleton-card {
    height: 84px; border-radius: var(--radius-md);
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 4rem 1.5rem; color: var(--text-secondary); }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.8; }
.empty-state h2 { margin-bottom: 0.5rem; color: var(--text-primary); }
.empty-state p { margin-bottom: 1.5rem; }

.offline-banner {
    position: sticky; top: 0; z-index: 200;
    padding: 0.7rem 1.5rem; text-align: center; font-size: 0.9rem; font-weight: 500;
    background: var(--warning); color: #1b1f33;
}
.offline-banner[hidden] { display: none; }

/* ============================================================================
   15. COOKIE-BANNER
   ========================================================================== */
.cookie-banner {
    position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1500;
    margin: 0 auto; max-width: 640px;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 1.3rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    transform: translateY(140%); opacity: 0;
    transition: transform var(--transition-slow), opacity var(--transition-slow);
}
.cookie-banner.cookie-visible { transform: translateY(0); opacity: 1; }
.cookie-text { flex: 1; min-width: 220px; font-size: 0.86rem; color: var(--text-secondary); line-height: 1.5; }
.cookie-actions { display: flex; gap: 0.6rem; }

/* ============================================================================
   16. IMPRESSUM
   ========================================================================== */
.legal-page {
    display: flex; align-items: flex-start; justify-content: center;
    min-height: 100vh; padding: 3rem 1.5rem;
}
.legal-card { width: 100%; max-width: 620px; padding: 2.5rem; }
.legal-card h1 { margin-bottom: 1.5rem; }
.legal-card h2 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }
.legal-card p { color: var(--text-secondary); margin-bottom: 0.3rem; }
.legal-card a { font-weight: 500; }
.legal-back { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 2rem; font-weight: 600; }

/* ============================================================================
   18. PROGRESS-RING (Apple-Watch-Stil)
   ========================================================================== */
.progress-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.4rem 1.6rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
}
.ring-wrap { position: relative; flex-shrink: 0; width: 120px; height: 120px; }
.progress-ring { transform: rotate(-90deg); }
.ring-bg {
    fill: none;
    stroke: var(--surface-2);
    stroke-width: 11;
}
.ring-fg {
    fill: none;
    stroke: url(#ringGradient);
    stroke-width: 11;
    stroke-linecap: round;
    stroke-dasharray: 326.7;          /* 2πr, r=52 */
    stroke-dashoffset: 326.7;         /* startet leer; JS füllt */
    transition: stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 6px rgba(168, 92, 255, 0.4));
}
.ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.ring-label span { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.ring-label small { font-size: 0.72rem; color: var(--text-secondary); }
.progress-text h2 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.progress-text p { color: var(--text-secondary); font-size: 0.92rem; }

/* ============================================================================
   19. KI-SCHÄTZUNG & GETEILTE TODOS
   ========================================================================== */
.estimate-wrapper { display: flex; gap: 0.6rem; align-items: stretch; }
.estimate-wrapper input { flex: 1; }
.estimate-wrapper .btn { white-space: nowrap; flex-shrink: 0; }

.badge-estimate { background: rgba(168, 92, 255, 0.16); color: var(--accent); }
.badge-shared { background: rgba(110, 168, 255, 0.16); color: var(--info); }

.shared-with-list { margin: 0.5rem 0 0.5rem; }
.shared-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.6rem; padding: 0.45rem 0.7rem; margin-top: 0.4rem;
    background: var(--surface-2); border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.shared-row .icon-btn { width: 28px; height: 28px; font-size: 0.85rem; }

/* ============================================================================
   20. HAPTIK & DRAG-PHYSIK (Mikroanimationen)
   ========================================================================== */
/* Sanftes „Aufpoppen" für haptisches Feedback. */
.haptic-pop { animation: haptic-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes haptic-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* „Flüssige" Drag-Physik: angehobene, leicht gekippte Karte beim Ziehen. */
.todo-card {
    transition: transform var(--transition), box-shadow var(--transition),
                opacity var(--transition);
    will-change: transform;
}
.todo-card.dragging {
    transform: scale(1.03) rotate(-0.6deg);
    box-shadow: var(--shadow-lg);
    opacity: 0.92;
    cursor: grabbing;
}
.todo-card.drag-over {
    transform: translateY(4px);
    box-shadow: 0 0 0 2px var(--accent);
}

/* ============================================================================
   21. CONFETTI
   ========================================================================== */
.confetti-container {
    position: fixed; inset: 0; z-index: 3000;
    pointer-events: none; overflow: hidden;
}
.confetti-piece {
    position: absolute;
    width: 9px; height: 9px;
    border-radius: 2px;
    opacity: 0;
    animation: confetti-fly 1.1s ease-out forwards;
}
@keyframes confetti-fly {
    0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
    100% {
        opacity: 0;
        transform: translate(var(--dx), calc(var(--dy) + 220px)) rotate(var(--rot)) scale(0.8);
    }
}

/* ============================================================================
   17. RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
    h1 { font-size: 1.5rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-controls { justify-content: space-between; }
    .filters { flex-direction: column; align-items: stretch; }
    .filter-selects { width: 100%; }
    .filter-selects .select { flex: 1; }
    .dashboard-header { flex-wrap: wrap; gap: 0.6rem; padding: 0.8rem 1rem; }
    .user-email { max-width: 110px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 1.55rem; }
    .auth-card { padding: 1.8rem 1.4rem; }
    .legal-card { padding: 1.8rem 1.4rem; }
    .toast-container { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
    .todo-card { padding: 0.9rem 1rem; }
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-actions { justify-content: center; }
    .progress-hero { flex-direction: column; text-align: center; }
    .estimate-wrapper { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
