/* Project ATLAS - Site #20: Kreditrechner & Tilgungsplan Online (German) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #090e1a;
  --bg-surface: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --border-subtle: #334155;
  --border-focus: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --accent-emerald: #059669;
  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Header */
header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.25rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.25rem;
}

.logo-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
}

.logo-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.75rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

nav a:hover, nav a.active {
  color: var(--accent-green);
}

/* Hero Section */
.hero-section {
  padding: 3.5rem 0 2rem;
  text-align: center;
}

.badge-tag {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.85rem;
  line-height: 1.2;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 740px;
  margin: 0 auto;
}

/* Tool Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  margin: 2rem 0 3.5rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 2rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  background: #020617;
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  padding: 0.8rem 2.75rem 0.8rem 1rem;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--accent-green);
}

.input-unit {
  position: absolute;
  right: 1rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  pointer-events: none;
}

/* Primary Result Card */
.result-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 1rem;
  padding: 2.25rem;
  margin-bottom: 1.75rem;
  text-align: center;
}

.rate-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rate-val {
  font-family: var(--font-mono);
  font-size: 3.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0.5rem 0;
  line-height: 1;
}

.rate-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Key Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.metric-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.metric-number {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

/* Visual Cost Ratio Bar */
.ratio-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.ratio-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.ratio-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #020617;
}

.ratio-principal {
  background: var(--accent-green);
  height: 100%;
}

.ratio-interest {
  background: var(--accent-amber);
  height: 100%;
}

/* Tilgungsplan Table */
.schedule-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 3.5rem;
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-responsive {
  overflow-x: auto;
  max-height: 480px;
}

table.tilgung-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: right;
}

table.tilgung-table th {
  background: #020617;
  color: #fff;
  padding: 0.85rem 1rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  border-bottom: 2px solid var(--border-subtle);
}

table.tilgung-table th:first-child, table.tilgung-table td:first-child {
  text-align: left;
}

table.tilgung-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-family: var(--font-mono);
}

table.tilgung-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Editorial / Guides */
.editorial-section {
  padding-bottom: 5rem;
}

.editorial-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}

.editorial-card h2 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: #fff;
}

.editorial-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: #e2e8f0;
}

.editorial-card p {
  color: #cbd5e1;
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  background: #060911;
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent-green);
}

@media (max-width: 900px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2.15rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
