@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk/SpaceGrotesk-400.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk/SpaceGrotesk-500.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk/SpaceGrotesk-600.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk/SpaceGrotesk-700.woff2") format("woff2");
}

:root {
  --bg: 255 255 255;           /* white base */
  --tint: 255 255 255 / .65;   /* translucent */
  --ink: 20 24 28;             /* text color */
  --ink-weak: 80 90 100;
  --accent: 50 120 255;        /* slightly lighter blue for better readability */
  --ring: 50 120 255 / .25;
  --surface: 246,247,249;      /* light grey used across the app */
  --surface-dim: 240,242,245;  /* slightly darker variant */
  --header-pad-y: 20px;        /* increase for a taller bar */
  --logo-h: 36px;              /* increase logo size to match new height */
  
  /* Typography system */
  --font-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  
  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  
  /* Line heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

[hidden] {
  display: none !important;
}

.keycloak-hidden-iframe {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: rgb(var(--ink));
  background: rgb(var(--surface));
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--leading-tight);
  color: rgb(var(--ink));
  margin: 0;
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.04em;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

/* Links */
a {
  color: rgb(var(--accent));
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: rgb(30 90 220);
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgb(var(--accent) / 0.08);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  color: rgb(var(--accent));
}

/* Strong */
strong {
  font-weight: 600;
  color: rgb(var(--ink));
}

/* Lists */
ul, ol {
  padding-left: 1.5em;
  line-height: var(--leading-relaxed);
}

li {
  margin-bottom: 0.5em;
  color: rgb(var(--ink-weak));
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2.25rem;
    --text-3xl: 1.5rem;
  }
}

/* Idle session warning modal (CSP-safe: external stylesheet, no inline styles) */
body.harbour-idle-warning-open {
  overflow: hidden;
}

.harbour-idle-warning {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgb(7 17 34 / 0.42);
  backdrop-filter: blur(3px);
}

.harbour-idle-warning[hidden] {
  display: none !important;
}

.harbour-idle-warning__panel {
  width: min(96vw, 540px);
  border-radius: 12px;
  border: 1px solid rgb(11 25 60 / 0.14);
  background: linear-gradient(180deg, #f7faff 0%, #eff4fb 100%);
  box-shadow:
    0 18px 40px rgb(8 18 39 / 0.28),
    inset 0 1px 0 rgb(255 255 255 / 0.7);
  padding: 1rem 1.05rem 0.9rem;
  color: #091b42;
}

.harbour-idle-warning__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.harbour-idle-warning__copy {
  margin: 0.34rem 0 0.16rem;
  font-size: 0.86rem;
  color: #31466a;
}

.harbour-idle-warning__clock-wrap {
  margin: 0.75rem auto 0.62rem;
  display: grid;
  place-items: center;
}

.harbour-idle-warning__clock {
  position: relative;
  width: 164px;
  height: 164px;
  display: grid;
  place-items: center;
}

.harbour-idle-warning__clock svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.harbour-idle-warning__ring-track {
  fill: none;
  stroke: rgb(18 82 217 / 0.15);
  stroke-width: 8;
}

.harbour-idle-warning__ring-progress {
  fill: none;
  stroke: url(#harbour-idle-warning-ring-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.16s linear;
}

.harbour-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  background: rgb(8 12 18 / 0);
  transition: opacity 160ms ease, transform 180ms ease, background-color 180ms ease;
}

.harbour-call-overlay[hidden] {
  display: none !important;
}

.harbour-call-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
  background: rgb(8 12 18 / 0.38);
}

.harbour-call-overlay__shell {
  position: relative;
  overflow: hidden;
  width: min(31rem, calc(100vw - 2rem));
  border-radius: 28px;
  padding: 1.6rem;
  color: #fff7f3;
  background:
    radial-gradient(circle at top left, rgb(118 174 255 / 0.26), transparent 38%),
    radial-gradient(circle at bottom right, rgb(50 120 255 / 0.2), transparent 42%),
    linear-gradient(160deg, #141a22 0%, #1b2430 50%, #10161f 100%);
  border: 1px solid rgb(153 196 255 / 0.24);
  box-shadow:
    0 26px 88px rgb(7 11 17 / 0.36),
    inset 0 1px 0 rgb(255 255 255 / 0.05);
  backdrop-filter: blur(14px);
}

.harbour-call-overlay__hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.15rem;
  align-items: center;
}

.harbour-call-overlay__pulse {
  position: relative;
  width: 5.6rem;
  height: 5.6rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.harbour-call-overlay__pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgb(131 182 255 / 0.34);
  background: radial-gradient(circle, rgb(50 120 255 / 0.18), transparent 68%);
}

.harbour-call-overlay.is-ringing .harbour-call-overlay__pulse-ring--outer {
  animation: harbour-call-pulse 1800ms ease-out infinite;
}

.harbour-call-overlay.is-ringing .harbour-call-overlay__pulse-ring--inner {
  animation: harbour-call-pulse 1800ms ease-out 420ms infinite;
}

.harbour-call-overlay__pulse-core {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.7rem;
  height: 3.7rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #24c96f 0%, #149a53 100%);
  box-shadow: 0 12px 28px rgb(20 154 83 / 0.34);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.harbour-call-overlay__identity {
  min-width: 0;
}

.harbour-call-overlay__kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(177 212 255 / 0.9);
}

.harbour-call-overlay__caller {
  margin: 0.35rem 0 0;
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  line-height: 1.02;
  color: #fff;
}

.harbour-call-overlay__number,
.harbour-call-overlay__line {
  margin: 0.38rem 0 0;
  color: rgb(239 245 255 / 0.82);
  font-size: 0.98rem;
}

.harbour-call-overlay__line {
  font-size: 0.88rem;
  color: rgb(196 210 234 / 0.82);
}

.harbour-call-overlay__status {
  margin: 1.15rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  font-size: 0.92rem;
  color: rgb(239 245 255 / 0.92);
}

.harbour-call-overlay__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.72rem;
  margin-top: 1.15rem;
}

.harbour-call-overlay__button,
.harbour-call-overlay__link {
  border: 0;
  border-radius: 999px;
  min-height: 3rem;
  padding: 0.8rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, background-color 120ms ease;
}

.harbour-call-overlay__button:hover,
.harbour-call-overlay__link:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.harbour-call-overlay__button:focus-visible,
.harbour-call-overlay__link:focus-visible {
  outline: 2px solid rgb(165 204 255 / 0.92);
  outline-offset: 2px;
}

.harbour-call-overlay__button--primary {
  background: linear-gradient(145deg, #22c76d 0%, #139650 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgb(19 150 80 / 0.3);
}

.harbour-call-overlay__button--ghost {
  background: rgb(102 152 255 / 0.12);
  color: #fff7f3;
}

.harbour-call-overlay__button--danger {
  background: linear-gradient(145deg, #f15e5e 0%, #d73f3f 100%);
  color: #fff;
}

.harbour-call-overlay__link {
  background: transparent;
  color: rgb(166 205 255 / 0.94);
  padding-inline: 0.4rem;
}

@keyframes harbour-call-pulse {
  0% {
    opacity: 0.08;
    transform: scale(0.82);
  }
  30% {
    opacity: 0.28;
  }
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

@media (max-width: 720px) {
  .harbour-call-overlay {
    padding: 0.85rem;
  }

  .harbour-call-overlay__shell {
    width: min(100%, 27rem);
    padding: 1.25rem;
  }

  .harbour-call-overlay__hero {
    gap: 0.9rem;
  }

  .harbour-call-overlay__pulse {
    width: 5rem;
    height: 5rem;
  }
}

.harbour-idle-warning__seconds {
  line-height: 1;
  text-align: center;
}

.harbour-idle-warning__seconds strong {
  display: block;
  font-size: 2.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0d63f3;
}

.harbour-idle-warning__seconds span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #5f7090;
  font-weight: 600;
}

.harbour-idle-warning__actions {
  margin-top: 0.6rem;
  padding-top: 0.48rem;
  border-top: 1px solid rgb(11 25 60 / 0.09);
  display: flex;
  gap: 0.95rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.harbour-idle-warning__btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #1d2d5a;
  text-decoration: none;
  text-underline-offset: 3px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

.harbour-idle-warning__btn:hover {
  color: #3278FF;
  text-decoration: underline;
}

.harbour-idle-warning__btn:focus-visible {
  outline: 2px solid rgb(50 120 255 / 0.45);
  outline-offset: 2px;
  border-radius: 3px;
}

.harbour-idle-warning__btn--ghost {
  color: #3b4e70;
}

.harbour-idle-warning__btn--primary {
  color: #13284d;
  font-weight: 700;
}

@media (max-width: 520px) {
  .harbour-idle-warning {
    padding: 0.85rem;
  }

  .harbour-idle-warning__panel {
    width: min(100vw, 440px);
    padding: 0.9rem 0.88rem 0.86rem;
  }

  .harbour-idle-warning__actions {
    justify-content: flex-end;
    gap: 0.8rem;
  }
}
