/* id: IDEA's sign-in. Colours, type and roundness follow the IDEA design system (idea-theme.css in
   the website repo). Keep the token names in step with it. */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/assets/fonts/Inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/assets/fonts/Inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/assets/fonts/Inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 700; font-display: swap; src: url('/assets/fonts/Archivo-700.woff2') format('woff2'); }

:root {
  --abyss-50: #f1edfe;
  --abyss-100: #e3dafd;
  --abyss-500: #2b01be;
  --abyss-600: #23019c;
  --abyss-900: #0d003c;
  --sky-500: #0190ff;
  --frost-100: #f0f9ff;
  --aurora-500: #95f21b;
  --neutral-0: #ffffff;
  --neutral-50: #f9f8fc;
  --neutral-100: #f2f1f8;
  --neutral-200: #e6e4f0;
  --neutral-500: #847e9f;
  --success-500: #12a150;
  --error-50: #fdedee;
  --error-600: #c81e2e;
  --ink: #0d003c;
  --body: #494363;
  --mute: #625c80;
  --link: #005ca9;
  --line: #e6e4f0;
  --edge: #847e9f;
  --focus: #0190ff;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --display: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--body);
  background: var(--frost-100);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2 { font-family: var(--display); color: var(--ink); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.2; }
p { margin: 0; }

/* ---- Layout ---- */
.shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px; }
.shell.wide { align-items: stretch; padding: 0; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand img { height: 40px; width: auto; display: block; }
.brand .door { font-size: 14px; color: var(--mute); border-left: 1px solid var(--line); padding-left: 10px; }
.card {
  width: 100%;
  max-width: 420px;
  background: var(--neutral-0);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 1px 2px rgba(13, 0, 60, 0.06), 0 12px 32px -12px rgba(13, 0, 60, 0.12);
  animation: rise 0.42s var(--ease) both;
}
.card > * + * { margin-top: 20px; }
.lede { color: var(--body); }
.foot { margin-top: 24px; font-size: 14px; color: var(--mute); text-align: center; max-width: 420px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card, .panel { animation: none; } }

/* ---- Controls ---- */
label { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
input[type='email'], input[type='text'] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--neutral-0);
  transition: border-color 0.2s var(--ease);
}
input:hover { border-color: var(--edge); }
input:focus { border-color: var(--abyss-500); outline: none; box-shadow: 0 0 0 3px var(--abyss-100); }
input.code { font-size: 28px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; padding: 12px 8px 12px calc(8px + 0.4em); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font: inherit;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn.primary { background: var(--abyss-500); color: var(--neutral-0); }
.btn.primary:hover { background: var(--abyss-600); }
.btn.quiet { background: var(--neutral-0); color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--edge); }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; }
.btn.danger { background: var(--neutral-0); color: var(--error-600); border-color: var(--line); }
.btn.danger:hover { border-color: var(--error-600); }
.btn img { width: 20px; height: 20px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }

.or { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.note { border-radius: 14px; padding: 12px 16px; font-size: 14px; background: var(--abyss-50); color: var(--ink); }
.note.error { background: var(--error-50); color: var(--error-600); }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mute { color: var(--mute); font-size: 14px; }

/* ---- Your account ---- */
.apps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.apps a, .apps span {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 16px;
  color: var(--ink); font-weight: 600; text-decoration: none;
  transition: border-color 0.2s var(--ease);
}
.apps a:hover { border-color: var(--abyss-500); }
.apps a::after { content: '\2192'; color: var(--abyss-500); }

/* ---- Admin ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; background: var(--neutral-0); border-bottom: 1px solid var(--line);
}
.topbar img { height: 32px; }
.main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--neutral-100); border-radius: 999px; margin: 20px 0 24px; }
.tabs button {
  font: inherit; font-weight: 600; font-size: 14px; color: var(--body);
  border: 0; background: none; padding: 8px 16px; border-radius: 999px; cursor: pointer;
}
.tabs button[aria-selected='true'] { background: var(--neutral-0); color: var(--ink); box-shadow: 0 1px 2px rgba(13, 0, 60, 0.12); }
.panel { background: var(--neutral-0); border-radius: 20px; padding: 8px 0; animation: rise 0.3s var(--ease) both; }
.panel > form, .panel > .head { padding: 16px 24px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.who { min-width: 0; }
.who strong { color: var(--ink); font-weight: 600; display: block; }
.who .mute { overflow-wrap: anywhere; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--neutral-100); color: var(--body); }
.chip.app { background: var(--abyss-50); color: var(--abyss-600); }
.chip.agency { background: #fff4db; color: #7a5200; }
.chip.admin { background: var(--abyss-500); color: var(--neutral-0); }
.chip.off { background: var(--neutral-100); color: var(--mute); text-decoration: line-through; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: flex; gap: 8px; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; margin: 0; }
.checks input { accent-color: var(--abyss-500); width: 16px; height: 16px; margin: 0; }
details.edit { width: 100%; }
details.edit summary { list-style: none; }
details.edit summary::-webkit-details-marker { display: none; }
.editbox { margin-top: 12px; display: grid; gap: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--abyss-900); color: var(--neutral-0); padding: 12px 20px; border-radius: 999px; font-size: 14px; box-shadow: 0 8px 24px rgba(13, 0, 60, 0.25); }

@media (max-width: 640px) {
  .card { padding: 24px; border-radius: 20px; }
  .inline { grid-template-columns: 1fr; }
  .main { padding: 24px 16px 48px; }
  .list > li, .panel > form, .panel > .head { padding-left: 16px; padding-right: 16px; }
}

/* ---- Spacing helpers (no inline styles: the pages' CSP allows none) ---- */
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.mb12 { margin-bottom: 12px; } .ml8 { margin-left: 8px; } .self-end { align-self: end; }
