/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0f172a;
  --navy-light: #1e3a5f;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-light: #dbeafe;
  --accent: #3b82f6;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 48px rgba(15,23,42,.14);
  --transition: .25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.2rem; }

.section-label {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-light);
  padding: .3rem .9rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.section-title { margin-bottom: .75rem; }
.section-sub { color: var(--text-muted); font-size: 1.05rem; max-width: 640px; }
.text-center { text-align: center; }
.text-center .section-sub { margin: 0 auto; }

/* === LAYOUT === */
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 5rem 0; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.35); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn-outline-dark { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline-dark:hover { background: var(--blue); color: #fff; }

/* === HEADER / NAV === */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,23,42,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1.5rem;
}

.header-logo img { height: 44px; width: auto; }
.logo-square { display: none; }

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

nav a, .nav-dropdown > button {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  font-weight: 500;
  padding: .5rem .85rem;
  border-radius: 6px;
  transition: var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}

nav a:hover, .nav-dropdown > button:hover { color: #fff; background: rgba(255,255,255,.08); }
nav a.active { color: #fff; }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  min-width: 220px;
  padding: .5rem;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  /* sanft ein- und ausblenden */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
  /* kleiner Verzögerung beim Schliessen – überbrückt die Lücke */
  transition-delay: .08s;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .85rem;
  border-radius: 6px;
  color: rgba(255,255,255,.8);
  font-size: .88rem;
}
.nav-dropdown-menu a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-dropdown-menu a .menu-icon { font-size: 1.1rem; }

.header-actions { display: flex; align-items: center; gap: .75rem; }
.header-actions a {
  color: rgba(255,255,255,.75);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: var(--transition);
}
.header-actions a:hover { color: #fff; }
.header-actions .btn { padding: .5rem 1.2rem; font-size: .85rem; }

/* E-Mail-Text ab ~1100px ausblenden, nur Icon bleibt */
@media (max-width: 1100px) {
  .header-email-text { display: none; }
}
/* E-Mail-Link ab Hamburger-Breakpoint komplett ausblenden */
@media (max-width: 900px) {
  .header-email { display: none; }
  .logo-wide   { display: none; }
  .logo-square { display: block; height: 40px; width: auto; }
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: .4rem;
}

/* === HERO === */
#hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  overflow: hidden;
  padding: 5rem 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('../img/hero-bg.png');
  background-size: cover;
  background-position: center;
  opacity: .15;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.07) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(37,99,235,.2);
  border: 1px solid rgba(37,99,235,.4);
  color: #93c5fd;
  font-size: .85rem;
  font-weight: 500;
  padding: .4rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero-title { color: #fff; margin-bottom: 1.25rem; }
.hero-title span { color: #60a5fa; }

.hero-text {
  color: rgba(255,255,255,.75);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3rem; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.1);
}

.hero-stat-value { color: #fff; font-size: 1.75rem; font-weight: 700; }
.hero-stat-label { color: rgba(255,255,255,.5); font-size: .85rem; }

/* === FEATURES / VALUE PROPS === */
#features { background: var(--bg-alt); padding: 4rem 0; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.feature-icon {
  width: 52px;
  height: 52px;
  background: var(--blue-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 { margin-bottom: .5rem; font-size: 1.1rem; }
.feature-card p { color: var(--text-muted); font-size: .93rem; line-height: 1.6; }

/* === ABOUT === */
#about { background: #fff; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-img-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.about-img-wrap img { width: 100%; border-radius: var(--radius); }

.about-badge {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: var(--blue);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
}

.about-content .section-sub { margin-bottom: 1.5rem; }

.about-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 2rem;
}

.about-list li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: .95rem;
  color: var(--text);
}

.about-list li::before {
  content: "✓";
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  margin-top: 2px;
}

/* === SERVICES === */
#services { background: var(--bg-alt); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.service-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.service-img {
  height: 200px;
  overflow: hidden;
  background: var(--bg-alt);
}
.service-img img { width: 100%; height: 100%; object-fit: cover; transition: .4s ease; }
.service-card:hover .service-img img { transform: scale(1.05); }

.service-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.service-icon { font-size: 1.5rem; margin-bottom: .75rem; }
.service-body h3 { margin-bottom: .5rem; }
.service-body p { color: var(--text-muted); font-size: .9rem; line-height: 1.6; flex: 1; }

.service-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--blue);
  font-size: .88rem;
  font-weight: 600;
  margin-top: 1rem;
  transition: var(--transition);
}
.service-link:hover { gap: .7rem; }
.service-link::after { content: "→"; }

/* === WHY US === */
#why-us { background: var(--bg-dark); color: #fff; }

#why-us .section-label { background: rgba(37,99,235,.2); color: #93c5fd; }
#why-us .section-title { color: #fff; }
#why-us .section-sub { color: rgba(255,255,255,.6); }

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 3rem;
}

.why-img img { border-radius: var(--radius); }

.why-items { display: flex; flex-direction: column; gap: 1.25rem; }

.why-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  transition: var(--transition);
}

.why-item:hover { background: rgba(255,255,255,.07); border-color: rgba(37,99,235,.4); }

.why-item-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: rgba(37,99,235,.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.why-item h4 { color: #fff; font-size: .95rem; margin-bottom: .25rem; }
.why-item p { color: rgba(255,255,255,.55); font-size: .87rem; line-height: 1.5; }

/* === CTA BANNER === */
#cta {
  background: linear-gradient(135deg, var(--blue) 0%, #1d4ed8 100%);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}

#cta h2 { color: #fff; margin-bottom: .75rem; }
#cta p { color: rgba(255,255,255,.8); margin-bottom: 2rem; font-size: 1.05rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.btn-white { background: #fff; color: var(--blue); }
.btn-white:hover { background: #f0f9ff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }

/* === CONTACT === */
#contact { background: var(--bg-alt); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  margin-top: 2.5rem;
}

.contact-info { display: flex; flex-direction: column; gap: 1.5rem; }

.contact-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact-card-icon {
  width: 44px;
  height: 44px;
  background: var(--blue-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-card h4 { font-size: .85rem; color: var(--text-muted); font-weight: 500; margin-bottom: .25rem; }
.contact-card p, .contact-card a { font-size: .95rem; color: var(--text); font-weight: 500; }
.contact-card a:hover { color: var(--blue); }

/* Contact Form */
.contact-form-wrap {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.contact-form-wrap h3 { margin-bottom: 1.5rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .92rem;
  color: var(--text);
  background: #fff;
  transition: var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-group textarea { resize: vertical; min-height: 110px; }

.form-check { display: flex; align-items: flex-start; gap: .6rem; font-size: .87rem; color: var(--text-muted); }
.form-check input[type=checkbox] { margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--blue); }
.form-check a { color: var(--blue); text-decoration: underline; }

.form-success {
  display: none;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: #166534;
  font-size: .92rem;
  margin-top: 1rem;
  align-items: center;
  gap: .5rem;
}

.form-error-msg {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: #991b1b;
  font-size: .92rem;
  margin-top: 1rem;
}

/* === FOOTER === */
#footer {
  background: var(--navy);
  color: rgba(255,255,255,.7);
  padding: 4rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-brand img { height: 38px; margin-bottom: 1rem; }
.footer-brand p { font-size: .88rem; line-height: 1.7; color: rgba(255,255,255,.5); max-width: 260px; }

.footer-col h4 { color: #fff; font-size: .9rem; margin-bottom: 1rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-col ul li a { font-size: .87rem; color: rgba(255,255,255,.55); transition: var(--transition); }
.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  font-size: .82rem;
  color: rgba(255,255,255,.35);
  flex-wrap: wrap;
  gap: .5rem;
}

.footer-bottom a { color: rgba(255,255,255,.35); transition: var(--transition); }
.footer-bottom a:hover { color: rgba(255,255,255,.7); }

/* === MOBILE MENU === */
@media (max-width: 900px) {
  .nav-toggle { display: block; }

  nav, .header-actions .header-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 1rem;
    flex-direction: column;
    border-top: 1px solid rgba(255,255,255,.08);
    gap: .25rem;
  }

  nav.open { display: flex; z-index: 99; }

  nav a, .nav-dropdown > button { width: 100%; justify-content: flex-start; padding: .75rem 1rem; }

  .nav-dropdown-menu {
    position: static;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: opacity .2s ease, visibility .2s ease, max-height .2s ease;
    transition-delay: 0s;
    box-shadow: none;
    border: none;
    background: rgba(255,255,255,.04);
    border-radius: 8px;
    margin-top: .25rem;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 400px;
  }

  .header-actions { gap: .5rem; }
  .header-actions .header-links { display: none; }
  .header-actions .btn { display: inline-flex; }

  .about-grid, .why-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .why-img { order: -1; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }

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

@media (max-width: 600px) {
  section { padding: 3.5rem 0; }
  .hero-stats { gap: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  /* Button-Text kürzen auf kleinen Screens */
  .header-actions .btn { font-size: .82rem; padding: .45rem .9rem; }
}

/* === PORTAL / MANAGED VS SELF-MANAGED === */
#portal { background: var(--bg); }

.portal-intro { margin-bottom: 2.5rem; }

.portal-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
}

.portal-card {
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
}

.portal-managed { background: var(--bg-alt); }
.portal-self { background: var(--navy); }
.portal-self h3 { color: #fff; }
.portal-self p { color: rgba(255,255,255,.65); }
.portal-self .check-list li { color: rgba(255,255,255,.8); }
.portal-self .check-list li::before { background: rgba(37,99,235,.25); color: #93c5fd; }

.portal-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.portal-card h3 { font-size: 1.15rem; margin-bottom: .6rem; }
.portal-card p { font-size: .92rem; line-height: 1.65; color: var(--text-muted); }

.portal-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  background: linear-gradient(to right, var(--bg-alt), var(--navy));
  position: relative;
}

.portal-divider span {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: .3rem .65rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

/* Portal feature categories */
.portal-cats {
  margin-top: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.portal-cats-intro {
  text-align: center;
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 1.1rem 1.5rem .9rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.portal-cat {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: .9rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.portal-cat:last-child { border-bottom: none; }
.portal-cat:nth-child(even) { background: var(--bg-alt); }

.portal-cat-label {
  flex-shrink: 0;
  width: 230px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .01em;
}

/* Portal feature pills */
.portal-features {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.portal-feature {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: .3rem .85rem;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.portal-feature:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

.portal-cat:nth-child(even) .portal-feature { background: #fff; }

@media (max-width: 700px) {
  .portal-cat { flex-direction: column; gap: .6rem; }
  .portal-cat-label { width: auto; }
}

@media (max-width: 768px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }
  .portal-divider {
    width: 100%;
    height: 44px;
    background: linear-gradient(to bottom, var(--bg-alt), var(--navy));
  }
}

/* === ANIMATIONS === */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity .6s ease, transform .6s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Stagger children */
.fade-up:nth-child(2) { transition-delay: .1s; }
.fade-up:nth-child(3) { transition-delay: .2s; }
.fade-up:nth-child(4) { transition-delay: .3s; }
.fade-up:nth-child(5) { transition-delay: .4s; }
.fade-up:nth-child(6) { transition-delay: .5s; }
.fade-up:nth-child(7) { transition-delay: .6s; }
