/* ================================================================
   SchergenRegex – Styles
   Gleiche Farbwelt wie die übrigen Werkzeuge.
   ================================================================ */

:root {
  --bg:            #0e1016;
  --surface:       rgba(255, 255, 255, .045);
  --surface-2:     rgba(255, 255, 255, .075);
  --line:          rgba(255, 255, 255, .10);
  --line-soft:     rgba(255, 255, 255, .06);
  --text:          #e8ebf2;
  --text-dim:      #98a1b5;
  --accent:        #7aa2ff;
  --accent-strong: #5b86ff;
  --ok:            #2fd68b;
  --warn:          #ffc861;
  --off:           #ff5468;
  --radius:        16px;
  --shadow:        0 18px 45px rgba(0, 0, 0, .45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
code { font-family: var(--mono); font-size: .92em; }

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 12% -10%, #26304a 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #2a2140 0%, transparent 55%);
}

/* ----------------------------------------------------------------
   Buttons, Kopfzeile, Gerüst
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: .5rem .9rem;
  font: inherit;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover  { background: var(--surface-2); border-color: rgba(255,255,255,.18); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #0b1020;
  font-weight: 650;
}
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { background: transparent; }
.btn--sm    { padding: .35rem .7rem; font-size: .84rem; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .85rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(14, 16, 22, .72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar__brand { display: flex; align-items: center; gap: .6rem; font-weight: 650; }
.topbar__logo  { font-size: 1.25rem; }
.topbar__right { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.topbar__note  {
  color: var(--text-dim);
  font-size: .8rem;
  padding: .3rem .7rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem clamp(1rem, 2vw, 1.3rem) 1.2rem;
  margin-bottom: clamp(.9rem, 2vw, 1.2rem);
}
.card--input { box-shadow: var(--shadow); }
.card__head  { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: .8rem; }
.card__title { font-size: 1.05rem; }
.card__aside { font-size: .82rem; margin-left: auto; }
.card__head .btn { margin-left: auto; }

.sub {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin: 1.1rem 0 .5rem;
}
.hint { color: var(--text-dim); font-size: .82rem; margin: .9rem 0 0; }
.note { color: var(--text-dim); font-size: .84rem; margin: .6rem 0 0; }
.dim  { color: var(--text-dim); }


/* ----------------------------------------------------------------
   Meldungen, Haken, Beispielknöpfe
   ---------------------------------------------------------------- */
.status {
  margin: 1rem 0 0;
  padding: .55rem .8rem;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: .88rem;
}
.status--ok  { border-color: rgba(47,214,139,.4);  background: rgba(47,214,139,.10); color: #8ae9bf; }
.status--bad { border-color: rgba(255,84,104,.4);  background: rgba(255,84,104,.10); color: #ffc3ca; }
.status .dim { color: inherit; opacity: .75; }

.check {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  cursor: pointer;
  font-size: .9rem;
  margin-top: .3rem;
}
.check input { accent-color: var(--accent); margin-top: .25rem; flex: none; }
.check em { font-style: normal; color: var(--text-dim); font-size: .9em; }

.chip-btn {
  font: inherit;
  font-size: .8rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: .25rem .7rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.chip-btn:hover { color: var(--accent); border-color: rgba(122,162,255,.4); }

/* ----------------------------------------------------------------
   Eingabe
   ---------------------------------------------------------------- */
.einstellungen { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; margin-top: 1rem; }

.field { display: block; margin-bottom: .9rem; }
.field > span {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: .35rem;
}
.field select {
  width: 100%;
  padding: .55rem .8rem;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font: inherit;
}
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, .18);
}

.actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .8rem; }
.actions .hint { margin: 0 0 0 auto; }

.samples { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .9rem; }
.samples__label { font-size: .78rem; color: var(--text-dim); margin-right: .2rem; }

/* Zeilen, die nicht gelesen werden konnten */
.fehler {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  flex-wrap: wrap;
  padding: .35rem .7rem;
  margin-top: .4rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 200, 97, .3);
  background: rgba(255, 200, 97, .08);
  font-size: .84rem;
}
.fehler__text  { font-family: var(--mono); color: #ffdca0; }
.fehler__grund { color: var(--text-dim); }

/* ----------------------------------------------------------------
   Das Muster
   ---------------------------------------------------------------- */
#ergebnis[hidden] { display: none; }
.card--ergebnis { box-shadow: var(--shadow); }

.regex {
  margin: 0;
  padding: .9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(122, 162, 255, .35);
  background: rgba(122, 162, 255, .08);
  color: #dbe6ff;
  font-family: var(--mono);
  font-size: .95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
}

.variante {
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: .6rem .8rem;
  margin-bottom: .5rem;
  background: var(--surface-2);
}
.variante__kopf { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.variante__kopf .btn { margin-left: auto; }
.variante__code {
  display: block;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, .3);
  border-radius: 8px;
  padding: .4rem .6rem;
  overflow-wrap: anywhere;
  user-select: all;
}
.variante__hinweis { margin: .4rem 0 0; font-size: .8rem; color: var(--text-dim); }

/* ----------------------------------------------------------------
   Prüflisten
   ---------------------------------------------------------------- */
.pruefliste {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  margin-top: .8rem;
}
.pruefliste .note { margin: 0; padding: .45rem .8rem; background: rgba(0,0,0,.2); font-size: .82rem; }

.pruef {
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1.4fr) 7rem minmax(0, 1.6fr);
  gap: .7rem;
  align-items: baseline;
  padding: .35rem .8rem;
  border-top: 1px solid var(--line-soft);
  font-size: .84rem;
}
.pruef--kopf {
  border-top: 0;
  background: rgba(0, 0, 0, .25);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
}
.pruef__icon { font-weight: 700; text-align: center; }
.pruef__text { font-family: var(--mono); overflow-wrap: anywhere; }
.pruef__soll { color: var(--text-dim); white-space: nowrap; }
.pruef__warum { color: var(--text-dim); font-size: .8rem; }

.pruef--ok .pruef__icon      { color: var(--ok); }
.pruef--bad                  { background: rgba(255, 84, 104, .10); }
.pruef--bad .pruef__icon     { color: var(--off); }
.pruef--neutral .pruef__icon { color: var(--text-dim); }

/* ----------------------------------------------------------------
   Hinweise
   ---------------------------------------------------------------- */
.note-item {
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: .6rem .8rem;
  margin-bottom: .5rem;
  background: var(--surface-2);
}
.note-item__text { margin: .25rem 0 0; font-size: .85rem; color: var(--text-dim); }
.note-item--warn { border-color: rgba(255,200,97,.35);  background: rgba(255,200,97,.08); }
.note-item--warn strong { color: #ffdca0; }
.note-item--info strong { color: var(--text); }
#notes:empty { display: none; }

/* ----------------------------------------------------------------
   Testtext und Treffer
   ---------------------------------------------------------------- */
textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .3);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: .86rem;
  line-height: 1.6;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, .18);
}
textarea::placeholder { color: var(--text-dim); }

.field > span {
  display: block;
  font-size: .78rem;
  color: var(--text-dim);
  margin-bottom: .35rem;
}
.field input {
  width: 100%;
  padding: .6rem .8rem;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, .18);
}
#replaceBox[hidden] { display: none; }

/* ----------------------------------------------------------------
   Fußzeile und Meldung
   ---------------------------------------------------------------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  color: var(--text-dim);
  font-size: .8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}
.foot__sep { opacity: .5; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 140%);
  background: #1c2130;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .6rem 1rem;
  font-size: .87rem;
  box-shadow: var(--shadow);
  transition: transform .25s ease, opacity .25s;
  opacity: 0;
  z-index: 60;
  max-width: min(90vw, 460px);
  overflow-wrap: anywhere;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { border-color: rgba(255, 84, 104, .5); color: #ffc3ca; }

@media (max-width: 700px) {
  .topbar__note, .card__aside { display: none; }
  }

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