@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/public/fonts/instrument-sans-latin.woff2') format('woff2'); }
/* RapidTools Widget-Basisstyles (iframe-Inhalt).
   Arbeitet AUSSCHLIESSLICH mit den --rt-* Design-Variablen (Fallback = Preset "Klar").
   Die Variablen setzt die Widget-Shell aus instance.config.design (src/core/themes.ts). */

:root {
  --rt-primary: #2563eb;
  --rt-on-primary: #ffffff;
  --rt-bg: #ffffff;
  --rt-input-bg: #ffffff;
  --rt-text: #1f2937;
  --rt-muted: #6b7280;
  --rt-border: #e5e7eb;
  --rt-border-strong: #d1d5db;
  --rt-border-width: 1px;
  --rt-surface: rgba(0, 0, 0, 0.04);
  --rt-radius: 10px;
  --rt-radius-sm: 8px;
  --rt-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
  --rt-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --rt-font-head: var(--rt-font);
  --rt-font-size: 16px;
  --rt-pad-card: 20px;
  --rt-title-weight: 700;
  --rt-title-transform: none;
  --rt-success-bg: #ecfdf5;
  --rt-success-border: #a7f3d0;
  --rt-success-text: #065f46;
  --rt-error-bg: #fef2f2;
  --rt-error-border: #fecaca;
  --rt-error-text: #991b1b;
  --rt-link: var(--rt-primary);
  --rt-color-scheme: light;
}

:root { color-scheme: var(--rt-color-scheme); font-size: var(--rt-font-size); }
a { color: var(--rt-link); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: transparent;
}

body {
  font-family: var(--rt-font);
  font-size: var(--rt-font-size);
  line-height: 1.55;
  color: var(--rt-text);
  -webkit-font-smoothing: antialiased;
}

/* ── Karte / Titel ───────────────────────────────────────────────────────── */

.rtw-card {
  background: var(--rt-bg);
  border: var(--rt-border-width) solid var(--rt-border);
  border-radius: var(--rt-radius);
  box-shadow: var(--rt-shadow);
  padding: var(--rt-pad-card);
  margin: 4px;
}

.rtw-title {
  font-family: var(--rt-font-head);
  font-size: 1.25rem;
  font-weight: var(--rt-title-weight);
  text-transform: var(--rt-title-transform);
  margin: 0 0 12px;
  letter-spacing: -0.2px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.rtw-btn {
  display: inline-block;
  background: var(--rt-primary);
  color: var(--rt-on-primary);
  border: 0;
  border-radius: var(--rt-radius-sm);
  padding: 12px 22px;
  font-size: var(--rt-font-size);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 1.3;
  transition: filter 0.12s ease;
}

.rtw-btn:hover { filter: brightness(0.9); }
.rtw-btn:active { filter: brightness(0.82); }
.rtw-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Formulare ───────────────────────────────────────────────────────────── */

.rtw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.rtw-field label {
  font-weight: 600;
  font-size: 0.9rem;
}

.rtw-field input,
.rtw-field select,
.rtw-field textarea {
  width: 100%;
  padding: 11px 13px;
  font-size: 16px; /* verhindert iOS-Zoom */
  font-family: inherit;
  color: var(--rt-text);
  background: var(--rt-input-bg);
  border: var(--rt-border-width) solid var(--rt-border-strong);
  border-radius: var(--rt-radius-sm);
}

.rtw-field textarea { min-height: 110px; resize: vertical; }

.rtw-field input:focus,
.rtw-field select:focus,
.rtw-field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--rt-primary) 40%, transparent);
  outline-offset: 0;
  border-color: var(--rt-primary);
}

/* ── Grid / Text-Utilities ───────────────────────────────────────────────── */

.rtw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

@media (max-width: 480px) {
  .rtw-grid { grid-template-columns: 1fr; }
}

.rtw-muted {
  color: var(--rt-muted);
  font-size: 0.9rem;
}

/* ── Statusmeldungen ─────────────────────────────────────────────────────── */

.rtw-success {
  background: var(--rt-success-bg);
  border: 1px solid var(--rt-success-border);
  color: var(--rt-success-text);
  border-radius: var(--rt-radius-sm);
  padding: 12px 15px;
  margin: 10px 0;
  font-size: 0.95rem;
}

.rtw-error {
  background: var(--rt-error-bg);
  border: 1px solid var(--rt-error-border);
  color: var(--rt-error-text);
  border-radius: var(--rt-radius-sm);
  padding: 12px 15px;
  margin: 10px 0;
  font-size: 0.95rem;
}

:focus-visible { outline: 2px solid var(--rt-link); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Native choice controls must not inherit the full text-input width. */
.rtw-field input[type="checkbox"], .rtw-field input[type="radio"] {
  width: 1.1em;
  height: 1.1em;
  min-width: 1.1em;
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--rt-primary);
}
label > input[type="checkbox"] + span, label > input[type="radio"] + span {
  min-width: 0;
  overflow-wrap: anywhere;
}
