/* Palette and typography from the BI design guide (https://design.bi.no), as in the previous password service. */
@font-face {
  font-family: "MuseoSans";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/MuseoSansLight.woff") format("woff");
}

@font-face {
  font-family: "MuseoSans";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/MuseoSansMedium.woff") format("woff");
}

:root {
  --color-primary-darkest: #001b32;
  --color-primary-dark: #00467f;
  --color-primary-medium: #006bb4;
  --color-primary-accent: #18b1ff;
  --color-primary-light: #d0e8f9;
  --color-white: #ffffff;
  --color-secondary-light: #f0ebe3;
  --color-secondary-lightest: #f7f8f8;
  --color-text: #001b32;
  --color-muted: #4a5b6b;
  --color-error-bg: #fdecec;
  --color-error-text: #8a1111;
  --font-primary: "MuseoSans", "Trebuchet MS", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 4px;
  --shadow: rgba(0, 0, 0, 0.35) 0 10px 25px;
}

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

[hidden] {
  display: none !important;
}

/* Texts are filled in by i18n.ts; hide the empty elements until then to avoid a flash. */
html:not(.i18n-ready) [data-i18n] {
  visibility: hidden;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-primary-darkest);
}

:focus-visible {
  outline: 3px solid var(--color-primary-accent);
  outline-offset: 2px;
}

/* Header and footer */

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  color: var(--color-white);
  background: var(--color-primary-darkest);
}

.site-header {
  padding-right: 1.5rem;
}

.logo {
  display: block;
  height: 5rem;
  width: 5rem;
}

.header-button {
  padding: 0.25rem 0;
  font: inherit;
  color: var(--color-white);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

.site-footer {
  flex-wrap: wrap;
  padding: 1rem;
}

.site-footer a {
  color: var(--color-white);
}

/* Main */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

/* Elements focused by script (tabindex=-1) so screen readers announce them; no visible ring needed. */
[tabindex="-1"]:focus {
  outline: none;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-white);
}

h2,
h3 {
  margin: 0 0 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-primary-dark);
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card > .button {
  margin-top: auto;
}

/* Start page */

.choose {
  max-width: 640px;
}

.choice-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  margin-top: 0.5rem;
}

.button.choice {
  width: 100%;
  padding: 1.25rem 1rem;
  font-size: 1.25rem;
}

.options-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.options-header h2 {
  margin: 0;
  color: var(--color-white);
}

.light-link {
  color: var(--color-primary-light);
}

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

.notice {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  background: var(--color-primary-light);
  border-radius: var(--radius);
}

/* Buttons */

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  color: var(--color-white);
  background: var(--color-primary-medium);
  border: 2px solid var(--color-primary-medium);
  border-radius: var(--radius);
  cursor: pointer;
}

.button:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.button-secondary {
  color: var(--color-primary-dark);
  background: var(--color-white);
  border-color: var(--color-primary-dark);
}

.button-secondary:hover {
  color: var(--color-white);
}

.alert {
  width: 100%;
  padding: 0.75rem 1rem;
  color: var(--color-error-text);
  background: var(--color-error-bg);
  border-left: 4px solid var(--color-error-text);
  border-radius: var(--radius);
}

/* Temporary Access Pass page */

.tap-card {
  max-width: 640px;
  margin: 0 auto;
}

.tap-card h1 {
  color: var(--color-primary-dark);
}

.loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid var(--color-primary-light);
  border-top-color: var(--color-primary-medium);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 3s;
  }
}

.credentials {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  margin: 0 0 1rem;
}

.credential {
  padding: 0.75rem 1rem;
  background: var(--color-secondary-lightest);
  border: 1px solid var(--color-primary-medium);
  border-radius: var(--radius);
}

.credential dt {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.credential dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.25rem 0 0;
}

.credential code {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.copy-button {
  flex: none;
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--color-primary-dark);
  background: var(--color-white);
  border: 1px solid var(--color-primary-dark);
  border-radius: var(--radius);
  cursor: pointer;
}

.copy-button:hover {
  background: var(--color-primary-light);
}

.validity {
  font-weight: 600;
}

.steps {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
}

.steps li + li {
  margin-top: 0.375rem;
}

.steps + .fine-print {
  margin: -0.75rem 0 1.5rem;
}

#issued > .button {
  margin-bottom: 1.5rem;
}

.fine-print {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 599px) {
  h1 {
    font-size: 1.625rem;
  }

  .card {
    padding: 1.25rem;
  }

  .logo {
    height: 4rem;
    width: 4rem;
  }

  .choice-buttons {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .credential code {
    font-size: 1.375rem;
  }
}
