/* Login + Adminbereich */
:root {
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --text: #162032;
  --muted: #667389;
  --line: rgba(22, 32, 50, 0.1);
  --line-strong: rgba(22, 32, 50, 0.16);
  --brand: #152942;
  --brand-2: #23456c;
  --accent: #f08a1c;
  --accent-2: #ffac52;
  --ok: #1f7a4e;
  --danger: #a63232;
  --shadow: 0 24px 70px rgba(20, 32, 50, 0.13);
  --radius: 28px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 460px at 10% 0%, rgba(21,41,66,.08), transparent 55%),
    radial-gradient(760px 420px at 100% 0%, rgba(240,138,28,.12), transparent 46%),
    linear-gradient(180deg, #f9fbfd 0%, #f2f5f9 100%);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(21,41,66,.06);
  border: 1px solid rgba(21,41,66,.08);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 34px rgba(240,138,28,.22);
}
.btn-secondary {
  color: var(--brand);
  background: rgba(255,255,255,.92);
  border-color: var(--line-strong);
}
.btn-danger {
  color: var(--danger);
  background: #fff;
  border-color: rgba(166,50,50,.16);
}
.btn-block { width: 100%; }
.auth-page {
  display: grid;
  place-items: center;
  padding: 28px;
}
.auth-shell {
  width: min(1120px, 100%);
  display: grid;
  gap: 22px;
  justify-items: center;
}
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 8px;
  text-align: center;
}
.auth-logo {
  width: min(100%, 160px);
  height: auto;
  filter: drop-shadow(0 14px 36px rgba(21,41,66,.12));
}
.brand-subline {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.auth-card,
.admin-panel {
  width: min(100%, 520px);
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card { padding: 24px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  margin-bottom: 20px;
  border-radius: 18px;
  background: #edf2f7;
}
.auth-tab {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.auth-tab.is-active {
  color: var(--brand);
  background: #fff;
  box-shadow: 0 10px 24px rgba(20,32,50,.07);
}
.auth-panel { display: none; }
.auth-panel.is-active { display: block; }
.auth-heading h1,
.auth-heading h2,
.admin-header h3,
.admin-block h4 {
  margin: 0 0 8px;
}
.auth-heading h1,
.auth-heading h2 { font-size: clamp(28px, 4vw, 38px); line-height: 1.05; }
.auth-copy,
.section-head p,
.admin-header p,
.admin-note,
.token-note {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}
.auth-form { display: grid; gap: 10px; }
.compact-form { gap: 8px; }
.auth-form label {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  margin-top: 2px;
}
.auth-form input,
.auth-form select,
.account-grid input,
.account-grid select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline: none;
}
.auth-form input:focus,
.auth-form select:focus,
.account-grid input:focus,
.account-grid select:focus {
  border-color: rgba(240,138,28,.45);
  box-shadow: 0 0 0 4px rgba(240,138,28,.12);
}
.auth-status {
  margin-top: 16px;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #f7f9fb;
  color: var(--muted);
  line-height: 1.45;
}
.auth-status.ok { color: var(--ok); background: rgba(31,122,78,.08); border-color: rgba(31,122,78,.18); }
.auth-status.err { color: var(--danger); background: rgba(166,50,50,.08); border-color: rgba(166,50,50,.16); }
.auth-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.auth-meta-item,
.bootstrap-panel,
.admin-block {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(21,41,66,.04), rgba(240,138,28,.05));
  border: 1px solid rgba(21,41,66,.08);
}
.bootstrap-panel { margin-top: 18px; }
.admin-panel { width: min(100%, 980px); padding: 22px; display: grid; gap: 16px; }
.admin-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.section-head { margin-bottom: 12px; }
.section-head h4 { margin-bottom: 4px; }
.account-list,
.token-list { display: grid; gap: 12px; }
.account-card,
.token-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}
.account-head,
.token-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.account-title,
.token-title { margin: 0; font-size: 18px; }
.account-subtitle,
.token-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.role-badge,
.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(21,41,66,.08);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.state-badge.used { background: rgba(31,122,78,.12); color: var(--ok); }
.state-badge.open { background: rgba(240,138,28,.12); color: #985000; }
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.account-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.account-actions,
.token-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.token-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(21,41,66,.04);
  border: 1px dashed rgba(21,41,66,.14);
}
.token-code {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .08em;
}
.token-result {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(31,122,78,.08);
  border: 1px solid rgba(31,122,78,.18);
}
.empty-box {
  padding: 16px;
  border-radius: 16px;
  background: rgba(21,41,66,.04);
  color: var(--muted);
}
@media (max-width: 860px) {
  .admin-grid,
  .account-grid,
  .auth-meta { grid-template-columns: 1fr; }
}
