/* IBM Plex Mono, SIL Open Font License: /fonts/OFL-IBMPlexMono.txt */

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-Thin.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-ExtraLight.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-Regular.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  background: var(--clr10);
  color: var(--fc);
  --templateBG: #21232c;
  --fc: hsl(0, 0%, 100%);
  --fs: 13px;
  --fsTable: 11px;
  --clrHue: 230;
  --clrSaturation: 15%;
  --clr0: hsl(var(--clrHue), var(--clrSaturation), 0%);
  --clr5: hsl(var(--clrHue), var(--clrSaturation), 5%);
  --clr10: hsl(var(--clrHue), var(--clrSaturation), 10%);
  --clr15: hsl(var(--clrHue), var(--clrSaturation), 15%);
  --clr20: hsl(var(--clrHue), var(--clrSaturation), 20%);
  --clr25: hsl(var(--clrHue), var(--clrSaturation), 25%);
  --clr30: hsl(var(--clrHue), var(--clrSaturation), 30%);
  --clr35: hsl(var(--clrHue), var(--clrSaturation), 35%);
  --clr40: hsl(var(--clrHue), var(--clrSaturation), 40%);
  --clr45: hsl(var(--clrHue), var(--clrSaturation), 45%);
  --clr50: hsl(var(--clrHue), var(--clrSaturation), 50%);
  --clr55: hsl(var(--clrHue), var(--clrSaturation), 55%);
  --clr60: hsl(var(--clrHue), var(--clrSaturation), 60%);
  --clr65: hsl(var(--clrHue), var(--clrSaturation), 65%);
  --clr70: hsl(var(--clrHue), var(--clrSaturation), 70%);
  --clr75: hsl(var(--clrHue), var(--clrSaturation), 75%);
  --clr80: hsl(var(--clrHue), var(--clrSaturation), 80%);
  --clr85: hsl(var(--clrHue), var(--clrSaturation), 85%);
  --clr90: hsl(var(--clrHue), var(--clrSaturation), 90%);
  --clr95: hsl(var(--clrHue), var(--clrSaturation), 95%);
  --clr100: hsl(var(--clrHue), var(--clrSaturation), 100%);
  --pageBg: var(--clr10);
  --surfaceBg: var(--clr15);
  --surfaceRaised: var(--clr20);
  --frameClr: var(--clr25);
  --accentHue: 180;
  --accentClr: hsl(var(--accentHue), 100%, 50%);
  --accentSoft: hsla(var(--accentHue), 100%, 47%, 0.09);
  --accentFrame: hsla(var(--accentHue), 100%, 47%, 0.28);
  --shiftAvailableBg: var(--clr65);
  --textMuted: #a8a8a8;
  --textSoft: #c9c9c9;
  --textSubtle: #858585;
  --textOnAccent: #171900;
  --textOnState: var(--fc);
  --dangerClr: #a32332;
  --successClr: #8ac79b;
  --successBg: #315c43;
  --errorBg: #8d3038;
  --onlineClr: #45bd72;
  --warningClr: #e3bd45;
  --warningBg: #73512b;
  --restDangerClr: #ed4e55;
  --restOrangeClr: #e78936;
  --quizSuccessClr: #36bd78;
  --quizErrorClr: #b53131;
  --birthdayText: #ffe5b1;
  --birthdayBg: rgb(145 91 28 / 42%);
  --loginErrorText: #ffd2d2;
  --loginErrorBg: #4a252b;
  --fcPassive: hsl(0, 0%, 50%);
  --fieldHeight: 50px;
  --headerHeight: calc(78px + env(safe-area-inset-bottom));
  --safeTop: max(32px, calc(env(safe-area-inset-top) + 28px));
  --islandCoverHeight: calc(var(--safeTop) + 5px);
  --islandCoverBg: var(--pageBg);
  --stickyMonthTop: var(--islandCoverHeight);
  --topControlsBg: var(--pageBg);
  --br: 4px;
  --svgFilter: invert(72%) sepia(77%) saturate(1970%) hue-rotate(calc((var(--accentHue) - 58) * 1deg))
    brightness(101%) contrast(101%);
  --space1: 4px;
  --spaceControl: 10px;
  --spaceTight: 6px;
  --space2: 8px;
  --space3: 12px;
  --space4: 16px;
  --space5: 20px;
  --space6: 24px;
  --radiusLg: 6px;
  --radiusPill: 999px;
  --fontMono: "IBM Plex Mono", monospace;
  --radarTargetClr: hsl(0, 0%, 82%);
  --qdmClr: #b89b59;
  --sepClr: #ff88cc;
  --logTextClr: #35ff70;
  --logGlowClr: #19b84a55;
  --syncFrameClr: #555;
  --syncBg: #252525;
  --syncTextClr: #ccc;
  --guideHolidayClr: #ef8c8c;
  --guideMutedClr: #777;
  --guideLinkedBg: #254936;
  --guideDangerClr: #df6262;
  --guideWarningClr: #d6bd54;
  --guideWarningBg: #d4b544;
  --guideWarningText: #181818;
  --overlayShadowClr: #0008;
  --guideNoteText: #151515;
  --guideCorrectBg: #275038;
  --guideCorrectFrame: #63bf77;
  --guideWrongBg: #6a3030;
}

*::before,
*::after {
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font: inherit;
}

input:not([type="button"]):not([type="submit"]):not([type="reset"]):not(
    [type="checkbox"]
  ):not([type="radio"]),
select,
textarea {
  font-size: 16px !important;
}

b {
  font-weight: bold;
}

p,
a:link,
a:active,
a:visited {
  text-decoration: none;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object,
picture {
  display: block;
  max-width: 100%;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  text-rendering: optimizeSpeed;
  position: relative;
  min-height: 100vh;
  height: 100%;
  margin: 0;
  padding: 0 0 max(var(--space5), env(safe-area-inset-bottom));
  font-size: var(--fs);
  font-family: system-ui, sans-serif;
  color: var(--fc);
  user-select: none;
  -webkit-user-select: none;
}

h2 {
  font-size: 1.2em;
  font-weight: bold;
}

.flex {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3em;
}

.flexColumn {
  flex-direction: column;
}

input {
  font-size: var(--fs);
  width: 100%;
  height: var(--fieldHeight);
  color: var(--fc);
  outline: none;
  border-radius: var(--br);
  padding: 0 1em;
  text-align: left;
  vertical-align: center;
}

input::placeholder {
  font-size: 1em;
  color: var(--textMuted);
}

.button {
  padding: 0em 1em;
  border-radius: var(--br);
  width: max-content;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: var(--fieldHeight);
}

.hidden {
  visibility: hidden !important;
  display: none !important;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: var(--safeTop);
  padding-bottom: var(--headerHeight);
}

/* Cover the device safe area only on pages with sticky top content. */

body.rosterPage::before,
body.onDutyPage::before,
body.callsignsPageDocument::before,
body:has(.initialQuizQuestionBar)::before {
  content: "";
  position: fixed;
  z-index: 900;
  top: 0;
  left: 0;
  right: 0;
  height: var(--islandCoverHeight);
  background: var(--islandCoverBg);
  pointer-events: none;
}

/* Shared charcoal, lime-accent, framed-card theme. */

html {
  touch-action: pan-x pan-y;
  min-height: 100vh;
  height: 100%;
  margin: 0;
  padding: 0 0 max(var(--space5), env(safe-area-inset-bottom));
  font-size: var(--fs);
  font-family: system-ui, sans-serif;
  color: var(--fc);
  user-select: none;
  -webkit-user-select: none;
  background: var(--pageBg);
  background-color: var(--pageBg) !important;
}

body
  :is(
    .appCard,
    .profileCard,
    .contactCard,
    .contactDropdownCard,
    .callsignCard,
    .callsignDownloadCard,
    .ccEntry,
    .onDutySummary,
    .previousQuestion,
    .radarPanel,
    .initialQuizAnswer,
    .nameTagCard,
    .patchNoteCard,
    .stageCard,
    .shiftCard,
    .infoPatchNotes,
    .infoContactCard,
    .simSwapCard,
    p.empty,
    .monthCard,
    .rosterMonthCard,
    .loginCard
  ) {
  background-color: var(--surfaceBg) !important;
  border: 1px solid var(--frameClr) !important;
  box-shadow: none !important;
  background-image: linear-gradient(
    145deg,
    var(--surfaceRaised),
    var(--surfaceBg)
  ) !important;
}

p.empty {
  padding: 22px;
  color: var(--textMuted);
  border-radius: var(--br);
}

body
  :is(
    button,
    .button,
    .control,
    .contactAction,
    .infoAction,
    .infoEmailAction
  ) {
  color: var(--fc);
  background: var(--surfaceBg) !important;
  border: 1px solid var(--frameClr) !important;
  box-shadow: none !important;
}

body :is(input, select, textarea) {
  color: var(--fc) !important;
  background: var(--surfaceRaised) !important;
  border: 1px solid var(--frameClr) !important;
  box-shadow: none !important;
}

body :is(button, .button, .control)[aria-pressed="true"] {
  color: var(--textOnAccent) !important;
  background: var(--accentClr) !important;
  border-color: var(--accentClr) !important;
}

/* Shared account form: login, registration and the signed-in change-password view. */

.loginCard {
  width: min(100%, 420px);
  padding: 28px;
  border-radius: var(--br);
  background: var(--clr15);
}

.loginCard h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accentClr);
}

.loginSubtitle {
  margin: var(--space2) 0 22px;
  color: var(--textMuted);
}

.loginCard form {
  display: grid;
  gap: var(--spaceControl);
}

.loginCard label {
  margin-top: var(--space2);
  font-weight: 600;
}

.loginCard input {
  min-width: 0;
}

.passwordInputWrap {
  position: relative;
  width: 100%;
}

.passwordInputWrap input {
  box-sizing: border-box;
  width: 100%;
  padding-right: 58px;
}

.passwordInputWrap .passwordVisibility[aria-pressed] {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  padding: var(--space1);
  border: 0 !important;
  color: var(--textSubtle) !important;
  background: transparent !important;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.passwordVisibility:focus-visible {
  outline: 1px solid var(--textSubtle);
  border-radius: var(--br);
}

.loginButton {
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: var(--br);
  color: inherit;
  background: var(--clr15);
  font-weight: 600;
}

#appSyncStatus {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: calc(100vw - 24px);
  padding: 5px var(--spaceControl);
  border: 1px solid var(--syncFrameClr);
  border-radius: 5px;
  background: var(--syncBg);
  color: var(--syncTextClr);
  font:
    12px/1.3 system-ui,
    sans-serif;
  pointer-events: none;
}

#appSyncStatus[hidden] {
  display: none;
}
