/* ═══════════════════════════════════════════════════════
   Navigate Germany — Module Design System v2
   Clean, readable, consistent across all 14 module pages
   ═══════════════════════════════════════════════════════ */

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

:root {
  --bg:       #07090f;
  --surface:  #0f1320;
  --surface2: #161b2e;
  --surface3: #1c2238;
  --border:   rgba(255,255,255,.08);
  --border2:  rgba(255,255,255,.13);
  --accent:   #FFCC02;
  --accent-dim: rgba(255,204,2,.12);
  --text:     #f1f5f9;
  --text-2:   #cbd5e1;
  --muted:    #7c8fa8;
  --green:    #22c55e;
  --red:      #ef4444;
  --amber:    #f59e0b;
  --blue:     #3b82f6;
  --purple:   #7c3aed;

  --radius:   12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  --max-w: 960px;
  --nav-h: 58px;
  --tab-h: 44px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────── */
h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: .95rem; font-weight: 700; line-height: 1.3; color: var(--text); }
h3 { font-size: .85rem; font-weight: 700; line-height: 1.3; color: var(--text); }
p  { font-size: .875rem; color: var(--text-2); line-height: 1.75; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong, b { font-weight: 700; color: var(--text); }

/* ── Sticky nav ─────────────────────────────────────── */
nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 10px;
  background: rgba(7,9,15,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nb {
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nb span { color: var(--accent); }
.bl {
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
  white-space: nowrap;
}
.bl:hover { color: var(--accent); text-decoration: none; }

/* ── Page header ────────────────────────────────────── */
.ph {
  padding: clamp(24px, 4vw, 40px) clamp(16px, 3vw, 28px) clamp(20px, 3vw, 32px);
  background: linear-gradient(135deg, #0d1225 0%, #131929 60%, #0f1a2e 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.ph::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 85% 20%, rgba(59,130,246,.1), transparent 60%);
  pointer-events: none;
}
.ph h1 {
  margin-bottom: 8px;
  color: var(--text);
  position: relative;
}
.ph > p {
  font-size: .875rem;
  color: var(--muted);
  max-width: 580px;
  line-height: 1.65;
  margin-bottom: 14px;
  position: relative;
}
.ph .badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  position: relative;
}

/* ── Sticky tab bar ─────────────────────────────────── */
.tabs {
  display: flex;
  height: var(--tab-h);
  background: rgba(7,9,15,.95);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  gap: 0;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 18px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  height: 100%;
}
.tab:hover:not(.active) { color: var(--text-2); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Tab content & container ────────────────────────── */
.tc { display: none; }
.tc.active { display: block; }

.con {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 16px 72px;
}

/* ── Module back bar (breadcrumb) ───────────────────── */
.module-back-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.module-back-bar a {
  font-size: .75rem;
  color: var(--muted);
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all .15s;
}
.module-back-bar a:hover { color: var(--accent); border-color: rgba(255,204,2,.3); text-decoration: none; }
.module-back-bar a.active {
  color: var(--accent);
  border-color: rgba(255,204,2,.25);
  background: var(--accent-dim);
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
}
.card h2 {
  margin-bottom: 12px;
}
.card h3 {
  margin-bottom: 8px;
}
.card p {
  font-size: .85rem;
}
.card + .card { margin-top: 0; }

/* ── Portal / resource cards ────────────────────────── */
.portal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .2s, background .2s;
}
.portal-card:hover {
  border-color: rgba(255,204,2,.3);
  background: var(--surface2);
}
.portal-card h3 {
  font-size: .82rem;
  color: var(--accent);
  margin-bottom: 4px;
}
.portal-card p {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.55;
}
.portal-card a {
  font-size: .76rem;
  color: #60a5fa;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.portal-card a:hover { color: var(--accent); }

/* ── Grid layouts ───────────────────────────────────── */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

/* ── Section heading ────────────────────────────────── */
.sec-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* ── Info / alert boxes ─────────────────────────────── */
.ib, .wb, .sb, .ab {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .845rem;
  line-height: 1.7;
  margin: 10px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ib { background: rgba(59,130,246,.1);  border: 1px solid rgba(59,130,246,.25);  color: #93c5fd; }
.wb { background: rgba(239,68,68,.1);   border: 1px solid rgba(239,68,68,.25);   color: #fca5a5; }
.sb { background: rgba(34,197,94,.1);   border: 1px solid rgba(34,197,94,.25);   color: #86efac; }
.ab { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.25);  color: #fcd34d; }

/* ── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .01em;
  border: 1px solid transparent;
}
.bgreen { background: rgba(34,197,94,.12);  color: #4ade80;  border-color: rgba(34,197,94,.2); }
.bamber { background: rgba(245,158,11,.12); color: #fbbf24;  border-color: rgba(245,158,11,.2); }
.bred   { background: rgba(239,68,68,.12);  color: #f87171;  border-color: rgba(239,68,68,.2); }
.bblue  { background: rgba(59,130,246,.12); color: #60a5fa;  border-color: rgba(59,130,246,.2); }
.bpurple{ background: rgba(124,58,237,.12); color: #a78bfa;  border-color: rgba(124,58,237,.2); }

/* ── Checklist ──────────────────────────────────────── */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .845rem;
  color: var(--text-2);
  line-height: 1.55;
}
.checklist li::before {
  content: '☐';
  color: var(--muted);
  flex-shrink: 0;
  font-size: .9rem;
  margin-top: 1px;
}
.checklist li.done::before { content: '✓'; color: var(--green); }

/* ── Tables ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); margin: 12px 0; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th {
  text-align: left;
  padding: 9px 14px;
  background: var(--surface2);
  color: var(--text-2);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
  font-size: .84rem;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Form elements ──────────────────────────────────── */
label {
  display: block;
  font-size: .77rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  margin-top: 14px;
  letter-spacing: .02em;
}
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: var(--font);
  background: var(--surface2);
  color: var(--text);
  transition: border-color .15s, background .15s;
  outline: none;
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(255,204,2,.5);
  background: var(--surface3);
}
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .84rem;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}
.bg {
  background: var(--accent);
  color: #000;
}
.bg:hover { background: #e6b800; transform: translateY(-1px); text-decoration: none; color: #000; }

.bo {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.bo:hover { border-color: rgba(255,204,2,.4); color: var(--accent); text-decoration: none; }

/* ── Referral bar ───────────────────────────────────── */
.ref-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(10,22,40,.9), rgba(13,32,68,.9));
  border: 1px solid rgba(255,215,0,.12);
  border-radius: var(--radius);
  margin: 24px 0 8px;
  font-size: .73rem;
  color: rgba(255,255,255,.4);
}
.ref-bar a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: .73rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .15s;
  border: 1px solid transparent;
}
.ref-cb { background: rgba(255,204,2,.1);  color: #FFCC02; border-color: rgba(255,204,2,.2); }
.ref-cb:hover { background: rgba(255,204,2,.18); text-decoration: none; }
.ref-av { background: rgba(248,113,113,.1); color: #f87171; border-color: rgba(248,113,113,.2); }
.ref-av:hover { background: rgba(248,113,113,.18); text-decoration: none; }
.ref-ws { background: rgba(52,211,153,.1);  color: #34d399; border-color: rgba(52,211,153,.2); }
.ref-ws:hover { background: rgba(52,211,153,.18); text-decoration: none; }

/* ── Toast notification ─────────────────────────────── */
#ng-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: .8rem;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
#ng-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Ask Germany AI button ──────────────────────────── */
#ng-ai-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}
#ng-ai-btn a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 50px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(124,58,237,.45);
  transition: all .2s;
  white-space: nowrap;
}
#ng-ai-btn a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(124,58,237,.55);
  text-decoration: none;
}

/* ── Divider ─────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Module-product overrides — reset conflicts ──────── */
/* module-product.js adds body.module-product — we reset the parts that break layout */
.module-product .con {
  max-width: var(--max-w) !important;
  padding: 24px 16px 72px !important;
}
.module-product .ph h1 {
  font-size: clamp(1.4rem, 3vw, 1.9rem) !important;
}
.module-product .tabs .tab {
  min-height: unset !important;
  height: var(--tab-h) !important;
}
.module-product button {
  min-height: unset !important;
}
.module-product input,
.module-product select,
.module-product textarea {
  min-height: unset !important;
}
.module-product table {
  min-width: unset !important;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 720px) {
  :root { --nav-h: 52px; --tab-h: 40px; }

  .ph { padding: 20px 14px 16px; }
  .ph h1 { font-size: 1.3rem; }
  .ph > p { font-size: .82rem; }

  .con { padding: 16px 12px 72px; }

  .row2 { grid-template-columns: 1fr; gap: 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }

  .tab { padding: 0 13px; font-size: .77rem; }

  .card { padding: 16px; }

  .ref-bar { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .ph h1 { font-size: 1.15rem; }
  .tab { padding: 0 11px; font-size: .74rem; }
  .btn { padding: 8px 14px; font-size: .8rem; }
}
