/* Brand colours from the DAQUMA Brand Guidelines 2026 */
:root {
  --navy: #051F45;   /* primary */
  --pink: #F8BBD0;   /* secondary, used only as an accent */
  --teal: #56798F;   /* tertiary: icons and accents */
  --teal-text: #47677B; /* darker teal for small text, so it passes contrast checks */
  --mist: #E8EDF0;
  --grey-50: #FAFAFA;
  --grey-200: #E5E5E5;
  --border: #D5DCE1;
  --hover: #F3F6F8;

  --error: #B3261E;

  --font-heading: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-body: "Raleway", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: var(--font-body);
  color: var(--navy);
  /* Navy field with a soft teal-to-blush glow in the corner, like the brand wallpaper */
  background:
    radial-gradient(ellipse at 100% 100%, rgba(248, 187, 208, 0.6) 0%, rgba(86, 121, 143, 0.3) 35%, rgba(5, 31, 69, 0) 70%),
    var(--navy);
  background-attachment: fixed;
}

/* Elements with the "hidden" attribute must stay hidden, even if a class sets display. */
[hidden] { display: none !important; }

/* Visible to screen readers only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Card ---------- */

.card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.card-body {
  padding: 44px 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

/* Signed in: wider card, left-aligned content under a header */
.card.signed-in { max-width: 540px; }
.card.signed-in .card-body { padding: 32px 28px 28px; text-align: left; }

.logo {
  display: block;
  width: 180px;
  max-width: 70%;
  margin: 0 auto 4px;
}

h1 {
  font-family: var(--font-heading);
  font-weight: normal;
  font-size: 1.9rem;
  margin: 0 0 -12px; /* sits close to the intro below it */
}
.card.signed-in h1 { font-size: 2rem; }

.intro {
  margin: 0;
  color: var(--teal-text);
  line-height: 1.5;
}

/* ---------- Header with account (signed in) ---------- */

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--grey-200);
}

.logo-small { display: block; width: 120px; height: auto; }

.account {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.account-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}
.account-name { font-size: 0.9rem; font-weight: 600; }
.account-email {
  font-size: 0.75rem;
  color: var(--teal-text);
  overflow-wrap: anywhere;
}

.signout {
  margin-left: 4px;
  padding: 12px 4px; /* 44px tall tap area */
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.signout:hover { color: var(--teal); }

/* ---------- Sign-in button (signed out) ---------- */

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.button:hover { background: #0B2D5E; }
.button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.ms-logo { flex-shrink: 0; }

.note {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--teal-text);
}

/* ---------- Search ---------- */

.search { position: relative; }

.search-icon {
  position: absolute;
  left: 14px;
  top: 13px;
  color: var(--teal);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--grey-50);
  font: inherit;
  font-size: 0.95rem;
  color: var(--navy);
}
.search input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; background: #fff; }

/* ---------- Results ---------- */

#results:empty { display: none; }

.status {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--hover);
  line-height: 1.5;
  text-align: left;
}

.status.error {
  background: #FCEEEE;
  color: var(--error);
}

.results-title {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-text);
}

.platform-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--grey-200);
  border-radius: 12px;
  overflow: hidden;
}

.platform-list li + li { border-top: 1px solid var(--grey-200); }

.platform-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--navy);
  text-decoration: none;
  transition: background 0.15s;
}

.platform-link:hover { background: var(--hover); }
.platform-link:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
  background: var(--hover);
}

/* Coloured tile with the platform's first letter; four brand variants in turn */
.monogram {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}
.monogram-0 { background: var(--navy); color: #fff; }
.monogram-1 { background: var(--teal); color: #fff; }
.monogram-2 { background: var(--pink); color: var(--navy); }
.monogram-3 { background: var(--mist); color: var(--navy); }

.platform-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.platform-name { font-weight: 600; }

.platform-url {
  font-size: 0.8rem;
  color: var(--teal-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-icon { flex-shrink: 0; color: var(--teal); }

.help {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--teal-text);
}

footer {
  margin-top: 24px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: rgba(250, 250, 250, 0.8);
}

/* Phones: less padding; the header wraps so the account row can go under the logo */
@media (max-width: 480px) {
  body { padding: 16px 12px; justify-content: flex-start; }
  .card-body { padding: 32px 20px 24px; }
  .card.signed-in .card-body { padding: 22px 18px 20px; }
  .card-header { padding: 14px 18px; }
  .logo-small { width: 96px; }
  .card.signed-in h1 { font-size: 1.6rem; }
}
