/**
 * Altersvorsorgedepot-Rechner: Komponenten-Styles (alles unter .avd gescoped)
 * Läuft zusammen mit /css/style.css; die Design-Tokens sind hier lokal gesetzt.
 */

.avd {
  --color-primary: #14284c;
  --color-primary-hover: #0f1f3a;
  --color-primary-light: #e8ecf2;
  --color-primary-50: #f0f3f8;
  --color-accent: #1d4ed8;
  --color-accent-hover: #1e40af;
  --color-success: #059669;
  --color-success-light: #d1fae5;
  --color-danger: #dc2626;
  --color-danger-light: #fee2e2;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-text: #1e293b;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --font-family: var(--font-sans);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --transition: 200ms ease;
  --transition-fast: 150ms ease;
  max-width: 800px;
  margin: 0 auto;
  color: var(--color-text);
  line-height: 1.6;
}

.avd *, .avd *::before, .avd *::after { box-sizing: border-box; }
.avd fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.avd h2, .avd h3, .avd p, .avd ul { margin-top: 0; }
.avd a { color: var(--color-accent); }
.avd .radio-option input[type="radio"]:focus-visible + label { outline: 3px solid var(--color-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .avd *, .avd *::before, .avd *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

.avd .avd-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.avd .avd-card-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.avd .form-group {
  margin-bottom: 20px;
}

.avd .form-group label,
.avd .form-group legend,
.avd .form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
  padding: 0;
}

.avd .form-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.avd input[type="number"],
.avd input[type="text"],
.avd input[type="email"],
.avd input[type="tel"],
.avd input[type="date"],
.avd select,
.avd textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.avd input:focus,
.avd select:focus,
.avd textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(20, 40, 76, 0.1);
}

.avd input::placeholder,
.avd textarea::placeholder {
  color: var(--color-text-muted);
}

.avd select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2364748b'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.avd textarea {
  resize: vertical;
  min-height: 80px;
}

.avd .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.avd .radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.avd .radio-option {
  position: relative;
}

.avd .radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.avd .radio-option label {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

.avd .radio-option input[type="radio"]:checked + label {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.avd .radio-option label:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.avd .radio-option input[type="radio"]:checked + label:hover {
  color: #fff;
}

.avd .checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
}

.avd .checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.avd .checkbox-group label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  cursor: pointer;
  margin-bottom: 0;
  font-weight: 400;
}

.avd .checkbox-group a {
  color: var(--color-accent);
  text-decoration: underline;
}

.avd .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.avd .btn-primary {
  background: var(--color-primary);
  color: #fff;
  width: 100%;
}

.avd .btn-primary:hover {
  background: var(--color-primary-hover);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.avd .btn-primary:active {
  transform: translateY(0);
}

.avd .btn-accent {
  background: var(--color-accent);
  color: #fff;
  width: 100%;
}

.avd .btn-accent:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.avd .btn-secondary {
  background: var(--color-primary-light);
  color: var(--color-primary);
  width: 100%;
}

.avd .btn-secondary:hover {
  background: #dce3ee;
  text-decoration: none;
}

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

.avd .btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}

.avd .btn-lg {
  padding: 14px 32px;
  font-size: 1.1rem;
}

.avd .btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.avd .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.avd .btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.avd .btn-group .btn {
  flex: 1;
}

.avd .results-section {
  display: none;
  animation: avd-fadeIn 0.4s ease;
}

.avd .results-section.visible {
  display: block;
}

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

.avd .result-summary {
  text-align: center;
  padding: 24px 0;
}

.avd .result-summary h2 {
  font-size: 1.35rem;
  color: var(--color-primary);
  margin-bottom: 24px;
}

.avd .result-bars {
  max-width: 100%;
  margin: 0 auto 28px;
}

.avd .result-bar-group {
  margin-bottom: 16px;
}

.avd .result-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.avd .result-bar-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.avd .result-bar-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.avd .result-bar-track {
  height: 28px;
  background: var(--color-primary-50);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.avd .result-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease-out;
  width: 0;
}

.avd .result-bar-fill.sollwert {
  background: linear-gradient(90deg, var(--color-primary) 0%, #2a4a7f 100%);
}

.avd .result-bar-fill.istwert {
  background: linear-gradient(90deg, var(--color-success) 0%, #34d399 100%);
}

.avd .gap-display {
  text-align: center;
  padding: 24px;
  border-radius: var(--radius-lg);
  margin: 24px 0;
}

.avd .gap-display.has-gap {
  background: var(--color-danger-light);
  border: 1.5px solid #fca5a5;
}

.avd .gap-display.no-gap {
  background: var(--color-success-light);
  border: 1.5px solid #6ee7b7;
}

.avd .gap-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.avd .gap-display.has-gap .gap-label { color: var(--color-danger); }

.avd .gap-display.no-gap .gap-label { color: var(--color-success); }

.avd .gap-amount {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
}

.avd .gap-display.has-gap .gap-amount { color: var(--color-danger); }

.avd .gap-display.no-gap .gap-amount { color: var(--color-success); }

.avd .gap-suffix {
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 4px;
}

.avd .gap-display.has-gap .gap-suffix { color: #991b1b; }

.avd .gap-display.no-gap .gap-suffix { color: #065f46; }

.avd .result-recommended {
  background: var(--color-warning-light);
  border: 1px solid #fbbf24;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.9rem;
  color: #92400e;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.avd .result-recommended svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.avd .details-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-family);
  margin-top: 16px;
}

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

.avd .details-toggle svg {
  transition: transform var(--transition);
}

.avd .details-toggle.open svg {
  transform: rotate(180deg);
}

.avd .details-content {
  display: none;
  padding-top: 20px;
}

.avd .details-content.visible {
  display: block;
  animation: avd-fadeIn 0.3s ease;
}

.avd .detail-section {
  margin-bottom: 24px;
}

.avd .detail-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary-light);
}

.avd .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: 0.9rem;
}

.avd .detail-row:not(:last-child) {
  border-bottom: 1px solid var(--color-border-light);
}

.avd .detail-row .detail-label {
  color: var(--color-text-secondary);
  padding-right: 12px;
}

.avd .detail-row .detail-value {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.avd .detail-row.total {
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 0;
  margin-top: 4px;
  border-top: 2px solid var(--color-primary-light);
}

.avd .detail-row.total .detail-label { color: var(--color-primary); }

.avd .detail-row.total .detail-value { color: var(--color-primary); }

.avd .detail-note {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 8px;
  font-style: italic;
  line-height: 1.4;
}

@keyframes avd-slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

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

.avd .form-error {
  color: var(--color-danger);
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.avd .form-group.has-error input,
.avd .form-group.has-error select,
.avd .form-group.has-error textarea {
  border-color: var(--color-danger);
}

.avd .form-group.has-error .form-error {
  display: block;
}

.avd .info-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 24px;
}

.avd .info-card h2 {
  font-size: 1.35rem;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.avd .info-card p {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.avd .info-card p:last-child {
  margin-bottom: 0;
}

.avd .info-card ul {
  color: var(--color-text-secondary);
  line-height: 1.7;
  padding-left: 20px;
  margin-bottom: 12px;
}

.avd .info-card li {
  margin-bottom: 4px;
}

.avd .faq-item {
  border-bottom: 1px solid var(--color-border);
}

.avd .faq-item:first-child {
  border-top: 1px solid var(--color-border);
}

.avd .faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 0;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-family);
  gap: 16px;
}

.avd .faq-question:hover {
  color: var(--color-primary);
}

.avd .faq-question svg {
  flex-shrink: 0;
  transition: transform var(--transition);
  color: var(--color-text-muted);
}

.avd .faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.avd .faq-answer {
  display: none;
  padding-bottom: 18px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

.avd .faq-item.open .faq-answer {
  display: block;
  animation: avd-fadeIn 0.25s ease;
}

.avd .hidden { display: none !important; }

@media (max-width: 640px) {
.avd .hero {
    padding: 40px 16px 36px;
  }

.avd .hero h1 {
    font-size: 1.5rem;
  }

.avd .avd-card {
    padding: 20px;
    border-radius: var(--radius-md);
  }

.avd .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

.avd .trust-badges {
    gap: 8px;
  }

.avd .trust-badge {
    font-size: 0.78rem;
    padding: 6px 12px;
  }

.avd .btn-group {
    flex-direction: column;
  }

.avd .btn-group .btn {
    width: 100%;
  }

.avd .header-cta {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

.avd .gap-amount {
    font-size: 2rem;
  }

.avd .info-card {
    padding: 20px;
  }

}

@media (max-width: 380px) {
.avd .trust-badge {
    font-size: 0.72rem;
    padding: 5px 10px;
  }

.avd .header-cta span {
    display: none;
  }

}

.avd .hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.avd .quick-list { list-style: none; display: grid; gap: 10px; margin-top: 12px; }

.avd .quick-list li {
  position: relative;
  padding-left: 22px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  font-size: 0.95rem;
}

.avd .quick-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-success);
}

.avd .quick-list strong { color: var(--color-primary); }

.avd .optional { font-weight: 400; color: var(--color-text-muted); font-size: 0.82rem; }

.avd .advanced {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.avd .advanced summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text-secondary);
}

.avd .advanced[open] summary { border-bottom: 1px solid var(--color-border); color: var(--color-primary); }

.avd .advanced-body { padding: 16px 16px 0; }

.avd .kids-ages { margin-bottom: 4px; }

.avd .kids-ages:empty { display: none; }

.avd .sub-title {
  font-size: 1.05rem;
  color: var(--color-primary);
  text-align: left;
  margin: 28px 0 12px;
}

.avd .stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 8px 0 24px;
  text-align: left;
}

.avd .stat-grid-2 { grid-template-columns: repeat(2, 1fr); margin-top: 20px; }

.avd .stat {
  background: var(--color-primary-50);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.avd .stat-accent { background: var(--color-success-light); }

.avd .stat-label { font-size: 0.78rem; color: var(--color-text-secondary); line-height: 1.35; }

.avd .stat-value { font-size: 1.15rem; font-weight: 700; color: var(--color-primary); overflow-wrap: anywhere; }

.avd .stat-accent .stat-value { color: #065f46; }

.avd .chart-wrap { width: 100%; }

.avd .chart-svg { width: 100%; height: auto; display: block; }

.avd .chart-grid { stroke: var(--color-border); stroke-width: 1; }

.avd .chart-axis { fill: var(--color-text-secondary); font-size: 11px; font-family: var(--font-family); }

.avd .chart-eigen { fill: var(--color-primary); }

.avd .chart-zulage { fill: var(--color-success); }

.avd .chart-ertrag { fill: #93a8cc; }

.avd .chart-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.avd .chart-legend li { display: inline-flex; align-items: center; gap: 6px; }

.avd .swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.avd .swatch-eigen { background: var(--color-primary); }

.avd .swatch-zulage { background: var(--color-success); }

.avd .swatch-ertrag { background: #93a8cc; }

.avd .pension-box {
  background: var(--color-primary-50);
  border-radius: var(--radius-lg);
  padding: 8px 20px 20px;
  margin-top: 24px;
}

.avd .pension-box .sub-title { margin-top: 16px; }

.avd .pension-amount {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 800;
  color: var(--color-primary);
  text-align: left;
}

.avd .pension-note { font-size: 0.88rem; color: var(--color-text-secondary); text-align: left; margin-top: 6px; line-height: 1.55; }

.avd .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.avd .scenario-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; text-align: left; }

.avd .scenario-table th,
.avd .scenario-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.avd .scenario-table thead th {
  background: var(--color-primary-50);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.82rem;
}

.avd .scenario-table tbody th { font-weight: 600; color: var(--color-text); }

.avd .scenario-table td { color: var(--color-text-secondary); }

.avd .scenario-table tr.is-selected th,
.avd .scenario-table tr.is-selected td {
  background: var(--color-success-light);
  color: #065f46;
  font-weight: 600;
}

.avd .tips { text-align: left; }

.avd .tips ul { padding-left: 20px; color: var(--color-text-secondary); line-height: 1.6; font-size: 0.93rem; }

.avd .tips li { margin-bottom: 8px; }

.avd .cta-partner {
  background: #80044c;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 28px;
  text-align: center;
}

.avd .cta-partner h3 { font-size: 1.2rem; margin-bottom: 10px; }

.avd .cta-partner p { opacity: 0.92; line-height: 1.6; margin-bottom: 18px; }

.avd .cta-partner .btn-partner { background: #fff; color: #80044c; }

.avd .cta-partner .btn-partner:hover { background: #f6e6ef; }

.avd .cta-partner .cta-small { font-size: 0.78rem; opacity: 0.8; margin: 14px 0 0; color: #fff; }

.avd .cta-secondary { display: inline-block; margin-top: 14px; color: #fff; text-decoration: underline; font-size: 0.92rem; }

.avd .cta-card { text-align: center; }

.avd .cta-card .btn { max-width: 420px; }

.avd .cta-small { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 12px; line-height: 1.5; }

.avd .sources { font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.6; padding: 0 8px; }

.avd .info-card th[scope="row"] { min-width: 120px; }

@media (max-width: 640px) {
.avd .stat-grid { grid-template-columns: repeat(2, 1fr); }

.avd .stat-grid-2 { grid-template-columns: 1fr; }

.avd .cta-partner { padding: 22px 18px; }

.avd .cta-partner .btn { width: 100%; }

.avd .pension-box { padding: 4px 16px 16px; }

}


.avd .cta-partner h3 { color: #fff; }

.avd .btn-partner { background: #80044c; color: #fff; width: 100%; }
.avd .btn-partner:hover { background: #66033d; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.avd .cta-partner .btn-partner { background: #fff; color: #80044c; }
.avd .cta-partner .btn-partner:hover { background: #f6e6ef; }
