/* ===========================================================================
   CAMT.053 Konverter – zentrales Stylesheet
   Alle Farben/Abstaende als Tokens in :root. Wiederverwendbare Klassen,
   kein doppeltes Styling. UI-Vorlage: Design von uidesign.at (Amber-Akzent).
   =========================================================================== */
:root {
  /* Farben */
  --bg:          #f7f7f7;
  --surface:     #ffffff;
  --ink:         #333333;   /* Ueberschriften, Logo-Badge */
  --text:        #4a4a4a;
  --muted:       #7a7a7a;
  --muted-2:     #8c8c8c;
  --faint:       #a0a0a0;
  --border:      #e6e6e6;
  --border-soft: #f0f0f0;

  --accent:       #f2b74a;
  --accent-hover: #e0a83f;
  --accent-soft:  rgba(242, 183, 74, .15);

  --ok:      #2f8f5b;  --ok-fg: #256a45;  --ok-bg: #f2f9f5;  --ok-border: #cfe6d8;
  --err:     #c0563f;  --err-fg:#9c4433;  --err-bg:#fbf3f1;  --err-border:#eccdc6;

  /* Form / Radius / Typo */
  --radius-card: 12px;
  --radius:      8px;
  --radius-sm:   7px;
  --field-h:     44px;
  --font:      'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  --shadow-card: 0 1px 2px rgba(0,0,0,.03);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-hover); text-decoration: none; }
/* :not(.btn) - Buttons (auch als <a> gerendert, z.B. CTA-Links) behalten ihre eigene
   .btn-Textfarbe; sonst gewinnt diese Regel per Spezifitaet gegen ".btn-primary { color }". */
a:hover:not(.btn) { color: var(--accent); }
::selection { background: var(--accent); color: #fff; }

/* --- Layout --- */
.wrap       { max-width: 680px; margin: 0 auto; padding: 44px 32px 80px; animation: fadein .25s ease; }
.wrap-wide  { max-width: 960px; margin: 0 auto; padding: 44px 32px 80px; animation: fadein .25s ease; }
.center     { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }

@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes spin   { to { transform: rotate(360deg); } }

/* --- Brand / Logo --- */
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 18px; color: var(--ink); letter-spacing: -.01em; }
.brand .accent { color: var(--accent-hover); }
.brand .soft   { color: var(--muted); font-weight: 500; }
/* --- Topbar --- */
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; position: sticky; top: 0; z-index: 10;
}
.topbar .left  { display: flex; align-items: center; gap: 36px; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  height: 34px; display: inline-flex; align-items: center; padding: 0 14px;
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; color: var(--muted);
}
.nav a:hover { color: var(--ink); }
.nav a.active { background: #fbf1dc; color: #8a6410; }
.user-meta { text-align: right; line-height: 1.2; }
.user-meta .name { font-size: 13px; font-weight: 600; color: var(--ink); }
.user-meta .role { font-size: 12px; color: var(--muted-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #f5f5f5; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--muted);
}
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius); background: transparent;
  border: 1px solid var(--border); color: var(--muted); display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* --- Headings --- */
h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: -.015em; }
h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; color: var(--ink); }
.lead { margin: 0 0 22px; font-size: 15px; color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }

/* --- Card --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 28px; box-shadow: var(--shadow-card); margin-bottom: 20px;
}
.card.login { width: 100%; max-width: 400px; padding: 36px 36px 32px; }

/* --- Forms --- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--muted-2); margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; height: var(--field-h); padding: 0 13px; font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; font-family: inherit;
}
select { cursor: pointer; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { background: #f7f7f7; color: var(--muted); }
input::placeholder { color: #b0b0b0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 .full { grid-column: 1 / -1; }
.section-label { font-size: 13px; font-weight: 600; color: var(--ink); margin: 4px 0 14px; }

/* --- Buttons --- */
.btn {
  height: 46px; padding: 0 18px; border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 15px; font-weight: 600; letter-spacing: .01em; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #f6d79a; cursor: default; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-danger-ghost { background: #fff; color: var(--err-fg); border: 1px solid var(--err-border); }
.btn-danger-ghost:hover { background: var(--err-bg); }
.btn-ok-ghost { background: #fff; color: var(--ok-fg); border: 1px solid var(--ok-border); }
.btn-ok-ghost:hover { background: var(--ok-bg); }
.btn-link { background: none; border: none; padding: 0; color: var(--accent-hover); font-weight: 600; cursor: pointer; font-family: inherit; font-size: 14px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--err-fg); }
.divider-top { border-top: 1px solid var(--border-soft); margin-top: 26px; padding-top: 22px; }

/* --- Dropzone --- */
.dropzone {
  border: 2px dashed #dcdcdc; border-radius: 10px; padding: 40px 24px; text-align: center;
  background: #fbfbfb; cursor: pointer; transition: border-color .15s, background .15s; display: block;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #fffdf7; }
.dropzone .zicon {
  width: 48px; height: 48px; border-radius: 12px; background: #f7f7f7; border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.dropzone .zt   { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.dropzone .zs   { font-size: 14px; color: var(--muted-2); margin-bottom: 16px; }
.tag { padding: 3px 8px; background: #f5f5f5; border-radius: 5px; font-size: 12px; font-weight: 600; color: var(--faint); }
.tag.on { color: var(--muted); }

/* Ausgewaehlte Dateien */
.filelist { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.filechip {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 10px; background: #fbfbfb;
}
.filechip .ficon {
  width: 40px; height: 40px; border-radius: 9px; background: var(--ink);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.filechip .fmeta { flex: 1; min-width: 0; }
.filechip .fname { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filechip .fsize { font-size: 13px; color: var(--muted-2); }

/* --- Alerts / Flash --- */
.alert { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: 10px; margin-bottom: 20px; animation: fadein .25s ease; }
.alert .aicon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.alert .atitle { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.alert .atext { font-size: 14px; }
.alert.ok    { background: var(--ok-bg);  border: 1px solid var(--ok-border); }
.alert.ok    .aicon { background: #e2f1e8; } .alert.ok .atitle { color: var(--ok-fg); } .alert.ok .atext { color: #4f8368; }
.alert.error { background: var(--err-bg); border: 1px solid var(--err-border); }
.alert.error .aicon { background: #f6e0da; } .alert.error .atitle { color: var(--err-fg); } .alert.error .atext { color: #a86353; }

/* --- Table (Admin / Konten) --- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 13px 22px; background: #fafafa; border-bottom: 1px solid #eee;
  font-size: 12px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em;
}
tbody td { padding: 16px 22px; border-bottom: 1px solid #f2f2f2; font-size: 15px; color: var(--ink); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
td.email { font-size: 14px; color: var(--muted); }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.on  { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok); }
.badge.on  .dot { background: var(--ok); }
.badge.off { background: #f5f5f5; border: 1px solid var(--border); color: var(--muted-2); }
.badge.off .dot { background: #b0b0b0; }
.row-avatar { display: inline-flex; align-items: center; gap: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.spacer { height: 16px; }

/* --- Oeffentliche Seiten (Landing / Impressum / Datenschutz) ---
   Header/Footer-Layout gemeinsam in public_base.html, hier ein Satz Styles
   fuer alle drei Seiten - keine Duplikate zwischen Landing und Legal. */
.site-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 56px; }
.site-footer {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--border-soft);
  font-size: 13px; color: var(--muted-2); display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

.lang-switch { display: flex; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; }
.lang-switch button {
  border: none; background: transparent; color: var(--muted); padding: 6px 14px;
  border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.lang-switch button.on { background: var(--ink); color: #fff; }

/* Hero (Landing) */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero .eyebrow { font-size: 14px; font-weight: 700; color: var(--accent-hover); margin-bottom: 16px; letter-spacing: .03em; text-transform: uppercase; }
.hero h1 { font-size: 42px; line-height: 1.18; letter-spacing: -.02em; margin-bottom: 18px; }
.hero .lead { font-size: 18px; margin-bottom: 30px; }
.cta-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cta-row .hint { font-size: 13px; color: var(--muted-2); }

.demo-card { padding: 22px; }
.demo-lbl { font-size: 12px; color: var(--muted-2); margin-bottom: 7px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.demo-box {
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: var(--font-mono); font-size: 13px; color: var(--text);
  line-height: 1.7; overflow: hidden; white-space: nowrap;
}
.demo-box.out { border-color: var(--accent); color: var(--accent-hover); }
.demo-arrow { text-align: center; margin: 12px 0; color: var(--accent-hover); font-size: 20px; }

/* Feature-Grid (Landing) */
.features-grid {
  margin-top: 60px; padding-top: 32px; border-top: 1px solid var(--border-soft);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
}
.feat { display: flex; flex-direction: column; gap: 10px; }
.feat-icon {
  width: 40px; height: 40px; border-radius: var(--radius); background: var(--accent-soft);
  color: var(--accent-hover); display: flex; align-items: center; justify-content: center;
}
.feat-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.feat-text { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* Ruecklaeufer-Hinweis (Landing) - bewusst getrennt von der Haupt-CTA im Hero, damit
   "Zur App anmelden" nicht mit dem Interessenten-CTA "Zugang anfragen" verwechselt wird. */
.returning-cta {
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap; font-size: 14px; color: var(--muted);
}

/* Fliesstext-Spalte (Impressum / Datenschutz) - nutzt dieselbe .card-Klasse wie der Rest der App.
   Keine eigene max-width mehr: soll dieselbe Breite wie Hero/Features auf der Landingpage haben
   (beide stecken in .wrap-wide) - einheitliches Layout ueber alle drei oeffentlichen Seiten. */
.prose .lead { margin-bottom: 28px; }
.prose .card h2 { font-size: 15px; }
.prose .card p { font-size: 14px; color: var(--text); line-height: 1.65; }
.prose .card p + p { margin-top: 10px; }

@media (max-width: 860px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .hero h1 { font-size: 30px; }
  .site-header { margin-bottom: 40px; }
  .features-grid { grid-template-columns: 1fr; }
}
