/* ============================================================
   Messdaten order form — page-specific styles
   (loaded in addition to stammdaten-form.css)
   ============================================================ */

/* ---------- fieldset / legend ---------- */
.choice-group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.choice-group legend {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
  margin-left: 3px;
  padding: 0;
  color: var(--text);
}
.choice-group legend .req { margin-left: 3px; }

/* ---------- radio / checkbox option rows ---------- */
.choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
}
.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--inexogy-green);
  cursor: pointer;
}

/* ---------- OBIS-Codes: vertikale Liste (Checkbox | Code | Beschreibung) ---------- */
.obis-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: 0 32px;
}
@media (max-width: 560px) {
  .obis-list {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
  }
}
.obis-option {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}
.obis-option:hover {
  background-color: rgba(255, 255, 255, 0.06);
}
:root[data-theme="light"] .obis-option:hover {
  background-color: rgba(0, 0, 0, 0.05);
}
.obis-option input {
  width: 26px;
  height: 26px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--inexogy-green);
  cursor: pointer;
}
.obis-code {
  flex: 0 0 auto;
  min-width: 56px;
  font-weight: 600;
  text-align: center;
}
.obis-desc {
  flex: 1 1 auto;
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------- Messdatenart: Boxen über die volle Breite (statt Radios) ---------- */
.seg-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.seg-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 16px;
  border: 1px solid var(--border-field);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
/* the buttons are <label>s, so reset the inherited `.field label` margins
   (margin-bottom:6px left a gap above the date box; margin-left:3px shifted
   the first button off the box's left edge). Specificity must beat `.field label`. */
.seg-options .seg-btn { margin: 0; }
/* flush boxes: collapse adjacent borders, round only the top outer corners
   (the bottom connects to the date box below) */
.seg-btn:not(:first-child) { margin-left: -1px; }
.seg-btn:first-child { border-top-left-radius: 7px; }
.seg-btn:last-child { border-top-right-radius: 7px; }
/* Radio bleibt im DOM (Submit + JS-Toggle), nur visuell ausgeblendet */
.seg-btn input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.seg-btn:hover { border-color: var(--inexogy-green); z-index: 1; }
.seg-btn:has(input:checked) {
  background: var(--inexogy-green);
  border-color: var(--inexogy-green);
  color: #15171A;
  z-index: 2;
}
.seg-btn:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(133, 190, 0, .18); }

/* ---------- conditional date box: visual extension of the seg-options bar ---------- */
.type-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;          /* top-align so a field with an error below stays put */
  justify-content: center;
  gap: 18px 56px;
  border: 1px solid var(--border-field);
  border-top: none;                 /* the bar's bottom edge doubles as the box's top */
  border-radius: 0 0 7px 7px;
  padding: 20px;
  background: var(--mako-bg);
}
.type-fields[hidden] { display: none; }
/* von/bis sit next to each other */
.type-fields-row {
  display: flex;
  justify-content: center;
  gap: 56px;
}
/* each field is a column: the label+input line on top, the error centered beneath it */
.type-fields .field { align-items: center; }
.type-fields .date-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.type-fields .date-line label { margin: 0; white-space: nowrap; }
.type-fields .field input { width: auto; }   /* only as wide as its content */
/* error: own line, centered under its own label+input */
.type-fields .field-error-msg {
  justify-content: center;
  text-align: center;
  margin: 6px 0 0;
}

@media (max-width: 640px) {
  .seg-options { grid-template-columns: repeat(2, 1fr); }
  /* re-collapse borders + round outer corners for the 2x2 layout */
  .seg-btn { margin-left: 0; border-radius: 0; }
  .seg-btn:nth-child(even) { margin-left: -1px; }
  .seg-btn:nth-child(n+3) { margin-top: -1px; }
  .seg-btn:first-child { border-top-left-radius: 7px; }
  .seg-btn:nth-child(2) { border-top-right-radius: 7px; }
}
