/* =============================================================
   responsive.css — sms4.de responsive modernization layer
   Overrides the fixed 950px layout in main.css / styles-sms.css /
   styles-fax.css. Desktop layout is preserved; mobile/tablet are
   new. This file is loaded AFTER the existing stylesheets.
   ============================================================= */

/* ---- CSS Custom Properties --------------------------------- */
:root {
  --color-primary-sms: #0981a7;
  --color-primary-sms-hover: #1bacda;
  --color-primary-sms-dark: #005B7F;
  --color-primary-fax: #f47626;
  --color-primary-fax-hover: #e06015;
  --color-nav-bg: #004e6e;
  --color-subnav-bg: #e8f4f8;
  --color-border: #e1e1e0;
  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, Verdana, sans-serif;
  --font-base: 14px;
  --max-width: 1200px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
}

/* ---- Global Reset ------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ---- Base typography --------------------------------------- */
body {
  font-size: var(--font-base);
  font-family: var(--font-family);
  line-height: 1.5;
}

h1 { font-size: 1.4rem; padding-bottom: 8px; }
h2 { font-size: 1.15rem; padding-bottom: 6px; }
h3, h4 { font-size: 1rem; padding-bottom: 4px; }
p { line-height: 1.6; padding-bottom: 10px; }

/* All images responsive by default */
img {
  max-width: 100%;
  height: auto;
}

/* ---- Fluid page wrapper ------------------------------------ */
#page {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---- Header ----------------------------------------------- */
#head {
  width: 100%;
  background-image: none;
  background-color: var(--color-nav-bg);
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  position: relative;
}

/* Logo */
#head > a:first-child {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  flex-shrink: 0;
}
#head > a:first-child img {
  max-width: 200px;
  height: auto;
}

/* ---- Top links (lang + login) ------------------------------ */
#toplinks {
  width: auto;
  flex: 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
}

#lang {
  float: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 0;
}

#login, #logout, #company {
  float: none;
  clear: none;
  padding: 0 4px;
}

/* Logged-in status text in header */
#logout,
#logout p,
#logout a,
#company,
#company p {
  color: #fff !important;
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  text-align: right;
}
#logout a {
  color: rgba(255,255,255,0.75) !important;
  text-decoration: underline;
}
#logout a:hover { color: #fff !important; }

/* Login button */
a#b-login {
  display: inline-flex !important;
  align-items: center;
  background-image: none !important;
  background-color: #fff !important;
  color: var(--color-nav-bg, #004e6e) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 6px 16px !important;
  height: auto !important;
  width: auto !important;
  border-radius: 4px;
  text-decoration: none !important;
  border: 2px solid rgba(255,255,255,0.85);
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
a#b-login:hover {
  background-color: var(--color-primary-sms, #0981a7) !important;
  color: #fff !important;
  border-color: transparent;
}

/* ---- Navigation (dropdown) -------------------------------- */

/* Override aggressive legacy main.css #nav-main rules */
#nav-main {
  float: none !important;
  width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  background-image: none !important;
  background-color: var(--color-nav-bg) !important;
  overflow: visible !important;
  order: 3;
  position: relative;
  z-index: 500;
  display: flex !important;
  align-items: center;
}

/* Override aggressive legacy `#nav-main a` rule */
#nav-main a {
  float: none !important;
  width: auto !important;
  text-transform: none !important;
  text-decoration: none;
}

/* Hamburger button (hidden on desktop, shown on mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 4px;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 13px;
  z-index: 600;
  transition: background-color 0.15s ease;
}
.nav-toggle:hover { background-color: rgba(255,255,255,0.15); }

/* Top-level list */
.nav-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
}

.nav-list > li {
  position: relative;
  float: none !important;
}

/* Top-level links */
.nav-list > li > a {
  display: flex !important;
  align-items: center;
  float: none !important;
  width: auto !important;
  height: auto !important;
  padding: 12px 16px !important;
  font-size: 13px !important;
  font-weight: 600;
  color: #fff !important;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: nowrap;
  gap: 4px;
  transition: background-color 0.15s ease;
}
.nav-list > li > a:hover,
.nav-list > li.active > a {
  background-color: rgba(255,255,255,0.18) !important;
  text-decoration: none !important;
  color: #fff !important;
}

/* CTA: Neuanmeldung */
.nav-cta-item { margin-left: auto; }
.nav-cta-item > a { background-color: #e49000 !important; font-weight: 700 !important; }
.nav-cta-item > a:hover { background-color: #f0aa20 !important; }

/* Arrow icons */
.nav-arrow, .nav-arrow-r { font-size: 9px; opacity: 0.7; }

/* ---- Dropdown panel --------------------------------------- */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #c8dde8;
  border-top: 3px solid var(--color-primary-sms, #0981a7);
  box-shadow: 0 6px 20px rgba(0,0,0,0.14);
  list-style: none !important;
  margin: 0 !important;
  padding: 4px 0 !important;
  z-index: 1000;
}
.has-sub:hover > .nav-dropdown { display: block; }

.nav-dropdown li {
  position: relative;
  display: block;
  float: none !important;
}

/* Dropdown item links — use high-specificity selector to beat `#nav-main a` */
#nav-main .nav-dropdown li > a {
  display: block !important;
  float: none !important;
  width: auto !important;
  padding: 9px 18px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #222 !important;
  text-decoration: none !important;
  text-transform: none !important;
  background-color: transparent;
  transition: background-color 0.1s ease, color 0.1s ease;
}
#nav-main .nav-dropdown li > a:hover,
#nav-main .nav-dropdown li.active > a {
  background-color: #e8f4f8 !important;
  color: var(--color-primary-sms, #0981a7) !important;
}

/* Second-level fly-out (Logfiles) */
.nav-dropdown-sub {
  top: 0;
  left: 100%;
  border-top-color: #6dbdd5;
}

/* ---- Wrap & content area ---------------------------------- */
#wrap {
  width: 100%;
  background-image: none;
  background-color: #fff;
  border-top: 2px solid #fff;
}

#cwrap {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  margin-top: 18px;
  padding: 0 16px;
  border-left: none;
  border-right: none;
}

/* Decorative divs — no longer needed with CSS borders */
#content-top,
#content-bottom {
  display: none;
}

/* ---- Sidebar ---------------------------------------------- */
#sidebar {
  width: 230px;
  min-width: 230px;
  flex-shrink: 0;
  padding: 0 16px 0 0;
}

/* Sidebar chatbot iframe */
#sidebar iframe {
  width: 100%;
  max-width: 250px;
}

/* Sidebar boxes — remove background-image, use clean CSS */
.box1-top,
.box1-bottom,
.box2-top,
.box2-bottom,
.box3-top,
.box3-bottom,
.boxs-top,
.boxs-bottom {
  background-image: none;
  height: auto;
  min-height: 0;
}

.box1 {
  background-image: none;
  background-color: #f7f9fa;
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 4px;
}

.box2-top {
  background-image: none;
  background-color: transparent;
  padding: 10px 4px 4px;
  width: 100%;
  height: auto;
}

.box2 {
  background-image: none;
  background-color: #f0f9fc;
  border-left: 3px solid var(--color-primary-sms);
  border-radius: 0 4px 4px 0;
  padding: 10px 12px;
  width: 100%;
}

.box2-bottom {
  height: 8px;
  background-image: none;
}

.box3 {
  background-image: none;
  background-color: #f0f9fc;
  border-left: 3px solid #6dbdd5;
  padding: 10px 12px;
  width: 100%;
}

.boxs {
  background-image: none;
  background-color: #e8f4f8;
  border-radius: 4px;
  padding: 8px 12px;
  width: 100%;
  line-height: 1.7;
}

/* ---- Main content area ------------------------------------ */
#content {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 0 0 0 20px;
  border-left: 1px solid var(--color-border);
  border-right: none;
  background-color: #fff;
}

/* ---- Footer ----------------------------------------------- */
#foot {
  width: 100%;
  background-image: none;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  padding: 14px 20px;
  height: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

#footlink {
  width: auto;
  float: none;
}

#foot a {
  color: var(--color-primary-sms);
  text-decoration: none;
}
#foot a:hover {
  text-decoration: underline;
}

/* ---- Form improvements ------------------------------------ */
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="tel"],
form input[type="number"],
form select,
form textarea {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #DBDBDB;
  border-radius: 3px;
  transition: border-color 0.15s ease;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--color-primary-sms);
  box-shadow: 0 0 0 2px rgba(9,129,167,0.15);
}

form .submit,
form input[type="submit"],
input.submit {
  padding: 7px 20px;
  font-size: 14px;
  border-radius: 3px;
  cursor: pointer;
  background-color: var(--color-primary-sms);
  color: #fff;
  border: none;
  font-weight: bold;
  transition: background-color 0.15s ease;
}

form .submit:hover,
form input[type="submit"]:hover,
input.submit:hover {
  background-color: var(--color-primary-sms-hover);
  color: #fff;
}

/* ---- Responsive data tables ------------------------------- */
table.list,
table.grid {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* ---- Code blocks ------------------------------------------ */
pre.code {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}

/* ---- Utility spacing -------------------------------------- */
.hspace20 { height: 20px; }
.hspace5  { height: 5px;  }

/* =============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================= */

/* ---- Tablet: 769px – 1024px ------------------------------- */
@media screen and (max-width: 1024px) {
  #page {
    padding: 0;
  }

  #cwrap {
    padding: 0 12px;
  }

  #sidebar {
    width: 200px;
    min-width: 200px;
  }
}

/* ---- Mobile: <= 768px ------------------------------------- */
@media screen and (max-width: 768px) {

  /* Show hamburger */
  .nav-toggle {
    display: block;
    margin: 8px 12px;
  }

  /* Make nav a column so button sits above collapsed list */
  #nav-main {
    flex-wrap: wrap !important;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 !important;
  }

  /* Nav list collapses to vertical on mobile */
  .nav-list {
    display: none !important;
    flex-direction: column !important;
    width: 100% !important;
    background-color: var(--color-nav-bg);
  }
  .nav-list.nav-open { display: flex !important; }

  .nav-list > li > a {
    padding: 13px 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 15px !important;
  }

  /* Dropdowns: static, dark overlay on mobile */
  .nav-dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    border-top: none;
    background-color: rgba(0,0,0,0.18);
    padding: 0;
  }
  .has-sub.sub-open > .nav-dropdown { display: block; }

  #nav-main .nav-dropdown li > a {
    color: #ddd !important;
    padding: 9px 16px 9px 32px !important;
    background-color: transparent !important;
  }
  #nav-main .nav-dropdown li > a:hover {
    background-color: rgba(255,255,255,0.1) !important;
    color: #fff !important;
  }

  /* Third level: deeper indent */
  .nav-dropdown .nav-dropdown-sub {
    position: static;
    left: 0; top: 0;
    background-color: rgba(0,0,0,0.12);
  }
  #nav-main .nav-dropdown .nav-dropdown-sub li > a { padding-left: 48px !important; }

  .nav-cta-item { margin-left: 0; }

  /* Header stacks vertically */
  #head {
    flex-direction: column;
    align-items: flex-start;
  }

  #head > a:first-child {
    padding: 10px 12px;
  }

  #toplinks {
    width: 100%;
    justify-content: flex-start;
    padding: 4px 12px;
    background-color: rgba(0,0,0,0.15);
  }

  #lang { padding: 0 12px 0 0; }

  /* Content area stacks vertically */
  #cwrap {
    flex-direction: column;
    padding: 0 10px;
    margin-top: 12px;
  }

  #content {
    width: 100%;
    padding: 0;
    border-left: none;
    order: 1;
  }

  #sidebar {
    width: 100%;
    min-width: 0;
    padding: 16px 0 0 0;
    order: 2; /* sidebar below content */
    border-top: 1px solid var(--color-border);
  }

  /* Sidebar boxes full width */
  .box1, .box2, .box3, .boxs {
    width: 100%;
  }

  /* Footer stacked */
  #foot {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }

  #footlink {
    width: 100%;
    text-align: center;
  }

  /* Forms full width on mobile */
  form input[type="text"],
  form input[type="email"],
  form input[type="password"],
  form input[type="tel"],
  form input[type="number"],
  form select,
  form textarea {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Inline-styled tables */
  table[width] {
    width: 100% !important;
  }

  /* Pre/code blocks */
  pre.code {
    font-size: 12px;
  }
}

/* ---- Very small screens: <= 480px ------------------------- */
@media screen and (max-width: 480px) {
  h1 { font-size: 1.2rem; }
  h2 { font-size: 1.05rem; }

  .box1, .box2, .box3, .boxs {
    padding: 8px;
  }
}
