/* =========================================
   XIS Base UI – clean optimized
   - Vars for easy tuning
   - Crisp typography
   - Navigation with dropdowns
   - Grid system
   - Form controls incl. buttons
========================================= */
:root{
  /* Sizing */
  --base-font: 18px;
  --form-font: 16px;
  --line-height: 1.6;
  --container-pad: 16px;
  --grid-gap: 16px;
  --radius: 8px;
  --ctrl-h: 48px;

  /* Colors */
  --text: #202020;
  --muted: #555;
  --border: #e5e7eb;
  --field-border: #ccc;
  --accent: #f00;
  --bg: #fff;
  --hover: #f3f4f6;

  /* Nav */
  --nav-h: 56px;
  --submenu-minw: 180px;
  --submenu-maxw: 320px;
}

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

html,body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial,sans-serif;
  font-size: var(--base-font);
  line-height: var(--line-height);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body{ padding-inline: 15px; }

h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 1.3rem 0 1rem;
  /* text-transform: uppercase; */
}

h4 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 1.3rem 0 1rem;
  /* text-transform: uppercase; */
}
h5 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.2rem 0 1rem;
  /* text-transform: uppercase; */
}
h6 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.2rem 0 1rem;
  color: var(--accent);
  /* text-transform: uppercase; */
}

 
h5 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.2rem 0 1rem;
}

h6 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.2rem 0 1rem;
  color: var(--accent);
}

h7 {
  font-size: 0.8rem;
  font-weight: 500;
  margin: 1.2rem 0 1rem;
}

.highlight, code .highlight, pre .highlight {
  color: var(--accent) !important;
}
p {
  font-size: var(--form-font);
}

/* =========================================
   Links
========================================= */
a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}
a:hover {
  opacity: 0.7;
}
a[disabled],
a.disabled {
  color: var(--muted);
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================================
   Navigation
========================================= */
.nav{
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  min-height: var(--nav-h);
  display:flex; align-items:center; justify-content:space-between;
}
.nav .logo{ display:flex; align-items:center; gap:8px; }
.nav .logo img{ height:32px; width:auto; }

.nav ul{
  display:flex; gap:24px; list-style:none; margin:0; padding:0; align-items:center;
}
.nav li{ position:relative; display:flex; align-items:center; }
.nav a{
  text-decoration:none; color:#333; font-weight:500; font-size:1rem;
  padding:0 4px; height:var(--nav-h); display:flex; align-items:center;
  border-radius:4px; transition:color .2s ease;
}
.nav a:hover,.nav a.active{ color:var(--accent); }
.nav a.active{ border-bottom:2px solid var(--accent); padding-bottom:0; }

/* --- Dropdowns (Untermenüs) --- */
.nav li ul{
  position:absolute; top:100%; left:0;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:6px;
  list-style:none; margin:0; padding:8px 0;
  min-width:var(--submenu-minw);
  max-width:min(90vw,var(--submenu-maxw));
  display:none; flex-direction:column; z-index:1000;
  box-shadow:0 6px 20px rgba(0,0,0,.08);
}

.nav li:hover>ul,
.nav li:focus-within>ul{ display:flex; }

/* Right-edge protection: last two items align dropdown to the right */
.nav>ul>li:last-child>ul,
.nav>ul>li:nth-last-child(2)>ul{ left:auto; right:0; }

.nav li ul li{ display:block; }
.nav li ul a{
  height:auto; padding:8px 16px; font-size:.95rem; display:block;
  color:#333; border-radius:0; line-height:1.4;
}
.nav li ul a:hover,
.nav li ul a:focus{ background:var(--hover); color:var(--accent); outline:none; }

/* Nested submenus: open to the side.
   For rightmost items, open to the left to avoid overflow */
.nav li li{ position:relative; }
.nav li li>ul{ top:0; left:100%; }
.nav>ul>li:last-child li>ul,
.nav>ul>li:nth-last-child(2) li>ul{ left:auto; right:100%; }

/* Reduced motion: no shadows/animations for sensitive users */
@media (prefers-reduced-motion: reduce){
  .nav a{ transition:none; }
  .nav li ul{ box-shadow:none; }
}

/* Mobile: stack menu; dropdowns flow inline */
@media (max-width: 900px){
  .nav ul{ gap:12px; flex-wrap:wrap; }
  .nav li ul{
    position:static; border:none; box-shadow:none;
    display:none; padding:4px 0; min-width:0; max-width:100%;
  }
  .nav li:hover>ul, .nav li:focus-within>ul{ display:block; }
}

/* =========================================
   Grid System (2–11 cols) – aligned tops
========================================= */
.wrapper {
    width: 100%;
    max-width: 1300px;
    padding: 0 25px;
    margin: 0 auto;
}
.col2,.col3,.col4,.col5,.col6,.col7,.col8,.col9,.col10,.col11{
    padding: var(--container-pad) calc(var(--container-pad)/2);
    display:grid; gap:var(--grid-gap); align-items:start;
}
.col2  { grid-template-columns: repeat(2, minmax(0,1fr)); }
.col3  { grid-template-columns: repeat(3, minmax(0,1fr)); }
.col4  { grid-template-columns: repeat(4, minmax(0,1fr)); }
.col5  { grid-template-columns: repeat(5, minmax(0,1fr)); }
.col6  { grid-template-columns: repeat(6, minmax(0,1fr)); }
.col7  { grid-template-columns: repeat(7, minmax(0,1fr)); }
.col8  { grid-template-columns: repeat(8, minmax(0,1fr)); }
.col9  { grid-template-columns: repeat(9, minmax(0,1fr)); }
.col10 { grid-template-columns: repeat(10, minmax(0,1fr)); }
.col11 { grid-template-columns: repeat(11, minmax(0,1fr)); }

.span1{ grid-column:span 1; }
.span2{ grid-column:span 2; }
.span3{ grid-column:span 3; }
.span4{ grid-column:span 4; }
.span5{ grid-column:span 5; }
.span6{ grid-column:span 6; }
.span7{ grid-column:span 7; }
.span8{ grid-column:span 8; }
.span9{ grid-column:span 9; }

[class^="col"] > :not(input):not(select):not(textarea){
  display:flex; flex-direction:column; gap:8px; margin:0; align-items:stretch;
}
[class^="col"] > input,
[class^="col"] > select,
[class^="col"] > textarea{ margin:0; }

/* =========================================
   Form Controls (inkl. Buttons)
========================================= */
form {
  font-size: var(--form-font);
}
legend {
    color: var(--muted);
    font-size: var(--form-font);
}
input,select,textarea{
  display:block;
  font-size:1rem; line-height:1.2;
  height:var(--ctrl-h);
  padding:10px 12px;
  border:1px solid var(--field-border);
  border-radius:var(--radius);
  background:var(--bg); color:var(--text);
  width:100%;
  font-size: var(--form-font);
}
textarea {
    height:auto; 
    min-height: 120px; 
    resize:vertical;
}
fieldset {
    border: 1px solid var(--field-border);
    border-radius:var(--radius);
    font-size: var(--form-font);
}
label{
    display: inline-block;
    font-size:.8rem; 
    font-weight: 700;
    line-height:1.25; 
    color:var(--muted); 
    margin: 0 0 15px 0;
}
input[type="checkbox"], input[type="radio"] {
    width: 18px;
	height: 18px;
	margin: 8px 5px -2px 15px;
    background-color: #000;
	border: 1px solid #fff;
	border-radius: 2px;
	display: inline-block;
	cursor: pointer;
}

input[type="checkbox"] + label, input[type="radio"] + label {
  margin: 0 0 -30px 0;
  font-size:.9rem; 
  font-weight: 400;
}

input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px color-mix(in oklab, var(--accent) 15%, transparent);
  transition:border-color .15s, box-shadow .15s;
}

/* Buttons */
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  height: var(--ctrl-h);
  padding: 0 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
  background: color-mix(in srgb, var(--accent) 85%, black);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
button:active,
input[type="submit"]:active {
  background: color-mix(in srgb, var(--accent) 75%, black);
}
button:disabled,
input[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/* Neutraler Sekundär-Button */
.button-secondary {
  background: #e5e7eb;
  color: #111;
}
.button-secondary:hover {
  background: #d1d5db;
}

/* =========================================
   Code
========================================= */

code {
  display: inline;
  padding: 2px 6px;
  color: var(--text);
  background-color: #eee;
  border-radius: 4px;
  font-size: 0.97em;
}
pre > code {
  display: block;
  width: 100%;
  margin: 15px 0;
  padding: 15px !important;
  color: var(--text);
  hyphens: auto !important;
  background-color: #eee;
  border:1px solid var(--field-border);
  border-radius: var(--radius);
  font-size: var(--form-font);
  overflow-x: auto;
  white-space: pre;
}

/* =========================================
   Sidebar
========================================= */
    .contenttable {
      width: 310px;
      padding: 20px 50px 0 0;
      float: left;
    }
    .contenttable ul {
      margin: 0 0 18px 0;
      padding: 0;
    }
    .contenttable ul ul {
      margin: 4px 0 4px 18px;
      padding-left: 14px;
      border-left: 1.5px solid #eee;
    }
    .contenttable ul li {
      margin: 0 0 4px 0;
      list-style: none;
      font-size: 0.8rem;
    }
    .contenttable ul ul li {
      margin: 0 0 2px 0;
      font-size: 0.78rem;
    }
    .contenttable ul li a {
      text-decoration: none;
      color: var(--text);
      padding-left: 0;
      transition: color .15s;
    }
    .contenttable ul ul li a {
      padding-left: 6px;
      font-weight: 400;
    }
    .contenttable ul li a:hover {
        color: var(--accent);
    }
    .maincontent {
      width: calc(100% - 360px);
      font-size: var(--form-font);
      float: right;
      padding-right: 50px;
    }

/* =========================================
   Panels
========================================= */
    .warning, .tipp, .message {
      width: calc(100%-20px);
      margin: 20px 0;
      padding: 20px 20px 20px 30px;
      color: var(--text);
      border: 1px solid #ccc;
      border-left: 10px solid var(--accent);
      background-color: #fff5f5;
      border-radius: var(--radius);
      font-size: 0.8rem;
      font-weight: 400;
    }
    .tipp {
      border-left: 10px solid green;
      background-color: #f6fcf7;
    }
    .message {
      border-left: 10px solid #000d86;
      background-color: #f4f5ff;
    }

/* =========================================
   Responsive
========================================= */
@media (max-width:640px){
  :root{ --base-font: 17px; }
  h1{ font-size: 2rem; }
  .contenttable {
    display: none
  }
}
/* Container für jedes Feld */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

/* Standard Input */
.form-field input {
  border: 1px solid var(--field-border);
}

/* Fehlerzustand */
.form-field.error input {
  border-color: #dc2626; /* Rot */
  background: #fef2f2;   /* zartes Rot */
}
.form-field.error label {
  color: #dc2626;
}

/* Kurztext unter dem Feld */
.form-error {
  font-size: 0.8rem;
  color: #dc2626;
  line-height: 1;
  margin: 0 0 -6px 0;
}

/* Globale Meldung oben im Formular */
.form-error-global {
  /*background: #fef2f2;
  border: 1px solid #dc2626;*/
  color: #b91c1c;
  /*padding: 12px 16px;*/
  border-radius: var(--radius);
  margin: 20px 0 0 0;
  font-size: 0.95rem;
}

/* Container fixiert oben rechts */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  pointer-events: none;
}

/* Toast-Grundstil */
.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  color: #fff;
  font-size: 0.95rem;
  animation: fadein 0.3s ease, fadeout 0.3s ease 4.7s forwards;
  min-width: 240px;
  max-width: 340px;
}

/* Fehler-Toast */
.toast.error {
  background: #dc2626;
}

/* Erfolg (falls du es nutzen willst) */
.toast.success {
  background: #16a34a;
}

/* Warnung */
.toast.warning {
  background: #d97706;
}

/* Keyframes für sanftes Ein-/Ausblenden */
@keyframes fadein {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeout {
  to { opacity: 0; transform: translateY(-10px); }
}

/* =========================================
   Reference Tables
========================================= */
.reference-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.reference-table thead {
  background-color: #f8f9fa;
}

.reference-table th,
.reference-table td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
  font-size: var(--form-font);
}

.reference-table th {
  font-weight: 600;
}

.reference-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.reference-table tbody tr:hover {
  background-color: var(--hover);
}

/* Column widths */
.reference-table .col-qualified {
  width: 35%;
}

.reference-table .col-simple {
  width: 20%;
}

.reference-table .col-description {
  width: 45%;
}


    width: 100%;
    float: none;
    padding-right: 0;
    box-sizing: border-box;
  }

  /* Wrapper / Body-Padding an Mobilansicht anpassen */
  body {
    padding-inline: 12px;
  }
  .wrapper {
    padding: 0 12px;
    max-width: 100%;
  }
}