/* ─────────────────────────────────────────────
   Faro Fiscal — Auth (Login / Setup / Reset / CSD)
   Cockpit-Design: dieselben Tokens wie das
   eingeloggte Portal (public/dashboard.html).
   ───────────────────────────────────────────── */
:root {
  --navy:    #1C3A5C;
  --green:   #14532D;
  --amber:   #78350F;
  --red:     #7F1D1D;
  --bg:      #F2EDE5;
  --surface: #FFFFFF;
  --text:    #1A2230;
  --muted:   #6B7280;
  --hairline:#E7E1D8;
  --tint-navy:  rgba(28,58,92,.08);
  --tint-green: rgba(20,83,45,.10);
  --tint-red:   rgba(127,29,29,.08);
  --card-shadow: 0 1px 2px rgba(0,0,0,.03);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Aliase für Inline-Styles in den Auth-Skripten */
  --ink: var(--text); --ink-2: var(--text); --body: var(--text);
  --line: var(--hairline); --line-2: #EFEAE1; --surface-2: #FFFFFF;
  --ingreso: var(--green); --egreso: var(--red); --teal: var(--navy);
  --radius-sm: 10px; --radius: 12px; --radius-lg: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
a { color: var(--navy); }
a:hover { color: #14273d; }
svg { display: block; }

/* ── Karte ── */
.card, .auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 32px 28px;
}
.auth-card.wide, .card.wide { max-width: 520px; }

/* ── Marke ── */
.auth-brand, .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-mark, .logo .auth-mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--navy);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.auth-mark svg { width: 26px; height: 26px; }
.auth-name, .logo-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.auth-role { font-size: 11px; color: var(--muted); font-weight: 500; }

h1 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; color: var(--text); margin-bottom: 6px; }
.subtitle, .auth-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; line-height: 1.6; }

/* ── Felder ── */
label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin: 16px 0 6px; }
.field { margin-bottom: 4px; }
input[type=email], input[type=password], input[type=text], input[type=tel] {
  width: 100%; height: 44px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 0 13px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--tint-navy); }
input::placeholder { color: #A6A093; }
.hint, .help { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Passwort mit Sichtbarkeits-Toggle ── */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle {
  position: absolute; right: 4px;
  width: 36px; height: 36px;
  border: none; border-radius: 9px; background: none;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.pw-toggle:hover { background: var(--tint-navy); color: var(--navy); }
.pw-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── Stärke-Prüfung ── */
.pw-meter { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pw-bars { display: flex; gap: 4px; }
.pw-bars span { flex: 1; height: 4px; border-radius: 999px; background: var(--hairline); transition: background .2s; }
.pw-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.pw-score { font-weight: 600; }

/* ── Buttons ── */
button, .btn, .btn-submit {
  width: 100%; height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 20px;
  background: var(--navy); color: #fff;
  border: 1px solid var(--navy); border-radius: 10px;
  font-family: var(--font); font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
button:hover, .btn:hover { background: #14273d; }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; }
button.pw-toggle { width: 36px; height: 36px; margin: 0; background: none; border: none; }
button.pw-toggle:hover { background: var(--tint-navy); }

/* ── Meldungen ── */
.msg, .alert, .error, .info-box {
  border-radius: 10px; padding: 11px 13px;
  font-size: 13px; line-height: 1.5;
  margin-top: 14px; display: none;
}
.msg.error, .msg-err, .alert.error, .error {
  background: var(--tint-red); border: 1px solid rgba(127,29,29,.18); color: var(--red);
}
.msg.ok, .msg-ok, .alert.success {
  background: var(--tint-green); border: 1px solid rgba(20,83,45,.18); color: var(--green);
}

/* ── Fußnote / Rücklink ── */
.info {
  font-size: 12.5px; color: var(--muted); line-height: 1.65;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-2);
}
.info strong { color: var(--text); font-weight: 600; }
.info a { font-weight: 600; text-decoration: none; }
.back { text-align: center; margin-top: 18px; font-size: 13px; }
.back a { color: var(--muted); text-decoration: none; font-weight: 500; }
.back a:hover { color: var(--navy); }
.pw-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pw-row label { margin-bottom: 6px; }
.pw-row a { font-size: 12px; color: var(--muted); text-decoration: none; font-weight: 500; }
.pw-row a:hover { color: var(--navy); }

/* ── Schritte (CSD) ── */
.divider { border: none; border-top: 1px solid var(--hairline); margin: 22px 0; }
.step { display: flex; gap: 11px; margin-bottom: 12px; align-items: flex-start; }
.step-num {
  background: var(--tint-navy); color: var(--navy);
  border-radius: 8px; width: 22px; height: 22px; min-width: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; margin-top: 1px;
}
.step p { font-size: 13.5px; color: var(--text); line-height: 1.55; }
.step strong { font-weight: 600; }

/* ── Datei-Zonen (CSD) ── */
.file-zone {
  border: 1px dashed #D6CFC2; border-radius: 12px;
  padding: 18px; text-align: center; cursor: pointer;
  background: var(--bg); position: relative;
  transition: border-color .15s, background .15s;
  margin-bottom: 4px;
}
.file-zone:hover, .file-zone.drag { border-color: var(--navy); background: var(--tint-navy); }
.file-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-zone .icon { display: none; }
.file-zone .hint { font-size: 13px; color: var(--muted); margin: 0; }
.file-zone strong { color: var(--text); font-weight: 600; }
.file-zone .file-name { font-size: 12.5px; color: var(--green); font-weight: 600; margin-top: 4px; }

.security-note {
  display: flex; gap: 9px;
  background: var(--bg); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 12px 13px; margin-top: 22px;
  font-size: 12px; color: var(--muted); line-height: 1.55;
}
.security-note a { font-weight: 600; text-decoration: none; }

.loading { text-align: center; color: var(--muted); padding: 28px 0; font-size: 13.5px; line-height: 1.6; }
.spinner {
  display: inline-block; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  body { padding: 20px 14px; }
  .card, .auth-card { padding: 26px 20px; border-radius: 14px; }
  input[type=email], input[type=password], input[type=text], input[type=tel] { height: 48px; font-size: 16px; }
  button, .btn, .btn-submit { height: 48px; }
  .pw-toggle, button.pw-toggle { width: 44px; height: 44px; right: 2px; }
  .pw-wrap input { padding-right: 54px; }
}
