@font-face {
  font-family: Be Vietnam Pro;
  src: url(../fonts/BeVietnamPro-Regular.ttf);
}

:root {
  /* Farben nach Styleguide */
  --primary: #bcb9d9 !important;        /* Lila Primärfarbe */
  --primary-light: #bce4fa  !important;
  --secondary: #009ee3;  /* Hellblau Pastell als Akzent */
  --bg: #ffffff !important;             /* neutraler Hintergrund */
  --card-bg: #ffffff !important;
  --text: #000000 !important;           /* Texte in Schwarz */
  --text-muted: #243282 !important;     /* dunkles Blau statt graulila */
  --border: #e3e5ee !important;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --success: #00963e;        /* Grün Ursprung */
  --error: #dc2626;
}

body {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 2rem 1rem;
  min-height: 100vh;
  transition: background-color 0.4s ease;
}

header h1, h1 {
  font-size: 1.9rem;
  font-weight: 600;          /* Medium-ähnlich statt 700 */
  margin: 0 0 0.3rem;
  color: var(--primary);
}

h2{
   font-size: 1.5rem;
  font-weight: 600;          /* Medium-ähnlich statt 700 */
  margin: 0 0 0.3rem;
  color: var(--primary-light);
}

header p, .subtitle {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

header{
  margin-bottom: 25px;
}

/* ---------- Karten / Cards ---------- */

.card, .day-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem 1.8rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.card h2, .day-card h2 {
  font-size: 1.1rem;
  margin: 0 0 1.1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.day-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
}

.day-card .date-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

/* ---------- Formular-Layout ---------- */

.field-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.field {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------- Eingabefelder ---------- */

input[type="text"],
input[type="date"],
select,
textarea {
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fbfaff;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s;
  width: 100%;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-light);
}

input[readonly] {
  background: #ede9f7;
  color: var(--text-muted);
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

/* Sprachauswahl mit Flagge (index.html) */

.select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0 0.4rem 0 0.7rem;
}

.select-wrapper .flag {
  font-size: 1.2rem;
  margin-right: 0.3rem;
  pointer-events: none;
}

.select-wrapper select {
  padding: 0.65rem 0.6rem;
  border: none;
  background: transparent;
  cursor: pointer;
  outline: none;
  appearance: none;
  width: auto;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  position: fixed;
  margin: 0;
  padding: 0;
  bottom: 0px;
  left: 0px;
  width: 100%;
}

.controls input[type="date"] {
  width: auto;
  cursor: pointer;
  display: none;
}

/* ---------- Predigt-Bloecke ---------- */

.predigt-lang-block {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.predigt-lang-block:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.predigt-lang-block label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.flag-icon {
  font-size: 1.1rem;
}

.predigt-block {
  background: linear-gradient(135deg, var(--primary-light)11, transparent);
  border-left: 3px solid var(--primary-light);
  padding: 0.9rem 1.1rem;
  border-radius: 8px;
}

/* ---------- Lesungsbloecke (index.html) ---------- */

.reading-block {
  margin-bottom: 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.reading-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.reading-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  background: var(--secondary);
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
}

.reading-ref {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.reading-text {
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.65;
  margin-top: 0.6rem;
  color: var(--text);
}

/* ---------- Farbauswahl (editor.html) ---------- */

.color-options {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.color-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 20px;
  border: 2px solid var(--border);
  cursor: pointer;
  font-size: 0.85rem;
  background: #fff;
  transition: border-color 0.15s, transform 0.1s;
}

.color-chip:hover {
  transform: translateY(-1px);
}

.color-chip.selected {
  border-color: var(--primary);
  background: #f5f1ff;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

/* ---------- Buttons ---------- */

.btn-row {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

button {
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}

button:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}

/* ---------- Statusmeldungen ---------- */

.loading, .error, .info {
  text-align: center;
  padding: 2rem;
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.loading {
  color: var(--text-muted);
}

.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.status-message {
  text-align: center;
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  margin-top: 1rem;
  font-size: 0.9rem;
  display: none;
}

.status-message.success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
  display: block;
}

.status-message.error {
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
  display: block;
}

/* Einfache Statusanzeige fuer request-link.html */
#status {
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Spinner ---------- */

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- JSON-Vorschau ---------- */

pre#jsonPreview {
  background: #1e1b2e;
  color: #e2e0f5;
  padding: 1.2rem;
  border-radius: 12px;
  font-size: 0.82rem;
  overflow-x: auto;
  max-height: 400px;
}

.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ---------- Footer ---------- */

footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Kompakte Standalone-Seiten (request-link.html) ---------- */

.narrow-container {
  max-width: 480px;
  margin: 4rem auto;
  text-align: center;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-grid {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 90px 110px 80px 1fr;
  gap: 8px;
  align-items: center;
}

.field label {
  font-weight: 600;
}

.field select,
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.preview {
  min-height: 1.2em;
  font-size: 0.92rem;
  color: #666;
}

.hint {
  margin-top: 10px;
  font-size: 0.92rem;
  color: #666;
}

code {
  background: #f2f2f2;
  border-radius: 6px;
  padding: 1px 6px;
}


  .ref-grid {
    grid-template-columns: 1fr 90px 110px 80px;
  }

  .ref-grid input:last-child {
    grid-column: 1 / -1;
  }


@media (max-width: 800px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .ref-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ref-grid > *:first-child {
    grid-column: 1 / -1;
  }
}