/* ===================================
   MedienAchtsamkeits-Vertrag
   MIMIKAMA 2026 FARBPALETTE
   - Gedämpfte, warme Farben
   - Besserer Dark Mode
   - Weißes Logo im Dark Mode
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* === MIMIKAMA 2026 FARBPALETTE === */
  /* Warnfarben (Akzent) */
  --primary: #9B4A4A;
  --primary-hover: #7A3535;
  
  /* Strukturfarben */
  --secondary: #4D5C66;
  --secondary-light: #3F5F63;
  
  /* Grundfarben */
  --bg: #F4F3EF;
  --bg-card: #FFFFFF;
  
  /* Text */
  --text: #4D5C66;
  --text-muted: #6B8FA3;
  
  /* Akzentfarben */
  --success: #7A9A8B;
  --success-bg: #E8F0EC;
  --danger: #B36A2E;
  
  /* Grundfarben */
  --border: #D1CEC6;
  
  /* Layout */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 8px rgba(77, 92, 102, 0.08);
  --shadow-md: 0 4px 12px rgba(77, 92, 102, 0.10);
  --shadow-lg: 0 8px 24px rgba(77, 92, 102, 0.14);
  --sidebar-width: 260px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --bg: #1A1A18;
  --bg-card: #242420;
  --text: #F4F3EF;
  --text-muted: #A0A5A3;
  --border: #3A3A36;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ===================================
   ACCESSIBILITY
   =================================== */

/* Skip Link für Screenreader */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 10px;
}

/* Globale Focus-Visible Styles */
*:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Buttons mit besserem Focus */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Focus für dunklen Hintergrund */
[data-theme="dark"] *:focus-visible {
  outline-color: #8AACBE;
}

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

/* Touch Targets (minimum 44x44px) */
@media (pointer: coarse) {
  button,
  a,
  input[type="checkbox"],
  input[type="radio"],
  .close-btn,
  .tile,
  .rule-toggle {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Footer Links mit mehr Abstand */
  .landing-footer nav,
  .main-footer {
    gap: 16px;
  }
  
  .landing-footer nav a,
  .main-footer a {
    padding: 8px 4px;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.is-hidden {
  display: none !important;
}

/* ===================================
   LANDING PAGE
   =================================== */

.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Landing Header */
.landing-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  /* Full-Width Header wie SM-Führerschein */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
}

[data-theme="dark"] .landing-header {
  background: var(--bg-card);
}

.header-inner {
  /* Wrapper unsichtbar machen - Kinder werden vom Header-Flexbox gesteuert */
  display: contents;
}

.logo {
  height: 36px;
}

/* Dark Mode: Logos werden per JS gewechselt */

.header-controls {
  display: flex;
  gap: 8px;
}

.ctrl-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctrl-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ctrl-btn.lang-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

[data-theme="dark"] .ctrl-btn.lang-btn.active {
  background: var(--primary);
  border-color: var(--primary);
}

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--secondary) 0%, var(--secondary-light) 100%);
  padding: 70px 24px 80px;
  text-align: center;
  color: white;
}

[data-theme="dark"] .hero {
  background: linear-gradient(180deg, #1A1A18 0%, #2A2A26 100%);
}

.hero-content {
  max-width: 640px;
  margin: 0 auto;
}

.hero-mascot {
  width: 260px;
  height: 260px;
  margin: 0 auto 32px auto;
  display: block;
  object-fit: contain;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.25));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  margin-bottom: 14px;
  /* Wortumbruch für lange Wörter */
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.hero-subtitle {
  font-size: 19px;
  opacity: 0.95;
  margin-bottom: 36px;
}

.btn-hero {
  background: var(--primary);
  color: white;
  border: none;
  padding: 18px 52px;
  border-radius: 100px;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-hero:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(183, 24, 24, 0.35);
}

/* How It Works */
.how-it-works {
  padding: 70px 24px;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}

.section-badge {
  display: inline-block;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}

.how-it-works h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 52px;
  color: var(--text);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 700px) {
  .steps-grid {
    grid-template-columns: 1fr;
    max-width: 340px;
    margin: 0 auto;
  }
}

.step-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px 28px;
  padding-top: 52px;
  position: relative;
  box-shadow: var(--shadow-md);
}

.step-num {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 18px;
}

.step-card h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.step-card p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* CTA Section */
.cta-section {
  background: var(--secondary);
  color: white;
  padding: 70px 24px;
  text-align: center;
}

[data-theme="dark"] .cta-section {
  background: #1A1A18;
}

.cta-section h2 {
  font-size: 1.75rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.cta-section p {
  opacity: 0.92;
  margin-bottom: 28px;
  font-size: 17px;
}

.btn-cta {
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px 44px;
  border-radius: 100px;
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Landing Footer */
.landing-footer {
  background: #2A2A26;
  color: white;
  padding: 28px;
  text-align: center;
  margin-top: auto;
}

.landing-footer p {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 10px;
}

.landing-footer nav {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.landing-footer a {
  color: white;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.85;
}

.landing-footer a:hover {
  opacity: 1;
}

/* ===================================
   APP LAYOUT
   =================================== */

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* Mobile Header - versteckt auf Desktop */
.mobile-header {
  display: none;
}

@media (max-width: 960px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: none !important;
  }
  
  /* Mobile Header */
  .mobile-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  
  .mobile-branding {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .mobile-logo {
    height: 32px;
    width: auto;
    margin-bottom: 4px;
    object-fit: contain;  /* Seitenverhältnis erhalten */
    flex-shrink: 0;       /* Nicht schrumpfen im Flex-Container */
  }
  
  .mobile-subtitle {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.3;
    margin: 0;
  }
  
  .mobile-subtitle strong {
    color: var(--primary);
  }
  
  .mobile-subtitle-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0;
  }
  
  .mobile-header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  
  .lang-btn-small {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-bottom: 100px;
  }
  
  .top-bar {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  
  .greeting {
    justify-content: center;
  }
  
  .top-stats {
    justify-content: center;
  }
  
  .content-area {
    padding: 0;
  }
  
  .section-header h2 {
    font-size: 20px;
  }
  
  .module-tile {
    padding: 14px;
  }
  
  .tile-icon {
    width: 48px;
    height: 48px;
  }
  
  .tile-ico {
    width: 40px;
    height: 40px;
  }
  
  .tile-title {
    font-size: 15px;
  }
  
  .tile-sub, .tile-count {
    font-size: 12px;
  }
  
  .step-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .step-actions .btn {
    width: 100%;
  }
  
  .counter {
    text-align: center;
  }
  
  /* Contract Cards auf Mobile */
  .contracts-grid {
    grid-template-columns: 1fr;
  }
  
  /* Regel-Liste auf Mobile */
  .rule-item {
    padding: 14px;
  }
  
  /* Hide Preview Sidebar Content on Mobile */
  .preview-content {
    display: none !important;
  }
  
  .sidebar-selected {
    display: none !important;
  }
  
  .preview-label {
    display: none !important;
  }
  
  .preview-list {
    display: none !important;
  }
}

/* Sidebar */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  height: 36px;
  width: auto;
  margin-bottom: 10px;
}

.sidebar-subtitle {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
}

.sidebar-subtitle strong {
  color: var(--primary);
}

.branding-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.sidebar-subtitle-small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

[data-theme="dark"] .sidebar-subtitle,
[data-theme="dark"] .sidebar-subtitle strong {
  color: var(--text-muted);
}

/* Sidebar Nav */
.sidebar-nav {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 15.2px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* Sidebar Preview */
.sidebar-preview {
  flex: 1;
  padding: 18px;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}

.preview-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-empty {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

.preview-item {
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

[data-theme="dark"] .preview-item {
  background: var(--border);
}

.preview-cat {
  font-weight: 800;
  color: var(--secondary);
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

[data-theme="dark"] .preview-cat {
  color: #8AACBE;
}

.preview-rule {
  color: var(--text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px;
}

.toggle-btn {
  flex: 1;
  max-width: 80px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.toggle-btn.lang-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

[data-theme="dark"] .toggle-btn {
  background: #4D5C66;
  border-color: #4D5C66;
  color: var(--text-muted);
}

[data-theme="dark"] .toggle-btn:hover {
  border-color: #6B7A7D;
  color: var(--text);
}

[data-theme="dark"] .toggle-btn.lang-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.sidebar-legal {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.sidebar-legal a {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.sidebar-legal a:hover {
  color: var(--primary);
}

.legal-divider {
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 0.7rem;
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* Top Bar */
.top-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

[data-theme="dark"] .top-bar {
  background: var(--bg-card);
}

.greeting {
  display: flex;
  align-items: center;
  gap: 14px;
}

.greeting-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.greeting-text strong {
  display: block;
  font-size: 20.8px;
  font-weight: 800;
}

.greeting-text span {
  font-size: 15.2px;
  color: var(--text-muted);
}

.top-stats {
  display: flex;
  gap: 14px;
}

.stat-box {
  background: var(--bg);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  text-align: center;
  min-width: 80px;
}

[data-theme="dark"] .stat-box {
  background: var(--border);
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--secondary);
}

[data-theme="dark"] .stat-value {
  color: #8AACBE;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 28px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

/* Motivation Banner */
.motivation-banner {
  background: var(--success);
  color: white;
  padding: 16px 22px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.moti-icon {
  font-size: 1.4rem;
}

.moti-text {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
}

.moti-cta {
  background: rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 800;
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 36px;
}

.section-header.small {
  margin-bottom: 28px;
}

.section-mascot {
  width: 120px;
  height: 120px;
  margin-bottom: 20px;
  object-fit: contain;
}

.section-mascot-small {
  width: 120px;
  height: 120px;
  margin-bottom: 16px;
  object-fit: contain;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 8px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-muted);
}

.content-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}

/* Steps */
.step {
  animation: fadeIn 0.2s ease;
}

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

/* Contracts Grid */
.contracts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.contract-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  transition: all 0.15s;
  position: relative;
}

.contract-card:hover {
  border-color: var(--secondary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .contract-card:hover {
  border-color: #8AACBE;
}

.contract-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.contract-icon img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.contract-name {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}

.contract-meta {
  font-size: 14px;
  color: var(--text-muted);
}

.contract-progress {
  height: 5px;
  background: var(--bg);
  border-radius: 100px;
  margin-top: 14px;
  overflow: hidden;
}

[data-theme="dark"] .contract-progress {
  background: var(--border);
}

.contract-progress-fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s;
}

.contract-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
}

.contract-card:hover .contract-delete {
  opacity: 1;
}

.contract-delete:hover {
  background: var(--danger);
  color: white;
}

/* Empty State */
.empty-state-container {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state-text h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.empty-state-text p {
  font-size: 15px;
  color: var(--text-muted);
}

/* New Contract Button */
.new-contract-btn {
  width: 100%;
  padding: 28px;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
}

.new-contract-btn:hover {
  border-color: var(--primary);
  background: rgba(183, 24, 24, 0.04);
}

.plus-icon {
  width: 52px;
  height: 52px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 400;
}

[data-theme="dark"] .plus-icon {
  background: var(--border);
}

/* Form */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 520px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 14px;
  font-weight: 800;
}

.form-field input,
.form-field select {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.15s;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--secondary);
}

[data-theme="dark"] .form-field input,
[data-theme="dark"] .form-field select {
  background: var(--bg);
}

.form-field input::placeholder {
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  justify-content: space-between;
}

/* Module List / Tiles */
.module-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.tile-wrapper {
  position: relative;
}

.tile {
  width: 100%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  text-align: left;
  box-shadow: var(--shadow);
  transition: all 0.15s;
}

.tile:hover {
  border-color: var(--secondary);
  transform: translateX(4px);
}

[data-theme="dark"] .tile:hover {
  border-color: #8AACBE;
}

.tile.is-active {
  border-color: var(--secondary);
  background: rgba(77, 92, 102, 0.04);
}

[data-theme="dark"] .tile.is-active {
  background: rgba(96, 165, 250, 0.1);
  border-color: #8AACBE;
}

.tile-icon {
  width: 64px;
  height: 64px;
  background: transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tile-ico {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.tile-text {
  flex: 1;
  min-width: 0;
}

.tile-title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.tile-sub {
  display: block;
  font-size: 13.6px;
  color: var(--text-muted);
}

.tile-count {
  display: block;
  font-size: 13.6px;
  color: var(--text-muted);
  margin-top: 3px;
}

.badge {
  min-width: 30px;
  height: 30px;
  background: var(--primary);
  color: white;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.tile-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: all 0.15s;
}

.tile:hover .tile-arrow {
  color: var(--secondary);
  transform: translateX(3px);
}

[data-theme="dark"] .tile:hover .tile-arrow {
  color: #8AACBE;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.btn.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.primary.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn.primary.danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
}

.btn.secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}

.btn.secondary:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

[data-theme="dark"] .btn.secondary:hover {
  border-color: #8AACBE;
  color: #8AACBE;
}

/* Step Actions */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.action-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.counter {
  padding: 12px 22px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 800;
}

/* Reminder Banner */
.reminder-banner {
  background: var(--success-bg);
  border: 2px solid var(--success);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

[data-theme="dark"] .reminder-banner {
  background: rgba(22, 163, 74, 0.15);
}

.reminder-icon {
  font-size: 1.75rem;
}

.reminder-text {
  flex: 1;
}

.reminder-text strong {
  display: block;
  color: var(--success);
  font-size: 15px;
}

.reminder-text small {
  color: var(--text-muted);
  font-size: 14px;
}

.dismiss-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--success);
  color: white;
  font-size: 16px;
  cursor: pointer;
}

/* Contract Article */
.contract-article {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meta-grid,
.contract-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--border);
}

@media (max-width: 520px) {
  .meta-grid,
  .contract-meta-grid {
    grid-template-columns: 1fr;
  }
}

.meta-item,
.contract-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-item .meta-label,
.contract-meta-item label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.meta-item span:not(.meta-label) {
  font-size: 16px;
  font-weight: 700;
}

.intro,
.contract-intro {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 12px;
}

.preamble,
.contract-preamble {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
  padding-left: 18px;
  border-left: 3px solid var(--secondary);
  margin-bottom: 18px;
}

[data-theme="dark"] .preamble,
[data-theme="dark"] .contract-preamble {
  border-left-color: #8AACBE;
}

.cat-block {
  margin-bottom: 32px;
}

.cat-head,
.cat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.cat-head img,
.cat-header img {
  width: 28px;
  height: 28px;
}

.cat-head h3,
.cat-head h4,
.cat-header h3,
.cat-header h4,
.cat-title {
  font-size: 18px;
  font-weight: 800;
}

.rule-list,
.rules-list {
  list-style: none;
}

.rule-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

[data-theme="dark"] .rule-item {
  background: var(--border);
}

.rule-item h5,
.rule-item .rule-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 5px;
  display: block;
}

.rule-item p,
.rule-item .rule-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  display: block;
}

/* Main Footer */
.main-footer {
  padding: 22px 28px;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.main-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}

.main-footer a:hover {
  color: var(--primary);
}

.main-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===================================
   MODALS
   =================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

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

/* Loading Modal */
.modal-loading {
  text-align: center;
  padding: 40px;
  max-width: 320px;
}

.modal-loading h3 {
  margin: 20px 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-loading p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  flex: 1;
}

.modal-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.legal-highlight {
  display: flex;
  gap: 12px;
  background: var(--success-bg, #E8F0EC);
  padding: 16px;
  border-radius: 12px;
  margin: 16px 0;
  align-items: flex-start;
}

.legal-highlight span {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.legal-highlight p {
  margin: 0;
  line-height: 1.5;
}

.legal-intro {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 20px;
}

.legal-warning {
  display: flex;
  gap: 12px;
  background: var(--warning-bg, #FEF3C7);
  padding: 16px;
  border-radius: 12px;
  margin: 20px 0;
  align-items: flex-start;
}

.legal-warning span {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.legal-warning p {
  margin: 0;
  line-height: 1.5;
}

[data-theme="dark"] .legal-warning {
  background: rgba(180, 106, 46, 0.15);
}

[data-theme="dark"] .legal-highlight {
  background: rgba(122, 154, 139, 0.15);
}

.close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.15s;
}

[data-theme="dark"] .close-btn {
  background: var(--border);
}

.close-btn:hover {
  background: var(--primary);
  color: white;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Rule Cards (in Modal) */
.rule-card {
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
  transition: all 0.15s;
}

[data-theme="dark"] .rule-card {
  background: var(--border);
}

.rule-card.selected,
.rule-card.is-selected {
  border-color: var(--secondary);
  background: rgba(77, 92, 102, 0.06);
}

[data-theme="dark"] .rule-card.selected,
[data-theme="dark"] .rule-card.is-selected {
  background: rgba(96, 165, 250, 0.12);
  border-color: #8AACBE;
}

.rule-content {
  flex: 1;
}

.rule-content .rule-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 5px;
}

.rule-content .rule-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

.rule-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.rule-toggle:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

[data-theme="dark"] .rule-toggle:hover {
  border-color: #8AACBE;
  color: #8AACBE;
}

.rule-card.selected .rule-toggle,
.rule-card.is-selected .rule-toggle {
  background: transparent;
  border-color: transparent;
  color: white;
}

[data-theme="dark"] .rule-card.selected .rule-toggle,
[data-theme="dark"] .rule-card.is-selected .rule-toggle {
  background: transparent;
  border-color: transparent;
}

/* Confirm Modal */
.modal-confirm {
  max-width: 400px;
  padding: 36px 28px;
  text-align: center;
}

.confirm-icon {
  font-size: 3.5rem;
  margin-bottom: 18px;
}

.modal-confirm h3 {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.modal-confirm p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Info Content */
.info-content {
  line-height: 1.7;
}

.info-content p {
  margin-bottom: 14px;
  font-size: 15px;
}

.info-content strong {
  color: var(--secondary);
}

[data-theme="dark"] .info-content strong {
  color: #8AACBE;
}

/* ===================================
   ONBOARDING
   =================================== */

.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.onboarding-modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  /* Overflow verhindern */
  overflow: hidden;
}

.onboarding-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-icon img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.onboarding-question {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 12px;
  /* Wortumbruch für lange Wörter */
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.onboarding-description {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 28px;
  /* Wortumbruch für lange Texte */
  word-break: break-word;
  overflow-wrap: break-word;
}

.onboarding-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.onboarding-btn {
  padding: 14px 28px;
  border-radius: 100px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid transparent;
}

.onboarding-btn-next {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.onboarding-btn-back {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}

.onboarding-checkbox-wrapper {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.onboarding-checkbox-wrapper input {
  margin-right: 8px;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 640px) {
  .hero-title {
    font-size: 1.9rem;
  }
  
  .hero-mascot {
    width: 130px;
    height: 130px;
  }
  
  .top-bar {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }
  
  .top-stats {
    width: 100%;
    justify-content: space-between;
  }
  
  .step-actions {
    flex-direction: column;
  }
  
  .step-actions .btn {
    width: 100%;
  }
  
  .action-btns {
    width: 100%;
    justify-content: center;
  }
  
  .counter {
    width: 100%;
    text-align: center;
  }
  
  .content-area {
    padding: 20px;
  }
  
  .contract-article {
    padding: 24px;
  }
}

/* ===================================
   PRINT
   =================================== */

@media print {
  .sidebar,
  .top-bar,
  .motivation-banner,
  .step-actions,
  .reminder-banner,
  .main-footer,
  .mobile-nav {
    display: none !important;
  }
  
  .app-layout {
    grid-template-columns: 1fr;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .contract-article {
    box-shadow: none;
    padding: 0;
  }
  
  .rule-item {
    background: #f5f5f5;
  }
}

/* Alert Modal */
.modal-alert {
  max-width: 380px;
  padding: 36px 28px;
  text-align: center;
}

.alert-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.alert-icon img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.modal-alert h3 {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.modal-alert p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-alert .btn {
  min-width: 120px;
}

/* Achievement Badge */
.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  padding: 10px 18px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(255, 165, 0, 0.4);
  animation: achievementPop 0.4s ease-out;
  transition: opacity 0.3s;
}

.achievement-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

@keyframes achievementPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Checkbox Icons */
.checkbox-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform 0.2s ease, opacity 0.2s ease;
  /* Keine Filter - Icons werden direkt verwendet */
}

.checkbox-icon.checked {
  /* Grünes Icon wird direkt angezeigt */
}

.rule-toggle,
.btn-add {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.rule-toggle:hover .checkbox-icon:not(.checked),
.btn-add:hover .checkbox-icon:not(.checked) {
  opacity: 0.8;
  transform: scale(1.05);
}

/* Tip Icons (Onboarding) */
.tip-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
}

.tip-item {
  display: block;
  margin-bottom: 8px;
}

.onboarding-description .tip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}

.onboarding-description .tip-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* ===================================
   MASCOT STYLES
   =================================== */

.step-mascot {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin: 0 auto 14px auto;
  display: block;
}

.cta-mascot {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 0 auto 24px auto;
  display: block;
}

.section-mascot-small {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 12px auto;
  display: block;
}

/* Greeting Avatar */
.greeting-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===================================
   MOBILE BOTTOM NAVIGATION
   =================================== */

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

@media (max-width: 960px) {
  /* Show Mobile Nav */
  .mobile-nav {
    display: flex;
    justify-content: space-around;
  }
  
  /* Hide Desktop Sidebar completely */
  .sidebar {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
  }
  
  /* Fix Layout */
  .app-layout {
    grid-template-columns: 1fr !important;
    display: block !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding: 16px;
    padding-bottom: 100px;
  }
  
  .main-footer {
    margin-bottom: 80px;
  }
  
  /* Top Bar Mobile */
  .top-bar {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  
  .greeting {
    justify-content: center;
  }
  
  .top-stats {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  /* Section Headers */
  .section-header h2 {
    font-size: 20px;
    text-align: center;
  }
  
  .section-header p {
    text-align: center;
  }
  
  /* Tiles smaller on mobile */
  .tile-icon {
    width: 48px;
    height: 48px;
  }
  
  .tile-ico {
    width: 40px;
    height: 40px;
  }
  
  /* Contract cards single column */
  .contracts-grid {
    grid-template-columns: 1fr;
  }
  
  /* Buttons full width */
  .step-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .step-actions .btn {
    width: 100%;
  }
}

/* Adjust step card for mascot images */
.step-card {
  padding-top: 48px;
}

.step-card .step-mascot {
  margin-bottom: 8px;
}

/* ===================================
   FLATPICKR CUSTOM THEME
   =================================== */

.flatpickr-calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  font-family: 'Nunito', sans-serif;
  padding: 8px;
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
  border-bottom-color: var(--bg-card);
}

.flatpickr-months {
  padding: 8px 0;
}

.flatpickr-months .flatpickr-month {
  background: transparent;
  color: var(--text);
  fill: var(--text);
}

.flatpickr-current-month {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--secondary);
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: transparent;
  font-weight: 800;
  color: var(--secondary);
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  fill: var(--secondary);
  color: var(--secondary);
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  fill: var(--primary);
  color: var(--primary);
}

.flatpickr-weekdays {
  background: transparent;
}

.flatpickr-weekday {
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.flatpickr-days {
  border: none;
}

.flatpickr-day {
  color: var(--text);
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.15s;
}

.flatpickr-day:hover {
  background: var(--bg);
  border-color: var(--border);
}

.flatpickr-day.today {
  border-color: var(--secondary);
  background: rgba(77, 92, 102, 0.1);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 800;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--text-muted);
  opacity: 0.5;
}

.flatpickr-day.disabled {
  color: var(--text-muted);
  opacity: 0.3;
}

/* Input Styling */
.flatpickr-input {
  cursor: pointer;
}

.flatpickr-input + .form-field input[readonly] {
  background: var(--bg-card);
}

/* Dark Mode */
[data-theme="dark"] .flatpickr-calendar {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .flatpickr-day {
  color: var(--text);
}

[data-theme="dark"] .flatpickr-day:hover {
  background: var(--bg);
}

[data-theme="dark"] .flatpickr-day.today {
  background: rgba(183, 24, 24, 0.2);
  border-color: var(--primary);
}

/* ===================================
   PRINT STYLESHEET
   =================================== */

@media print {
  /* Verstecke Navigation und UI-Elemente */
  .sidebar,
  .mobile-header,
  .mobile-nav,
  .top-bar,
  .landing-page,
  .modal,
  .step-actions,
  .btn,
  .motivation-banner,
  .main-footer,
  #step0,
  #step1,
  #step2,
  .nav-item,
  .ctrl-btn,
  .lang-btn {
    display: none !important;
  }
  
  /* App-Layout für Print anpassen */
  .app-layout {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .content-area {
    padding: 0 !important;
  }
  
  /* Vertrag für Print optimieren */
  #step3 {
    display: block !important;
    padding: 0 !important;
  }
  
  .contract-article {
    background: white !important;
    box-shadow: none !important;
    border: none !important;
    padding: 20px !important;
    margin: 0 !important;
    font-size: 11pt !important;
    line-height: 1.4 !important;
  }
  
  .contract-article h1,
  .contract-article h2,
  .contract-article h3 {
    page-break-after: avoid;
  }
  
  .contract-article .rule-item,
  .contract-article .category-section {
    page-break-inside: avoid;
  }
  
  /* Farben für Print */
  body {
    background: white !important;
    color: black !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Links ohne URL anzeigen */
  a[href]:after {
    content: none !important;
  }
  
  /* Seitenränder */
  @page {
    margin: 15mm;
    size: A4;
  }
  
  /* Erste Seite */
  @page :first {
    margin-top: 10mm;
  }
  
  /* Verstecke is-hidden Klasse nicht im Print für Vertrag */
  #step3.is-hidden {
    display: block !important;
  }
  
  /* Section Header im Print */
  .section-header {
    margin-bottom: 15px !important;
  }
  
  .section-mascot-small {
    display: none !important;
  }
}

/* ===================================
   CUSTOM RULES
   =================================== */

.add-custom-rule-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(22, 163, 74, 0.05));
  border: 2px dashed var(--success);
  border-radius: var(--radius);
  color: var(--success);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-custom-rule-btn:hover {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.15), rgba(22, 163, 74, 0.1));
  transform: translateY(-1px);
}

.add-custom-rule-btn .add-icon {
  font-size: 18px;
}

/* Custom Rule Card */
.rule-card.custom-rule {
  background: linear-gradient(135deg, var(--success-bg), rgba(22, 163, 74, 0.05));
  border-left: 4px solid var(--success);
}

.rule-card.custom-rule .custom-badge {
  margin-right: 6px;
}

.rule-card.custom-rule .delete-custom {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.rule-card.custom-rule .delete-custom:hover {
  opacity: 1;
}

.delete-icon {
  font-size: 18px;
}

/* Custom Rule Modal */
.custom-rule-modal .modal-body {
  padding: 20px;
}

.custom-rule-info {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
}

.custom-rule-info strong {
  color: var(--text);
}

.custom-rule-modal .form-field {
  margin-bottom: 16px;
}

.custom-rule-modal .form-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
}

.custom-rule-modal .form-field input,
.custom-rule-modal .form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s;
}

.custom-rule-modal .form-field input:focus,
.custom-rule-modal .form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.custom-rule-modal .form-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* ===================================
   SIGNATURE SECTION
   =================================== */

.signature-section {
  margin-top: 24px;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.signature-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.signature-info {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .signature-grid {
    grid-template-columns: 1fr;
  }
}

.signature-box {
  display: flex;
  flex-direction: column;
}

.signature-box label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.signature-canvas-wrapper {
  position: relative;
  background: #FFFFFF;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.signature-canvas {
  width: 100%;
  height: 120px;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

[data-theme="dark"] .signature-canvas-wrapper {
  background: #1a2a35;
}

[data-theme="dark"] .signature-canvas {
  filter: invert(0);
}

.clear-signature-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.clear-signature-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

/* Signature Helper Text */
.signature-canvas-wrapper::after {
  content: '✍️ Hier unterschreiben';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.5;
  pointer-events: none;
}

.signature-canvas-wrapper:has(canvas.has-signature)::after {
  display: none;
}

/* Custom Rules in Contract Preview */
.rule-item.custom-rule-item {
  background: linear-gradient(135deg, var(--success-bg), rgba(22, 163, 74, 0.05));
  border-left: 3px solid var(--success);
  padding-left: 12px;
  margin-left: -12px;
}

.custom-star {
  color: var(--success);
  margin-right: 4px;
  font-size: 14px;
}

/* Impressum Modal */
.modal-large {
  max-width: 600px;
  max-height: 85vh;
}

.impressum-content {
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px;
}

.impressum-content h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--secondary);
  margin: 20px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.impressum-content h4:first-child {
  margin-top: 0;
}

.impressum-content p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  color: var(--text);
}

.impressum-content ul {
  margin: 0 0 12px 0;
  padding-left: 20px;
}

.impressum-content li {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 4px;
}

.impressum-content a {
  color: var(--primary);
  text-decoration: none;
}

.impressum-content a:hover {
  text-decoration: underline;
}

.impressum-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ===================================
   MOBILE RESPONSIVE FIXES
   Zusätzliche Breakpoints für kleine Screens
   =================================== */

/* ----- Safe Area Insets ----- */
.mobile-header {
  padding-top: calc(12px + env(safe-area-inset-top, 0));
}

/* ----- 500px Breakpoint - Tablets/große Phones ----- */
@media (max-width: 500px) {
  /* Onboarding Modal */
  .onboarding-overlay {
    padding: 12px;
  }
  
  .onboarding-modal {
    padding: 24px 20px;
    margin: 12px;
    max-width: calc(100% - 24px);
  }
  
  .onboarding-question {
    font-size: 1.1rem;
  }
  
  .onboarding-description {
    font-size: 14px;
  }
  
  .onboarding-icon {
    width: 80px;
    height: 80px;
  }
  
  .onboarding-icon img {
    width: 80px;
    height: 80px;
  }
}

/* ----- 480px Breakpoint - Standard Phones ----- */
@media (max-width: 480px) {
  /* Hero Section */
  .hero {
    padding: 50px 20px 60px;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
  
  .hero-mascot {
    width: 120px;
    height: 120px;
  }
  
  .btn-hero {
    padding: 14px 36px;
    font-size: 16px;
    width: 100%;
    max-width: 280px;
  }
  
  /* Content Area */
  .content-area {
    padding: 16px;
  }
  
  .section-header {
    margin-bottom: 24px;
  }
  
  .section-mascot, 
  .section-mascot-small {
    width: 80px;
    height: 80px;
  }
  
  /* Action Buttons */
  .action-btns {
    flex-direction: column;
    width: 100%;
  }
  
  .action-btns .btn {
    width: 100%;
  }
  
  .step-actions {
    gap: 10px;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  /* Modals */
  .modal {
    padding: 12px;
    align-items: flex-end;
  }
  
  .modal-box {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: 0;
  }
  
  .modal-header {
    padding: 16px 18px;
  }
  
  .modal-body {
    padding: 18px;
  }
  
  .modal-footer {
    padding: 14px 18px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
  }
}

/* ----- 400px Breakpoint - Kleine Phones ----- */
@media (max-width: 400px) {
  /* Hero Section */
  .hero {
    padding: 40px 16px 50px;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-subtitle {
    font-size: 15px;
  }
  
  .hero-mascot {
    width: 100px;
    height: 100px;
  }
  
  .hero-badge {
    font-size: 12px;
    padding: 6px 16px;
  }
  
  /* Tiles */
  .tile {
    padding: 12px 14px;
    gap: 12px;
  }
  
  .tile-icon {
    width: 40px;
    height: 40px;
  }
  
  .tile-ico {
    width: 34px;
    height: 34px;
  }
  
  .tile-title {
    font-size: 14px;
  }
  
  .tile-sub, 
  .tile-count {
    font-size: 11px;
  }
  
  .badge {
    min-width: 24px;
    height: 24px;
    font-size: 12px;
    padding: 0 8px;
  }
  
  /* Modal Headers */
  .modal-header h3 {
    font-size: 1.05rem;
  }
  
  /* Rule Cards */
  .rule-card {
    padding: 12px;
    gap: 10px;
  }
  
  .rule-content .rule-title {
    font-size: 14px;
  }
  
  .rule-content .rule-desc {
    font-size: 13px;
  }
  
  /* Signature Section */
  .signature-section {
    padding: 16px;
    margin-top: 16px;
  }
  
  .signature-title {
    font-size: 16px;
  }
  
  .signature-info {
    font-size: 13px;
  }
  
  .signature-canvas {
    height: 100px;
  }
  
  .clear-signature-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  /* Contract Article */
  .contract-article {
    padding: 16px;
  }
  
  .contract-article h1 {
    font-size: 1.3rem;
  }
  
  .contract-article h2 {
    font-size: 1.1rem;
  }
}

/* ----- 380px Breakpoint - Sehr kleine Phones ----- */
@media (max-width: 380px) {
  /* Mobile Header Branding */
  .mobile-branding {
    max-width: 70%;  /* Mehr Platz für Logo */
  }
  
  .mobile-logo {
    height: 28px;    /* Etwas kleiner auf sehr kleinen Screens */
  }
  
  .mobile-subtitle {
    font-size: 0.75rem;
  }
  
  .mobile-subtitle-small {
    display: none;
  }
  
  /* Onboarding */
  .onboarding-modal {
    padding: 20px 16px;
  }
  
  .onboarding-question {
    font-size: 1rem;
  }
  
  .onboarding-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .onboarding-btn {
    width: 100%;
  }
  
  /* How It Works Steps */
  .step-card {
    padding: 30px 20px;
    padding-top: 45px;
  }
  
  .step-card h3 {
    font-size: 16px;
  }
  
  .step-card p {
    font-size: 14px;
  }
}

/* ----- 360px Breakpoint - Minimale Screens ----- */
@media (max-width: 360px) {
  .content-area {
    padding: 12px;
  }
  
  .main-content {
    padding: 12px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0));
  }
  
  .hero-title {
    font-size: 1.35rem;
  }
  
  .btn-hero {
    padding: 12px 28px;
    font-size: 15px;
  }
  
  .cta-section h2 {
    font-size: 1.4rem;
  }
  
  .cta-section p {
    font-size: 15px;
  }
  
  .btn-cta {
    padding: 14px 32px;
    font-size: 15px;
  }
}

/* ----- Landing Footer Safe Area ----- */
@media (max-width: 960px) {
  .landing-footer {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0));
  }
}