/* Terminanfrage – Formular
   Nutzt die Farbvariablen des Themes, mit eigenen Rückfallwerten. */

.nhb {
  --b-accent: var(--c-sage, #3d7a5f);
  --b-accent-deep: var(--c-sage-deep, #1f5040);
  --b-accent-light: var(--c-sage-light, #e8f4ee);
  --b-accent-mid: var(--c-sage-mid, #a8d4bb);
  --b-ink: var(--c-ink, #1a1a18);
  --b-ink-soft: var(--c-ink-soft, #6b6b65);
  --b-border: var(--c-border, rgba(26,26,24,.10));
  --b-cream: var(--c-cream, #faf8f4);
  --b-error: #c0392b;

  font-family: var(--font-body, system-ui, sans-serif);
  color: var(--b-ink);
  max-width: 780px;
}

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

.nhb-intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--b-ink-soft);
  margin: 0 0 2rem;
}

/* --- Schritte ------------------------------------------------------------ */

.nhb-step {
  border: 1px solid var(--b-border);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 0 0 1.25rem;
  background: #fff;
  transition: opacity .25s;
}

.nhb-step[disabled] { opacity: .45; }

.nhb-step legend {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1rem;
  font-weight: 500;
  padding: 0 .5rem;
  margin-left: -.5rem;
}

.nhb-step-num {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--b-accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
}

/* --- Terminart ----------------------------------------------------------- */

.nhb-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .75rem;
  margin-top: 1.25rem;
}

.nhb-type {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  text-align: left;
  padding: 1rem 1.15rem;
  border: 1px solid var(--b-accent-mid);
  border-radius: 14px;
  background: #fff;
  font-family: inherit;
  color: var(--b-ink);
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s, box-shadow .18s;
}

.nhb-type:hover {
  background: var(--b-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(61,122,95,.10);
}

.nhb-type.is-active {
  background: var(--b-accent);
  border-color: var(--b-accent);
  color: #fff;
}

.nhb-type-label { font-size: .98rem; font-weight: 500; }

.nhb-type-time {
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--b-accent-deep);
}

.nhb-type.is-active .nhb-type-time { color: rgba(255,255,255,.85); }

.nhb-type-note {
  font-size: .78rem;
  line-height: 1.5;
  color: var(--b-ink-soft);
  margin-top: .15rem;
}

.nhb-type.is-active .nhb-type-note { color: rgba(255,255,255,.75); }

/* --- Kalender ------------------------------------------------------------ */

.nhb-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.25rem 0 .75rem;
}

.nhb-cal-title { font-size: 1rem; font-weight: 500; }

.nhb-nav {
  width: 34px; height: 34px;
  border: 1px solid var(--b-border);
  border-radius: 9px;
  background: none;
  cursor: pointer;
  color: var(--b-ink);
  font-size: .95rem;
  line-height: 1;
}

.nhb-nav:hover { background: var(--b-accent-light); border-color: var(--b-accent-mid); }

.nhb-weekdays,
.nhb-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.nhb-weekdays span {
  text-align: center;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--b-ink-soft);
  padding-bottom: .35rem;
}

.nhb-day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--b-cream);
  color: var(--b-ink-soft);
  font-size: .9rem;
  font-family: inherit;
  cursor: not-allowed;
  position: relative;
}

.nhb-day--free {
  background: #fff;
  border-color: var(--b-accent-mid);
  color: var(--b-ink);
  cursor: pointer;
  font-weight: 500;
}

.nhb-day--free::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 6px;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--b-accent);
}

.nhb-day--free:hover { background: var(--b-accent-light); }

.nhb-day.is-active {
  background: var(--b-accent);
  border-color: var(--b-accent);
  color: #fff;
}

.nhb-day.is-active::after { background: #fff; }

.nhb-legend {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1rem 0 0;
  font-size: .78rem;
  color: var(--b-ink-soft);
}

.nhb-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-left: .75rem;
}

.nhb-dot:first-child { margin-left: 0; }
.nhb-dot--free { background: var(--b-accent); }
.nhb-dot--none { background: var(--b-border); }

/* --- Zeitfenster --------------------------------------------------------- */

.nhb-slots {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.25rem;
  min-height: 44px;
}

.nhb-slot {
  border: 1px solid var(--b-accent-mid);
  background: #fff;
  border-radius: 100px;
  padding: .55rem 1.1rem;
  font-size: .9rem;
  font-family: inherit;
  color: var(--b-ink);
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}

.nhb-slot:hover { background: var(--b-accent-light); transform: translateY(-1px); }

.nhb-slot.is-active {
  background: var(--b-accent);
  border-color: var(--b-accent);
  color: #fff;
}

.nhb-hint { color: var(--b-ink-soft); font-size: .9rem; margin: 0; }

/* --- Gewählter Termin ---------------------------------------------------- */

.nhb-chosen {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem;
  background: var(--b-accent-light);
  border: 1px solid var(--b-accent-mid);
  border-radius: 12px;
  padding: .85rem 1.1rem;
  margin: 1.25rem 0 1.5rem;
  font-size: .92rem;
}

.nhb-chosen-label {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--b-accent-deep);
}

.nhb-reset {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--b-accent-deep);
  text-decoration: underline;
  cursor: pointer;
  font-size: .85rem;
  font-family: inherit;
}

/* --- Felder -------------------------------------------------------------- */

.nhb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.nhb-row--city { grid-template-columns: .8fr 1.4fr 1.1fr; }

.nhb-field { margin: 0 0 1.1rem; }

.nhb-field label,
.nhb-consent label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .35rem;
}

.nhb input[type="text"],
.nhb input[type="email"],
.nhb input[type="tel"],
.nhb select,
.nhb textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--b-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: .95rem;
  color: var(--b-ink);
  background: #fff;
}

.nhb input:focus,
.nhb select:focus,
.nhb textarea:focus {
  outline: 2px solid var(--b-accent-mid);
  outline-offset: 1px;
  border-color: var(--b-accent);
}

.nhb-field--invalid input,
.nhb-field--invalid textarea,
.nhb-field--invalid select { border-color: var(--b-error); }

.nhb-help--block {
  display: block;
  margin: -.5rem 0 1.4rem;
  padding: .6rem .85rem;
  background: var(--b-cream);
  border-radius: 8px;
  font-size: .8rem;
  color: var(--b-ink-soft);
  line-height: 1.6;
}

.nhb-help {
  display: block;
  font-size: .78rem;
  color: var(--b-ink-soft);
  margin-top: .4rem;
  line-height: 1.5;
}

.nhb-error {
  display: block;
  font-size: .8rem;
  color: var(--b-error);
  margin-top: .3rem;
}

.nhb-error--global:not(:empty) {
  padding: .75rem 1rem;
  background: #fdf0ed;
  border: 1px solid var(--b-error);
  border-radius: 10px;
  margin-top: 1rem;
}

/* --- Einwilligung -------------------------------------------------------- */

.nhb-consent { margin: 1.5rem 0 0; }

.nhb-consent label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem;
  align-items: start;
  font-weight: 400;
  font-size: .87rem;
  line-height: 1.6;
  color: var(--b-ink-soft);
}

.nhb-consent input { margin-top: .25rem; }
.nhb-consent a { color: var(--b-accent); }

/* Honigtopf – für Menschen unsichtbar. */
.nhb-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* --- Absenden ------------------------------------------------------------ */

.nhb-submit {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0 0;
}

.nhb-button {
  background: var(--b-accent);
  color: #fff;
  border: 0;
  border-radius: 100px;
  padding: .9rem 2rem;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
}

.nhb-button:hover:not(:disabled) {
  background: var(--b-accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(61,122,95,.3);
}

.nhb-button:disabled { opacity: .6; cursor: progress; }

.nhb-status { font-size: .85rem; color: var(--b-ink-soft); }

/* --- Bestätigung --------------------------------------------------------- */

.nhb-success {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--b-accent-light);
  border: 1px solid var(--b-accent-mid);
  border-radius: 16px;
  padding: 1.5rem;
}

.nhb-success-icon { color: var(--b-accent); flex-shrink: 0; }
.nhb-success-icon svg { width: 26px; height: 26px; display: block; }
.nhb-success-text { margin: 0; line-height: 1.7; color: var(--b-accent-deep); }


.nhb-success[hidden] { display: none !important; }
.nhb-form[hidden] { display: none !important; }

/* --- Schmale Bildschirme ------------------------------------------------- */

@media (max-width: 640px) {
  .nhb-row, .nhb-row--city { grid-template-columns: 1fr; gap: 0; }
  .nhb-step { padding: 1.15rem; }
  .nhb-submit { flex-direction: column; align-items: stretch; }
  .nhb-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .nhb * { transition: none !important; }
}
