/* Mandy's HR Sync UI — brand theme.
 *
 * Brand palette (fixed):
 *   #FF7276  coral    — accent, primary action, highlights
 *   #DAEAEB  mist     — page ground
 *   #343654  navy     — text and dark surfaces
 *
 * Everything else is derived from those three (tints, hovers, borders) so the
 * page reads as one system. Contrast note: white on coral is only 2.7:1, so
 * coral never carries white text — the primary button uses navy on coral at a
 * large bold size (4.4:1, which clears AA for large text), and body copy is
 * always navy on a light ground (9:1+).
 */

:root {
  --coral: #ff7276;
  --coral-deep: #ec545a;
  /* Text-only coral: --coral-deep is 3.5:1 on white, below AA for small
     text. This deeper shade is 4.9:1 and is used wherever coral is type. */
  --coral-text: #cc3a42;
  --coral-tint: rgba(255, 114, 118, 0.12);
  --mist: #daeaeb;
  --mist-deep: #c6dcde;
  --navy: #343654;
  --navy-soft: #5a5d80;
  --line: #c2d7da;
  --card: #ffffff;
  --ok: #2f7d6a;
  --danger: #c0392f;
  --shadow: 0 14px 40px rgba(52, 54, 84, 0.13);
  --shadow-soft: 0 6px 18px rgba(52, 54, 84, 0.08);
  --font-display: "Baloo 2", "Trebuchet MS", sans-serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--navy);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 114, 118, 0.16), transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(52, 54, 84, 0.08), transparent 38%),
    linear-gradient(165deg, var(--mist), var(--mist-deep));
}

.page {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--coral-text);
  font-weight: 800;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 2.7rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}

.subhead {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.15rem;
  font-family: var(--font-display);
  font-weight: 700;
}

.lede {
  margin: 0 0 1.25rem;
  color: var(--navy-soft);
  line-height: 1.55;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 1.5rem 1.6rem 1.65rem;
  box-shadow: var(--shadow);
}

.stack {
  display: grid;
  gap: 0.9rem;
}

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

.grid-2 .full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  background: #fff;
  color: var(--navy);
}

input:focus {
  outline: 3px solid var(--coral-tint);
  border-color: var(--coral);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

/* Navy on coral, sized large (1.2rem/800) so 4.4:1 clears AA for large text.
   White on coral would be 2.7:1 and is deliberately avoided. */
.btn.primary {
  background: var(--coral);
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.btn.primary:hover {
  background: var(--coral-deep);
}

.btn.primary:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

.btn.primary:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.btn.ghost {
  margin-top: 1.25rem;
  background: transparent;
  color: var(--navy-soft);
  border: 1.5px solid var(--line);
  font-size: 1rem;
}

.btn.ghost:hover {
  background: var(--mist);
  color: var(--navy);
}

.session-meta {
  text-align: right;
  color: var(--navy-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.error {
  color: var(--danger);
  margin: 0.85rem 0 0;
  font-weight: 600;
}

.status {
  margin: 0.9rem 0 0;
  color: var(--ok);
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.qr {
  display: flex;
  justify-content: center;
  margin: 0 0 1rem;
}

.qr img {
  width: 180px;
  height: 180px;
  background: #fff;
  border-radius: 18px;
  border: 1.5px solid var(--line);
  padding: 0.5rem;
}

.result,
.runs {
  margin-top: 1rem;
  border-top: 1.5px solid var(--line);
  padding-top: 1rem;
}

.result .headline {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ok);
}

.report-block {
  margin-top: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 0.7rem 0.9rem;
  background: #fff;
}

.report-block summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
}

.report-block summary::marker {
  color: var(--coral);
}

.report-block .meta {
  margin: 0.5rem 0 0.65rem;
  color: var(--navy-soft);
  font-size: 0.9rem;
}

.people {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.people li {
  line-height: 1.4;
}

.people li::marker {
  color: var(--coral);
}

.result dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  margin: 0;
}

.result dt {
  color: var(--navy-soft);
}

.result dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.run {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.run:last-child {
  border-bottom: 0;
}

.run .meta {
  color: var(--navy-soft);
  font-size: 0.85rem;
}

footer {
  margin-top: 1.5rem;
  color: var(--navy-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Last successful sync — tells HR at a glance whether a manual run is needed. */
.last-sync {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.2rem;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--mist);
  font-size: 0.95rem;
}

.last-sync-dot {
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0.42rem;
  border-radius: 50%;
  background: var(--ok);
}

.last-sync.stale {
  background: var(--coral-tint);
  border-color: var(--coral);
}

.last-sync.stale .last-sync-dot {
  background: var(--coral-deep);
}

.last-sync div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.last-sync strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
}

.muted {
  color: var(--navy-soft);
  font-size: 0.9rem;
}

/* Sync progress */
.progress {
  margin: 0.9rem 0 0.2rem;
}

.progress-track {
  height: 0.65rem;
  border-radius: 999px;
  background: var(--mist-deep);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--coral-deep));
  transition: width 0.4s ease;
}

.progress-bar.indeterminate {
  width: 35%;
  animation: progress-slide 1.3s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
  .progress-bar.indeterminate { animation: none; width: 100%; opacity: 0.5; }
  .btn { transition: none; }
}

.progress p {
  margin: 0.5rem 0 0;
}

@media (max-width: 640px) {
  .top {
    flex-direction: column;
    align-items: start;
  }

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

  .session-meta {
    text-align: left;
  }
}


/* Quick range navigation under the date pickers. */
.range-shortcuts {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.range-shortcuts .btn {
  margin-top: 0;
}

.btn.small {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}
