/* ==========================================================================
   Bankenvergleich Österreich – Modernes FinTech Design System
   Mobile-First, PWA-optimiert, 100% ohne externe CDNs / Google Fonts
   ========================================================================== */

:root {
  --bg-main: #0b1120;
  --bg-card: #131d31;
  --bg-card-hover: #1a2640;
  --bg-surface: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-primary: #10b981;      /* Emerald Green */
  --color-primary-hover: #059669;
  --color-accent: #0284c7;       /* Deep Sky */
  --color-warning: #f59e0b;      /* Amber */
  --color-danger: #ef4444;       /* Rose Red */
  --color-at-red: #dc2626;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.5);

  --touch-target: 46px; /* Mindesthöhe für Touch nach Standards */
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: #34d399;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.site-header {
  background-color: rgba(11, 17, 32, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-main);
}
.brand-logo svg, .brand-logo img {
  width: 36px;
  height: 36px;
}
.brand-flag {
  display: inline-block;
  background: var(--color-at-red);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  margin-left: 4px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.nav-item a:hover, .nav-item a.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}
.nav-item a.active {
  border-bottom: 2px solid var(--color-primary);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding: 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  color: #fff;
}
.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  color: #fff;
}
.btn-danger {
  background-color: var(--color-danger);
  color: #fff;
}
.btn-sm {
  min-height: 36px;
  padding: 0 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Hero Section */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero h1 span {
  background: linear-gradient(135deg, #10b981, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 680px;
  margin: 0 auto 2rem;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: left;
}
.kpi-title {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
}
.kpi-sub {
  font-size: 0.8rem;
  color: var(--color-primary);
  margin-top: 0.25rem;
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-link {
  min-height: var(--touch-target);
  padding: 0 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  background-color: transparent;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.tab-link.active {
  background-color: var(--bg-surface);
  color: #fff;
  border: 1px solid var(--border-color);
}

/* Filter Bar & Rechner Controls */
.calculator-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}
.calculator-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  align-items: center;
}
.calc-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.calc-field .slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.slider-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}
input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-surface);
  outline: none;
  appearance: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-tax-simple {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-tax-manual {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-flag-at {
  background-color: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Product Cards & List */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.25s ease;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.product-card:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.product-card.featured {
  border-left: 4px solid var(--color-primary);
}

.product-main {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.bank-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.product-info h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}
.product-bank-name {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.product-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.highlight-pill {
  background-color: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-metrics {
  display: flex;
  align-items: center;
  gap: 2rem;
  text-align: right;
}
.metric-box {
  min-width: 120px;
}
.metric-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.metric-val-big {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary);
}
.metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Chatbot Floating Drawer */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #0284c7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  z-index: 99;
  border: none;
  transition: transform 0.2s ease;
}
.chat-fab:hover {
  transform: scale(1.08);
}
.chat-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-at-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-main);
}

.chat-drawer {
  position: fixed;
  bottom: 95px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}
.chat-drawer.open {
  display: flex;
}

.chat-header {
  padding: 1rem 1.25rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header h4 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chat-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chat-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}
.chat-bubble.assistant {
  align-self: flex-start;
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}
.chat-bubble.user {
  align-self: flex-end;
  background-color: var(--color-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-chips {
  padding: 0.5rem 1rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.1);
}
.chip-btn {
  white-space: nowrap;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
}
.chip-btn:hover {
  color: #fff;
  border-color: var(--color-primary);
}

.chat-input-bar {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}
.chat-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}
.chat-input:focus {
  border-color: var(--color-primary);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Forms & Tables (Admin & Auth) */
.form-card {
  max-width: 480px;
  margin: 3rem auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}
.form-control {
  width: 100%;
  min-height: var(--touch-target);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 0.85rem;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
}
.form-control:focus {
  border-color: var(--color-primary);
}

.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.alert-success { background-color: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.alert-danger { background-color: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.data-table th {
  background-color: var(--bg-surface);
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .product-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .product-metrics {
    text-align: left;
    justify-content: space-between;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }
  .chat-drawer {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .nav-menu {
    display: none; /* Auf kleinen Screens vereinfacht */
  }
}
