/* OneLoyal website styles. Colours match the app (src/constants/theme.ts). */

:root {
  --text: #000000;
  --background: #ffffff;
  --background-element: #f0f0f3;
  --background-selected: #e0e1e6;
  --text-secondary: #60646c;
  --brand: #1e3a8a;
  --on-brand: #ffffff;
  --draft-bg: #fff4c2;
  --draft-text: #5c4400;
  --max-width: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ffffff;
    --background: #000000;
    --background-element: #212225;
    --background-selected: #2e3135;
    --text-secondary: #b0b4ba;
    --brand: #6e8ef5;
    --on-brand: #000000;
    --draft-bg: #3d3200;
    --draft-text: #ffe680;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--background);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--brand);
}

img {
  max-width: 100%;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header and navigation */

.site-header {
  border-bottom: 1px solid var(--background-selected);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

/* The logo mark: a stamp circle with a tick-like dot, drawn in CSS. */
.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-mark::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 15px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  font-weight: 600;
}

/* Hero */

.hero {
  padding: 56px 0 40px;
}

.hero h1 {
  font-size: clamp(34px, 7vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.hero p.lead {
  font-size: clamp(18px, 2.6vw, 21px);
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 0 28px;
}

.eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 12px;
}

/* Buttons and the App Store badge */

.button {
  display: inline-block;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 12px;
}

.button.secondary {
  background: var(--background-element);
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Placeholder until the app is on the App Store. Swap for Apple's official badge then. */
.app-store-soon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 12px;
  border: 2px dashed var(--background-selected);
  color: var(--text-secondary);
  line-height: 1.2;
}

.app-store-soon small {
  font-size: 12px;
}

.app-store-soon strong {
  font-size: 18px;
  color: var(--text);
}

/* Sections and cards */

section {
  padding: 36px 0;
}

section h2 {
  font-size: clamp(26px, 4.5vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 20px;
}

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

.card {
  background: var(--background-element);
  border-radius: 18px;
  padding: 22px;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 19px;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
}

.card .icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 12px;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 18px 20px 18px 66px;
  background: var(--background-element);
  border-radius: 18px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps strong {
  display: block;
}

.steps span {
  color: var(--text-secondary);
}

/* The sample loyalty card on the home page */

.ticket {
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 20px;
  padding: 20px;
  max-width: 360px;
}

.ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
}

.ticket-top small {
  display: block;
  font-weight: 400;
  opacity: 0.8;
}

.ticket hr {
  border: none;
  border-top: 2px dashed currentColor;
  opacity: 0.4;
  margin: 16px 0;
}

.ticket-note {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 10px;
}

.stamps {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.stamps span {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.6;
}

.stamps span.on {
  background: currentColor;
  opacity: 1;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

@media (min-width: 760px) {
  .split {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* "Coming soon" box */

.callout {
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 22px;
  padding: 32px 26px;
}

.callout h2 {
  margin-bottom: 10px;
}

.callout p {
  margin: 0 0 20px;
  opacity: 0.9;
}

.callout .button {
  background: var(--on-brand);
  color: var(--brand);
}

/* Legal pages and long text */

.prose {
  max-width: 720px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.prose h1 {
  font-size: clamp(30px, 6vw, 42px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 8px;
}

.prose h2 {
  font-size: 22px;
  margin: 36px 0 10px;
}

.prose h3 {
  font-size: 18px;
  margin: 24px 0 6px;
}

.prose .updated {
  color: var(--text-secondary);
  margin-top: 0;
}

.prose li {
  margin-bottom: 6px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 12px 0;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 10px 8px;
  border-bottom: 1px solid var(--background-selected);
}

.table-scroll {
  overflow-x: auto;
}

.draft-banner {
  background: var(--draft-bg);
  color: var(--draft-text);
  border-radius: 14px;
  padding: 14px 18px;
  margin: 16px 0 24px;
  font-size: 15px;
}

/* Details still to be filled in (company name, email, etc.). Remove once all are filled. */
.todo {
  background: var(--draft-bg);
  color: var(--draft-text);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}

.faq details {
  background: var(--background-element);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.faq summary {
  font-weight: 600;
  cursor: pointer;
}

.faq details p {
  margin: 10px 0 0;
  color: var(--text-secondary);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--background-selected);
  margin-top: 24px;
  padding: 28px 0 40px;
  font-size: 14px;
  color: var(--text-secondary);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 12px;
}

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

.site-footer p {
  margin: 4px 0;
}
