/* ═══════════════════════════════════════════════════════════════
   Meeting-Protokoll Generator – style.css
   imifactory.ch © 2026
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --c-navy:    #05263d;
  --c-blue:    #0b3c5d;
  --c-blue-md: #1565a0;
  --c-teal:    #00897b;
  --c-teal-lt: #00bfae;
  --c-red:     #e53935;
  --c-red-dk:  #c62828;

  --c-bg:      #f4f6f8;
  --c-surface: #ffffff;
  --c-border:  #dce3ea;
  --c-border-focus: #0b3c5d;

  --c-text:    #1e2a35;
  --c-text-md: #3d5166;
  --c-text-lt: #6b7f90;
  --c-label:   #4e6375;

  --c-header-bg:    #0b3c5d;
  --c-header-text:  #ffffff;
  --c-row-alt:      #f7fafd;
  --c-row-hover:    #eef4fb;
  --c-traktand-bg:  #f8fafc;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
  --shadow:    0 3px 10px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.09);

  --font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: 'Cascadia Code', Consolas, monospace;
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--c-bg);
  margin: 0;
  color: var(--c-text);
  line-height: 1.6;
  font-size: 15px;
}

/* ── Header ────────────────────────────────────────────────────── */
header {
  background: var(--c-navy);
  padding: 14px 28px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.sitename {
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.01em;
}
.sitename img { height: 30px; width: auto; }

.breadcrumb {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}
.breadcrumb a { color: rgba(255,255,255,.8); text-decoration: none; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb strong { color: rgba(255,255,255,.9); }

/* ── Layout ────────────────────────────────────────────────────── */
.container {
  max-width: 980px;
  margin: 28px auto;
  padding: 0 20px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  text-decoration: none;
  color: var(--c-blue);
  font-size: 13px;
  font-weight: 600;
  transition: color .15s;
}
.back-link:hover { color: var(--c-teal); }

/* ── Intro Banner ──────────────────────────────────────────────── */
.imi-intro {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-blue);
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.imi-intro-icon {
  font-size: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}
.imi-intro h2 {
  margin: 0 0 6px;
  color: var(--c-blue);
  font-size: 18px;
  font-weight: 700;
}
.imi-intro p {
  font-size: 14px;
  color: var(--c-text-md);
  margin: 0;
}

/* ── Content Boxes ─────────────────────────────────────────────── */
.content-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.box-header {
  background: var(--c-blue);
  color: var(--c-header-text);
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.box-header-icon { font-size: 15px; }

/* Subtle variant for privacy section */
.content-box-subtle { opacity: .9; }
.box-header-subtle {
  background: #445e72;
  font-size: 12px;
}

.box-body { padding: 22px 24px; }

/* ── Grid Layouts ──────────────────────────────────────────────── */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.full-width { grid-column: 1 / -1; }

/* ── Form Elements ─────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-label);
  margin-bottom: 5px;
  letter-spacing: .02em;
  text-transform: uppercase;
}
label .required { color: var(--c-red); }

input[type=text],
input[type=date],
input[type=time],
textarea,
select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: #fff;
  color: var(--c-text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--c-border-focus);
  box-shadow: 0 0 0 3px rgba(11,60,93,.1);
}
input.invalid, select.invalid, textarea.invalid {
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px rgba(229,57,53,.1);
}
textarea { resize: vertical; }

.time-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.time-sep { color: var(--c-text-lt); font-weight: 600; text-align: center; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  transition: all .15s;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--c-teal-lt); outline-offset: 2px; }

.btn-primary  { background: var(--c-blue); color: #fff; }
.btn-primary:hover  { background: var(--c-blue-md); }

.btn-accent   { background: var(--c-teal); color: #fff; }
.btn-accent:hover   { background: #00796b; }

.btn-outline  { background: transparent; color: var(--c-blue); border: 1.5px solid var(--c-blue); }
.btn-outline:hover  { background: var(--c-blue); color: #fff; }

.btn-danger   { background: var(--c-red); color: #fff; }
.btn-danger:hover   { background: var(--c-red-dk); }

.btn-ghost    { background: transparent; color: var(--c-text-lt); border: 1.5px solid var(--c-border); }
.btn-ghost:hover    { background: var(--c-row-alt); color: var(--c-text-md); border-color: #b0bec5; }

.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Validation ────────────────────────────────────────────────── */
.validation-banner {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-left: 4px solid #f9a825;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #5d4037;
}
.validation-banner ul {
  margin: 6px 0 0 18px;
  padding: 0;
}
.validation-banner li { margin-bottom: 2px; }

/* ── Participants ──────────────────────────────────────────────── */
.table-header {
  display: grid;
  gap: 8px;
  padding: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-lt);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 10px;
}
.participant-cols { grid-template-columns: 1fr 1fr 1fr 40px; }

.participant-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 40px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f0f3f6;
}
.participant-row:last-child { border-bottom: none; }

/* ── Traktanden ────────────────────────────────────────────────── */
.traktand {
  background: var(--c-traktand-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  position: relative;
}
.traktand:last-child { margin-bottom: 0; }

.traktand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-blue);
  background: #daeaf8;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.traktand-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

.sub-section { margin-top: 14px; }
.sub-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--c-label);
  letter-spacing: .05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sub-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

.decision-row {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.todo-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
/* Mobile labels for todo rows */
.todo-row .mobile-label,
.decision-row .mobile-label { display: none; }

.traktand-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
}

/* ── Empty Hints ───────────────────────────────────────────────── */
.empty-hint {
  font-size: 13px;
  color: var(--c-text-lt);
  text-align: center;
  padding: 20px 0 8px;
  margin: 0;
  font-style: italic;
}

/* ── Export Progress ───────────────────────────────────────────── */
#exportProgress {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--c-blue);
  font-weight: 600;
  margin-top: 12px;
  padding: 10px 14px;
  background: #eef4fb;
  border-radius: var(--radius-sm);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #c8d8e8;
  border-top-color: var(--c-blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Preview ───────────────────────────────────────────────────── */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f0f4f8;
  border: 1px solid var(--c-border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.preview-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-lt);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.proto-preview {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 36px 42px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13.5px;
  line-height: 1.75;
  max-height: 650px;
  overflow-y: auto;
  color: #222;
}

/* Preview typography */
.proto-preview h1 {
  font-size: 22px;
  color: var(--c-blue);
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.proto-preview .preview-type {
  font-size: 12px;
  color: var(--c-text-lt);
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
}
.proto-preview h2 {
  font-size: 14px;
  color: var(--c-blue);
  border-bottom: 2px solid var(--c-blue);
  padding-bottom: 4px;
  margin-top: 28px;
  margin-bottom: 10px;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.proto-preview h3 {
  font-size: 13px;
  color: var(--c-text);
  margin: 16px 0 6px;
  font-family: var(--font);
  font-weight: 700;
}
.proto-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 8px 0 14px;
  font-family: var(--font);
}
.proto-preview th {
  background: var(--c-blue);
  color: #fff;
  padding: 7px 10px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.proto-preview td {
  padding: 6px 10px;
  border-bottom: 1px solid #eaedf0;
  vertical-align: top;
}
.proto-preview tr:nth-child(even) td { background: var(--c-row-alt); }
.proto-preview ul { margin: 4px 0 10px; padding-left: 20px; }
.proto-preview li { margin-bottom: 3px; }
.proto-preview p { margin: 4px 0 8px; }

.proto-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
  font-size: 12.5px;
  font-family: var(--font);
  background: var(--c-row-alt);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  margin: 0 0 16px;
}
.proto-meta b { color: var(--c-blue); }

.preview-footer {
  font-size: 11px;
  color: #aaa;
  margin-top: 28px;
  border-top: 1px solid #eee;
  padding-top: 10px;
  font-family: var(--font);
}

/* ── Privacy Section ───────────────────────────────────────────── */
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.privacy-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.privacy-icon { font-size: 22px; flex-shrink: 0; }
.privacy-item strong {
  display: block;
  font-size: 13px;
  color: var(--c-text-md);
  margin-bottom: 4px;
}
.privacy-item p {
  font-size: 12.5px;
  color: var(--c-text-lt);
  margin: 0;
  line-height: 1.55;
}
.privacy-item a { color: var(--c-blue); }

/* ── Footer ────────────────────────────────────────────────────── */
footer {
  text-align: center;
  font-size: 12.5px;
  color: #94a3b8;
  margin-top: 40px;
  padding-bottom: 32px;
}
footer a { color: var(--c-blue); text-decoration: none; margin: 0 8px; }
footer a:hover { color: var(--c-teal); }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 700px) {
  header { padding: 12px 16px; }
  .container { padding: 0 14px; }
  .box-body { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .privacy-grid { grid-template-columns: 1fr; }

  .participant-cols { display: none; }
  .participant-row {
    grid-template-columns: 1fr 40px;
    grid-template-rows: auto auto auto;
    row-gap: 6px;
  }
  .participant-row select { grid-column: 1; }
  .participant-row .btn { grid-row: 1; grid-column: 2; align-self: start; }

  .traktand-meta { grid-template-columns: 1fr; }

  .todo-row {
    grid-template-columns: 1fr 40px;
    grid-template-rows: auto auto auto;
    row-gap: 4px;
  }
  .todo-row .mobile-label { display: block; font-size: 10px; color: var(--c-label); font-weight: 600; }
  .todo-row input[type=date],
  .todo-row input[type=text]:nth-child(3) { grid-column: 1; }
  .todo-row .btn { grid-row: 1; grid-column: 2; align-self: start; }

  .proto-preview { padding: 20px 16px; }
  .proto-meta { grid-template-columns: 1fr; }

  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; justify-content: center; }
}
