/* Sign-in, the dashboard and the profile, in the marketing site's typefaces and
   colours (public/styles.css), which this sheet does not load. The faces and the
   colours the two share come from the Kairo design system (kairo/fonts.css and
   kairo/tokens.css, loaded before this); the marketing names below alias them,
   and keep their own value where the marketing palette differs. */

:root {
  --ink: var(--k-color-ink);
  --ink-soft: var(--k-color-ink-soft);
  --cream: var(--k-color-ivory);
  --paper: var(--k-color-paper);
  /* The marketing site's lavender, a shade off the system's --k-color-lavender. */
  --lavender: #eeebff;
  --lavender-2: var(--k-color-lavender-soft);
  --purple: var(--k-color-violet);
  --purple-deep: var(--k-color-violet-deep);
  --mint: var(--k-color-mint);
  --coral: var(--k-color-coral);
  /* The marketing site rules with translucent ink, not the system's solid line. */
  --line: rgba(23, 32, 51, 0.12);
  --line-strong: rgba(23, 32, 51, 0.2);
  --muted: var(--k-color-muted);
  --display: var(--k-type-display-font-family);
  --body: var(--k-type-body-font-family);
  /* The marketing site's radii and shadow, larger than the system's panels. */
  --radius-lg: 28px;
  --radius-md: 16px;
  --shadow: 0 28px 80px rgba(71, 54, 149, 0.13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* --- Sign-in --------------------------------------------------------------- */

.auth {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  min-height: 100vh;
  padding: 32px 20px;
}

.auth__logo img { display: block; height: 34px; }

.auth__card {
  width: min(420px, 100%);
  padding: 36px 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth__title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.auth__subtitle { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }

.auth__form { display: grid; gap: 18px; }

.field { display: grid; gap: 6px; }

.field__header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.field__label { font-weight: 600; font-size: 0.92rem; }

.field__link { color: var(--purple-deep); font-size: 0.88rem; text-decoration: none; }
.field__link:hover { text-decoration: underline; }

.field__input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--lavender-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.field__input:focus { outline: 2px solid var(--purple); outline-offset: 1px; border-color: transparent; }

.button {
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  color: var(--paper);
  background: var(--purple);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.button:hover { background: var(--purple-deep); }

.flash { margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; font-size: 0.92rem; line-height: 1.45; }
.flash--notice { background: rgba(153, 227, 196, 0.35); }
.flash--alert { background: rgba(255, 139, 114, 0.22); }

/* --- Dashboard ------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1100px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar__logo img { display: block; height: 30px; }

.topbar__account { display: flex; align-items: center; gap: 14px; }

.topbar__email { color: var(--muted); font-size: 0.92rem; }

.topbar__sign-out {
  padding: 8px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}

.topbar__sign-out:hover { background: var(--paper); }

.topbar__link {
  padding: 8px 4px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.topbar__link:hover { color: var(--purple-deep); }
.topbar__link[aria-current="page"] { border-bottom-color: var(--purple); }

.dashboard { width: min(1100px, calc(100vw - 40px)); margin: 0 auto; padding: 24px 0 64px; }

.dashboard__title {
  margin: 0 0 28px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
}

.dashboard__apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.app-card {
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* Cards only administrators see: a dashed edge and a lock badge sitting on
   it, so staff can tell at a glance which apps clients never see. */
.app-card--admin {
  position: relative;
  background: linear-gradient(var(--lavender-2), var(--paper) 160px);
  border: 1px dashed var(--line-strong);
}

.app-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: -12px;
  inset-inline-end: 28px;
  padding: 4px 10px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-card__badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.app-card__head { display: flex; align-items: center; gap: 16px; text-decoration: none; }

.app-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  transition: transform 160ms ease;
}

.app-card__head:hover .app-card__icon { transform: translateY(-2px); }

.app-card__icon svg { width: 36px; height: 36px; }

.app-card__icon--neo { color: var(--paper); background: var(--purple); }
.app-card__icon--journey { color: var(--ink); background: var(--mint); }
.app-card__icon--super_admin { color: var(--paper); background: var(--ink); }
.app-card__icon--data { color: var(--ink); background: var(--lavender); }
.app-card__icon--tools { color: var(--ink); background: var(--coral); }
.app-card__icon--sync { color: var(--paper); background: var(--purple); }

.app-card__name { display: block; font-family: var(--display); font-size: 1.5rem; font-weight: 700; }

.app-card__tagline { display: block; color: var(--muted); font-size: 0.92rem; }

.app-card__links { display: grid; gap: 2px; margin: 24px 0 0; padding: 0; list-style: none; }

.app-card__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
}

.app-card__link:hover { background: var(--lavender); }

.app-card__arrow { color: var(--purple); }

[dir="rtl"] .app-card__arrow { transform: scaleX(-1); }

/* --- Profile --------------------------------------------------------------- */

.profile { width: min(1100px, calc(100vw - 40px)); margin: 0 auto; padding: 24px 0 64px; }

.profile__title {
  margin: 0 0 28px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
}

.profile__panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  gap: 24px;
}

.panel {
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel__title { margin: 0 0 18px; font-family: var(--display); font-size: 1.25rem; }

.facts { margin: 0; }

.facts > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.facts > div:last-child { border-bottom: 0; }

.facts dt { color: var(--muted); font-size: 0.88rem; font-weight: 600; }

.facts dd { margin: 0; text-align: end; overflow-wrap: anywhere; }

.panel__note {
  margin: 14px 0 0;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  background: var(--lavender-2);
  border-radius: 12px;
}

/* The language menu: a <details> of radios dressed as a dropdown, because the
   browser's own menu can't be styled. Each language is set in its own script,
   tagged with its code so the three read as a set rather than three words. */
.picker { position: relative; }

.picker__current {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 9px;
  padding-inline: 9px 14px;
  list-style: none;
  background: var(--lavender-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.picker__current::-webkit-details-marker { display: none; }

.picker__current:hover { background: var(--lavender); border-color: rgba(112, 79, 245, 0.35); }

.picker__current:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

.picker[open] .picker__current {
  background: var(--paper);
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(112, 79, 245, 0.12);
}

.picker__code {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 28px;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--purple-deep);
  background: var(--paper);
  border: 1px solid rgba(112, 79, 245, 0.2);
  border-radius: 8px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.picker__name { flex: 1; font-weight: 600; unicode-bidi: isolate; }

.picker__chevron,
.picker__check {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.picker__chevron { color: var(--muted); transition: transform 0.2s ease, color 0.15s; }

.picker[open] .picker__chevron { color: var(--purple); transform: rotate(180deg); }

.picker__menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  z-index: 10;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(23, 32, 51, 0.06), 0 18px 48px rgba(71, 54, 149, 0.18);
  transform-origin: top center;
  animation: picker-open 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

@keyframes picker-open {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

.picker__option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.picker__option:hover { background: var(--lavender-2); }

/* The radio stays in the page for the keyboard and the form, out of sight. */
.picker__radio { position: absolute; opacity: 0; pointer-events: none; }

.picker__option:has(.picker__radio:focus-visible) { outline: 2px solid var(--purple); outline-offset: -2px; }

.picker__option:has(.picker__radio:checked) { background: var(--lavender); }

.picker__option:has(.picker__radio:checked) .picker__code { color: var(--paper); background: var(--purple); border-color: var(--purple); }

.picker__check { color: var(--purple); opacity: 0; transform: scale(0.5); transition: opacity 0.15s, transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.4); }

.picker__option:has(.picker__radio:checked) .picker__check { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .picker__menu { animation: none; }
  .picker *, .picker__current { transition: none; }
}

.field__hint { margin: -6px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

/* The one button that commits a change sits at its own width, on the form's
   leading edge: stretched across the panel it reads as the panel's footer. */
.panel .button { justify-self: start; }

@media (max-width: 560px) {
  .topbar__email { display: none; }
}
