:root{
  --bg: #f7faf6; /* soft off-white */
  --card: #ffffff;
  --muted: rgb(48, 51, 57);
  --accent: rgb(123, 172, 155); /* soft green */
  --accent-2: rgb(123, 172, 155); /* soft grün */
  --accent-3: rgb(172, 172, 150); /* soft blue */
  --glass: rgba(255,255,255,0.6);
  --shadow: 0 8px 24px rgba(16,24,40,0.6);
  --radius: 14px;
  --max-width: 1100px;
  color-scheme: light;
}

*{box-sizing:border-box}
html,body{height:100%}
/* Set a clear base font size and prevent mobile browsers from auto-adjusting text size */
html{font-size:16px; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; text-size-adjust:100%;}
body{
  margin:0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: linear-gradient(180deg,var(--bg),#ffffff);
  color:#0f172a;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
  padding-top: 96px;   /* Platz für den festen Header schaffen (angepasst) */
}

/* Ensure form controls inherit the same font size so they don't look smaller on some devices */
body, input, textarea, button, select { font-size: 1rem; }

header{
  background: linear-gradient(90deg, rgb(86, 128, 113), rgb(86, 128, 113));
  backdrop-filter: blur(6px);
  position: fixed;      /* geändert von sticky auf fixed */
  top: 0;
  left: 0;
  width: 100%;          /* volle Breite */
  z-index: 999;         /* hoch genug, damit immer oben */
  border-bottom: 1px solid rgba(15,23,42,0.04);
}

.container{max-width:var(--max-width);margin:0 auto;padding:28px 20px}

@media (max-width:770px){
  header .container{padding:14px 16px}
}

.nav{
  display:flex;align-items:center;justify-content:space-between;gap:20px
}

.brand{display:flex;align-items:center;gap:12px}
.logo{
  width:44px;height:44px;border-radius:10px;background:linear-gradient(135deg,var(--accent),var(--accent-2));display:flex;align-items:center;justify-content:center;color:white;font-weight:700;box-shadow:var(--shadow)
}
.brand h1{font-size:28px;margin:0}
.brand p{margin:0;font-size:18px;color:#363a42}

/* Responsive typography: scale down on smaller devices */
@media (max-width:770px){
  /* Keep font sizes consistent across devices; only adjust spacing for small screens */
  body{ padding-top:86px }
  nav ul{gap:12px}
  nav a{padding:6px}
  .card4{margin-top: 100px;}
}

@media (max-width:420px){
  /* Do not change font sizes on very small screens; only adjust spacing and layout */
  body{ padding-top:76px }
  nav ul{gap:8px}
  nav a{padding:8px 6px}
  .card{padding:16px}
  input,textarea{padding:10px}
  button{padding:10px 12px}
  .services{grid-template-columns:1fr}
}

nav ul{list-style:none;margin:0;padding:0;display:flex;gap:18px;align-items:center; font-size:18px}
nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

nav a:hover,
nav a:focus {
  background: var(--accent-3);
  color: #17405e;
  box-shadow: 0 2px 8px rgba(16,24,40,0.08);
  outline: none;
}

nav a:active {
  background: var(--accent);
  color: #17405e;
  box-shadow: 0 1px 4px rgba(16,24,40,0.10);
}

.hero{
  display:grid;grid-template-columns:1fr 420px;gap:36px;align-items:center;padding:56px 20px 36px
}
.hero h2{font-size:24px;margin:0 0 12px}
.lead{color:var(--muted);margin-bottom:18px}

.card{background:var(--card);padding:22px;border-radius:16px;box-shadow:var(--shadow)}
.card1{background:var(--card);padding-left: 10px; padding-top: 15px;border-radius:16px;box-shadow:var(--shadow); }
.card2{background:var(--card);padding:0px;border-radius:16px;box-shadow:var(--shadow)}
.card4{background:var(--card);padding:22px;border-radius:16px;box-shadow:var(--shadow)}


.services{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:22px}
.service{padding:18px;border-radius:12px;background:linear-gradient(180deg,#ffffff, #fbfffd);border:1px solid rgba(10,10,10,0.03)}

/* Service card interaction */
.service{position:relative;cursor:pointer}
.service:focus{outline:2px solid rgba(147,197,163,0.24);box-shadow:0 6px 18px rgba(16,24,40,0.06);transform:translateY(-2px)}
.service .short{font-weight:600}

/* Popover that shows longer explanation */

.popover{position:absolute;left:0;top:0;transform-origin:top left;background:var(--card);border-radius:12px;box-shadow:0 12px 40px rgba(16,24,40,0.12);padding:14px;max-width:420px;color:var(--muted);z-index:1200;display:block;opacity:0;pointer-events:none}
.popover.visible{opacity:1;pointer-events:auto;transform:scale(1) translateY(0);transition:opacity 50ms ease,transform 50ms cubic-bezier(.2,.9,.3,1)}
.popover .title{font-weight:700;margin-bottom:8px;color:inherit}
.popover .content{max-height:260px;overflow:auto;padding-right:6px}
.popover p{margin:0 0 8px 0;color:var(--muted);line-height:1.45}

/* Small arrow (we'll reposition it via inline styles from JS when possible) */
.popover .arrow{position:absolute;width:12px;height:12px;background:var(--card);transform:rotate(45deg);box-shadow:0 3px 8px rgba(16,24,40,0.06);opacity:1}
.popover .arrow.hide{opacity:0}

/* Close button */
.popover .close-btn{position:absolute;top:8px;right:8px;background:transparent;border:none;padding:6px;border-radius:8px;cursor:pointer;color:var(--muted);font-weight:700}
.popover .close-btn:focus{outline:2px solid rgba(147,197,163,0.28)}

@media (max-width:770px){
  .popover{position:fixed;left:12px;right:12px;top:16%;max-width:none;border-radius:12px}
  .popover::after{display:none}
}

@media (max-width:770px){
  .popover{position:fixed;left:8px;right:8px;top:20%;max-width:none}
  .popover::after{display:none}
}

.about{display:flex;gap:22px;align-items:center;margin-top:26px}
.about img{width:300px;height:auto;border-radius:12px;object-fit:cover;box-shadow:var(--shadow)}

form{display:grid;gap:12px}
input,textarea{padding:12px;border-radius:10px;border:1px solid rgba(15,23,42,0.06);font-size:14px}
button {
  background: linear-gradient(90deg,rgb(97, 137, 123),var(--accent-3));
  border: none;
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(16,24,40,0.08);
}

button:hover,
button:focus {
  background: linear-gradient(90deg, var(--accent-2), var(rgb(97, 137, 123)));
  box-shadow: 0 4px 16px rgba(16,24,40,0.12);
  outline: none;
  transform: translateY(-2px) scale(1.03);
}

button:active {
  background: linear-gradient(90deg, var(rgb(97, 137, 123)), var(--accent-2));
  box-shadow: 0 1px 4px rgba(16,24,40,0.10);
  transform: translateY(1px) scale(0.98);
}

footer{padding:28px 20px;margin-top:36px;text-align:center;color:var(--muted);font-size:14px}

@media (max-width:770px){
  .hero{grid-template-columns:1fr;}
  .services{grid-template-columns:repeat(2,1fr)}
  .about{flex-direction:column}
  /* Instead of hiding the nav, move it beneath the brand/tagline as a vertical list */
  /* stack header content and place nav under the brand/tagline */
  .nav{flex-direction:column;align-items:flex-start;gap:12px}
  nav{width:100%}
  /* show main nav by default under the tagline and lay out links 2x2 */
  #mainNav{display:block;order:1;margin-bottom:0;padding-bottom:0}
  /* grid: two columns, center content inside each cell and ensure comfortable touch area */
  #mainNav ul{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:4px 0 0 0;grid-auto-rows:48px}
  #mainNav li{display:flex;align-items:center;justify-content:center}
  #mainNav a{display:inline-block;padding:10px 8px;border-radius:8px;text-align:center;width:100%}
  /* larger hit-targets and clearer spacing for mobile */
  #mainNav a, #mainNav a:link, #mainNav a:visited{font-weight:700}
  .mobile-toggle{display:block}
}

/* header hide on scroll: slide up when .hidden is added (only visual) */
header{transition:transform 240ms ease,opacity 240ms ease}
header.hidden{transform:translateY(-110%);opacity:0}

@media (max-width:560px){
  .services{grid-template-columns:1fr}
  .brand h1{font-size:24px}
  .hero h2{font-size:24px}
}

/* New breakpoint: stack hero aside under the main welcome card when width < 914px */
@media (max-width:914px){
  .hero{grid-template-columns:1fr;}
  /* ensure the aside (Sicher & vertraulich) moves below the main card and keeps spacing */
  .hero > aside{order:1}
  .hero > .reveal{order:0}
  .hero {padding-bottom: 18px}
}

  /* Make the hero aside use flex so the image can be centered easily */
  .hero > aside{display:flex;align-items:center;justify-content:center}

.mobile-toggle{display:none;background:none;border:none}
.mobile-menu{display:none}
.mobile-menu.open{display:block;padding:12px}

.reveal{opacity:0;transform:translateY(8px);transition:opacity .6s ease,transform .6s ease}
.reveal.visible{opacity:1;transform:none}

.map-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Verhältnis */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.map-responsive iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
  border-radius: 12px;
}

/* Contact grid: default two-column layout */
.contact-grid{
  display:grid;
  grid-template-columns:1fr 360px;
  gap:18px;
  margin-top:12px;
  align-items:start;
}

/* On small screens, stack the form first and the Praxisdetails aside below */
@media (max-width:720px){
  .contact-grid{
    grid-template-columns:1fr;
    grid-auto-flow:row;
  }
  /* ensure the aside visually follows the form even if DOM order changes */
  .contact-grid > form, .contact-grid > .card, .contact-grid > aside{order:0}
  .contact-grid > aside{order:1}
}

.fit-picture {
  margin-top:0px;
  background: linear-gradient(135deg, rgb(97, 137, 123), var(--accent-3));
  padding: 10px; /* Optional: Platz für den Verlauf */
  /*width: 58%;  Volle Breite des Containers */
  /*height: max-content;  Höhe automatisch anpassen */
  
  object-fit: cover; /* Bild proportional skalieren und zuschneiden */
  border-radius: 15px; /* Radius für abgerundete Ecken */
}

.fit-picture1 {
  margin-top:0px;
  background: linear-gradient(135deg,var(--accent-3),  rgb(97, 137, 123));
  padding: 10px; /* Optional: Platz für den Verlauf */
  margin-top: 2%; 
  width: 74%; /* Volle Breite des Containers */
  /*height: max-content;  Höhe automatisch anpassen */
  
  object-fit: cover; /* Bild proportional skalieren und zuschneiden */
  border-radius: 15px; /* Radius für abgerundete Ecken */
  border-radius:16px;
  box-shadow:var(--shadow);
}

/* Small screens: center the image and make it responsive */
@media (max-width:914px){
  .hero > aside{justify-content:center;padding-top:8px}
  .fit-picture1{
    width: 86%;        /* make it wider in its stacked layout */
    max-width: 420px;  /* don't grow too large on medium devices */
    margin: 0 auto;    /* center if block-level */
    display: block;    /* ensure margin auto works */
  }
}

@media (max-width:420px){
  .fit-picture1{
    width: 92%;        /* nearly full-bleed with padding */
    max-width: 360px;  /* keep it visually balanced */
  }
}