/* login.html e invite.html: las páginas del servidor, con la marca de MERGE Institute (la misma
   tinta, papel, Borna y degradado pastel que el chat). Sin CSS ni JS en línea: así llevan la
   misma CSP que el chat. Las fuentes son las de /assets/fonts/ (webapp/tests/integration/
   test_assets.py comprueba que existen). */
@font-face {
  font-family: Borna;
  src: url("/assets/fonts/borna-regular.76ad9933.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Borna;
  src: url("/assets/fonts/borna-medium.603dc2cb.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Borna;
  src: url("/assets/fonts/borna-semibold.683fbbb0.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #0a101e;
  --ink-2: #3b4150;
  --muted: #6b6b6b;
  --hint: #75746f;
  --rule: #e7e6e3;
  --field: #d6d4cf;
  --paper: #fafaf9;
  --surface: #ffffff;
  --chip: #f1f0ec;
  --pastel: linear-gradient(90deg, #feefc9 0%, #fbd0d0 33%, #bfe8f0 66%, #ddbcee 100%);
  /* Los avisos, con la paleta de la marca: el tono pastel de fondo y el oscuro saturado de texto. */
  --ok-bg: #eaf6f9;
  --ok-line: #bfe8f0;
  --ok-ink: #0d313f;
  --err-bg: #fdeeee;
  --err-line: #fbd0d0;
  --err-ink: #3c1d1e;
  --warn-bg: #fff8e8;
  --warn-line: #feefc9;
  --warn-ink: #403b0a;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  font:
    16px/1.5 Borna,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60% 45% at 50% 0%, rgb(254 239 201 / 0.75), transparent 70%),
    radial-gradient(50% 40% at 100% 35%, rgb(191 232 240 / 0.55), transparent 70%),
    radial-gradient(45% 40% at 0% 65%, rgb(251 208 208 / 0.45), transparent 70%),
    radial-gradient(55% 45% at 85% 100%, rgb(221 188 238 / 0.45), transparent 70%),
    var(--paper);
}
[hidden] {
  display: none !important;
}
/* login.html: una vista u otra según ?sent=1 (login.js lo marca en <html> antes de pintar). */
html[data-view="sent"] #ask,
html:not([data-view="sent"]) #sent {
  display: none;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 24px;
  padding: 36px 32px 28px;
  box-shadow: 0 10px 40px rgb(10 16 30 / 0.08);
}
.card.wide {
  max-width: 480px;
}
.head {
  text-align: center;
}
.ico {
  display: block;
  height: 48px;
  width: auto;
  margin: 0 auto 20px;
}
h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 6px;
}
.sub {
  color: var(--ink-2);
  margin: 0 0 24px;
  font-size: 15px;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px; /* iOS no hace zoom */
  border: 1px solid var(--field);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
}
.input::placeholder {
  color: var(--hint);
  opacity: 1;
}
.input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgb(10 16 30 / 0.08);
}
.input:read-only {
  background: #f7f7f5;
  color: var(--ink-2);
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
}
.btn:hover {
  background: #1b2233;
}
.btn[aria-busy="true"] {
  opacity: 0.85;
  cursor: progress;
}
.spin {
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    rotate: 360deg;
  }
}
.foot {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14.5px;
  margin: 0 0 18px;
  text-align: left;
  overflow-wrap: anywhere;
}
.note svg {
  flex: none;
  margin-top: 2px;
}
.note.ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok-ink);
}
.note.err {
  background: var(--err-bg);
  border-color: var(--err-line);
  color: var(--err-ink);
}
.note.warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-ink);
}
/* El enviado: el sobre en un círculo pastel y los dos pasos. */
.mail {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  background: var(--pastel);
}
.steps {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 15px;
  color: var(--ink-2);
}
.steps li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.steps li:first-child {
  border-top: 0;
}
.steps b {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--ink);
  font-size: 13px;
  display: grid;
  place-items: center;
  font-weight: 600;
}
.steps strong {
  font-weight: 600;
  color: var(--ink);
}
.link {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.cobrand {
  display: block;
  margin: 28px auto 0;
  height: 11px;
  width: auto;
  opacity: 0.85;
}
/* Invitar: la lista de acceso. */
.row {
  display: flex;
  gap: 8px;
}
.row .input {
  flex: 1;
  min-width: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font-weight: 400;
  color: var(--ink-2);
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0a101e;
}
.capa {
  margin: 18px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.capa a {
  color: inherit;
}
.codigo {
  margin: 8px 0 18px;
  padding: 18px 0;
  text-align: center;
  font-size: 40px;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--field);
}
.link-btn {
  display: block;
  margin: 14px auto 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.input.code {
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}
#code-form {
  margin-top: 18px;
}
.row + label,
select.input + label {
  margin-top: 14px;
}
label .opt,
.also {
  font-weight: 400;
  color: var(--muted);
}
.row .btn {
  width: auto;
  margin: 0;
  padding: 0 18px;
  white-space: nowrap;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 26px 0 8px;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 14px;
  max-height: 320px;
  overflow: auto;
}
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  font-size: 14.5px;
  border-top: 1px solid var(--rule);
  overflow-wrap: anywhere;
}
.list li:first-child {
  border-top: 0;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--field);
  flex: none;
}
.dot.on {
  background: #26b2cd;
}
.grupo {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.grupo + .state {
  margin-left: 0;
}
.state {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

@media (max-width: 480px) {
  /* En el móvil, sin tarjeta: la pantalla entera es la página, el halo arriba y la marca abajo. */
  body {
    background:
      radial-gradient(120% 34% at 50% 0%, rgb(254 239 201 / 0.85), transparent 72%),
      radial-gradient(70% 26% at 100% 12%, rgb(191 232 240 / 0.65), transparent 72%),
      radial-gradient(60% 24% at 0% 20%, rgb(251 208 208 / 0.5), transparent 72%),
      var(--paper);
  }
  .wrap {
    justify-content: flex-start;
    padding: max(8vh, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
  }
  .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }
  .card > form {
    margin-top: 4px;
  }
  .cobrand {
    margin-top: auto;
    padding-top: 28px;
    box-sizing: content-box;
  }
  .ico {
    height: 40px;
    margin-bottom: 16px;
  }
  h1 {
    font-size: 24px;
  }
  .row {
    flex-direction: column;
  }
  .row .btn {
    width: 100%;
    min-height: 50px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .spin {
    animation: none;
  }
}
