/* collana house typeface - Nunito (bold for headlines, light for copy).
   Wide weight range so both variable and static fonts work. */
@font-face {
  font-family: "Nunito";
  src: url("/static/nunito.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Structural colors */
  --bg: #F2F5F0;          /* off-white (instead of pure white) */
  --card: #ffffff;
  --border: #C6C6C9;       /* grey 30% */
  /* Primary colors */
  --text: #1F1F29;         /* collana black */
  --muted: #42424D;        /* collana grey */
  --primary: #FA4A05;      /* collana red */
  --primary-hover: #E03E00;
  /* Secondary colors (accents) */
  --accent-aqua: #4AA6A6;
  --accent-orange: #F5822E;
  --accent-bordeaux: #87054A;
  /* Alerts - bordeaux as a distinct error red, set apart from the primary red */
  --error-bg: #f7e9ef;
  --error-border: #DBB4C9;
  --error-text: #87054A;
  /* Modal overlay based on collana black */
  --overlay: rgba(31, 31, 41, .5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.5rem; }

/* Visible focus style (accessibility) with collana aqua */
:focus-visible {
  outline: 2px solid var(--accent-aqua);
  outline-offset: 2px;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand-logo { display: block; height: 32px; width: auto; }
.brand { font-weight: 700; }
.spacer { flex: 1; }
.inline { display: inline; margin: 0; }

/* Language switcher (DE/EN) - compact, top right. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  font-size: 0.8rem;
}
.lang-opt {
  padding: 0.3rem 0.6rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}
.lang-opt + .lang-opt { border-left: 1px solid var(--border); }
.lang-opt:hover { background: #f0f2f5; }
.lang-opt.active {
  background: var(--primary);
  color: #fff;
}
/* Switcher on the password page: POST forms instead of links. The <button>
   options should look identical to the <a> options. */
.lang-switch .lang-form { display: contents; }
.lang-switch button.lang-opt {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
}
.lang-switch button.lang-opt:hover { background: #f0f2f5; }
.lang-switch button.lang-opt.active { background: var(--primary); color: #fff; }
.lang-switch .lang-form + .lang-form button.lang-opt { border-left: 1px solid var(--border); }
/* Place the switcher on the login page (without topbar) at the top right. */
.corner-lang {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.container {
  max-width: 820px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}
.container.narrow { max-width: 560px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
}
.center {
  max-width: 420px;
  margin: 8vh auto;
  text-align: center;
}
.login-logo { display: block; width: 64px; height: auto; margin: 0 auto 1rem; }

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 7px;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #f0f2f5; }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: #f0f2f5; }

.device-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.device {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.9rem 1.1rem;
}
.device-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.device-name { font-weight: 700; }
.device-meta { color: var(--muted); font-size: 0.85rem; }
.request-form { margin: 0; }

.pw-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1rem;
  display: grid;
  gap: 1.25rem;
}
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.field .value { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

.pw-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.pw-row input {
  flex: 1;
  min-width: 200px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 1rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fbfcfd;
}

.alert {
  border: 1px solid var(--border);
  background: #eef1f4;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
}
.alert.error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

/* Confirmation modal (native <dialog>) in the collana design. */
.modal {
  width: min(420px, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
}
.modal::backdrop {
  background: var(--overlay);
}
.modal-body {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
}
.modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-text {
  margin: 0;
  color: var(--muted);
}
.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .device { flex-direction: column; align-items: stretch; }
  .request-form .btn { width: 100%; }
}
