/*
  styles.css — The look of the Scam Shield dashboard.

  How it fits in: every page in static/ loads this file. Our brand colors
  are defined ONCE as variables (in :root below), so the whole app stays
  on-brand (black, gold and red) and a color change only happens in one place.
  Gold is for actions and headings. Red is for danger: scam alerts, risk
  scores and errors.

  Mobile-first: the main styles are for phones. Bigger screens get a few
  extras in the @media block at the bottom.
*/

:root {
  --color-black: #1C1C1C;    /* page background */
  --color-gold: #C9A227;     /* brand accent: headings, buttons, highlights */
  --color-gold-light: #E3C55A; /* gold buttons when you hover over them */
  --color-surface: #262626;  /* cards: a little lighter than the background */
  --color-text: #F5F5F5;     /* main text: near-white, easy to read on black */
  --color-muted: #B3B3B3;    /* secondary text */
  --color-red: #C8102E;      /* danger: alert cards, "Join call", red stripes */
  --color-alert: #FF5A5F;    /* red text on black (brighter, so it's easy to read) */
  --color-success: #7BD88F;  /* "it worked" messages */
  --radius: 16px;            /* rounded corners */
}

/* Make width and padding add up the way you'd expect */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  /* Center the card in the middle of the screen */
  display: grid;
  place-items: center;
  /* 16px gap at the edges so nothing touches the phone's screen edge */
  padding: 16px;
  background: var(--color-black);
  color: var(--color-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Larger-than-usual text: family members of all ages read this on phones */
  font-size: 18px;
  line-height: 1.5;
}

.card {
  width: 100%;
  max-width: 480px;
  padding: 32px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-gold);
  /* A red stripe along the top: our "danger" color, used as an accent */
  border-top: 6px solid var(--color-red);
  border-radius: var(--radius);
  text-align: center;
}

.badge {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--color-gold);
  color: var(--color-black);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 8px;
  color: var(--color-gold);
  font-size: 2rem;
}

.tagline {
  margin: 0 0 24px;
}

.status {
  margin: 0;
  color: var(--color-muted);
  font-size: 16px;
}

/* Added by app.js when the server answers */
.status-ok {
  color: var(--color-gold);
  font-weight: 700;
}

h2 {
  margin: 0 0 8px;
  color: var(--color-gold);
  font-size: 1.25rem;
}

/* ----- Sign-up form ----- */

.form,
.panel {
  margin: 0 0 24px;
  text-align: left;
}

fieldset {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid #444;
  border-radius: 12px;
}

legend {
  padding: 0 6px;
  color: var(--color-muted);
  font-size: 16px;
}

label {
  display: block;
  margin: 8px 0;
}

input,
select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #555;
  border-radius: 8px;
  background: var(--color-black);
  color: var(--color-text);
  font: inherit;
}

/* A clear gold ring for keyboard users, so they can see where they are */
input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

button {
  width: 100%;
  margin: 8px 0 0;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  background: var(--color-gold);
  color: var(--color-black);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* The big "Call me into the call" button: easy to hit in a hurry */
.button-big {
  padding: 18px 16px;
  font-size: 1.2rem;
}

.hint {
  color: var(--color-muted);
  font-size: 16px;
}

.error {
  min-height: 1.5em;
  color: var(--color-alert);
}

.badge-alert {
  background: var(--color-red);
  color: var(--color-text);
}

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

/* Tablets and computers: a bit more breathing room */
@media (min-width: 768px) {
  .card {
    padding: 48px 40px;
  }

  h1 {
    font-size: 2.5rem;
  }
}

/* Numbered setup steps: roomy, so each step is easy to follow */
/* ----- Phone setup steps (setup.html) ----- */

.back-link {
  display: inline-block;
  margin-bottom: 8px;
}

.setup-steps {
  padding-left: 1.4em;
  text-align: left;
}

.setup-steps li {
  margin-bottom: 28px;
}

.setup-steps li::marker {
  color: var(--color-gold);
  font-size: 1.3rem;
  font-weight: 700;
}

.setup-steps h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.setup-steps p {
  margin: 8px 0;
}

/* A code to dial, big enough to read off one phone while typing on another */
.dial-code {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--color-black);
  color: var(--color-gold);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

/* Username and domain for the landline adapter */
.setup-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
}

.setup-details dt {
  color: var(--color-muted);
}

.setup-details dd {
  margin: 0;
  font-family: ui-monospace, Menlo, monospace;
  overflow-wrap: anywhere;
}

/* "Phone setup steps" on a senior's card in "Your family" */
.setup-card-link {
  display: inline-block;
  margin: 8px 0;
}

/* ----- Buttons that are links (a class="button") ----- */

/* Looks just like our gold <button>, but it's a link to another page */
.button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--color-gold);
  color: var(--color-black);
  font-weight: 700;
  text-decoration: none;
}

/* Hovering makes any button a little brighter, whatever its color */
.button:hover,
button:hover:not(:disabled) {
  filter: brightness(1.12);
}

.button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

.button-small {
  padding: 8px 16px;
  font-size: 16px;
}

/* Second choice next to a gold button: same shape, just an outline */
.button-outline {
  background: transparent;
  border: 2px solid var(--color-gold);
  color: var(--color-gold);
}

.button-outline:hover {
  background: var(--color-gold);
  color: var(--color-black);
}

.button-danger {
  background: var(--color-red);
  color: var(--color-text);
}

/* A button that looks like a plain link, for small things like "Log out" */
.button-link {
  width: auto;
  margin: 0;
  padding: 0;
  background: none;
  color: var(--color-gold);
  font-weight: 400;
  text-decoration: underline;
}

.button-link:hover:not(:disabled) {
  color: var(--color-gold-light);
}

/* ----- Login page (login.html) and dashboard account bar ----- */

.brand {
  display: inline-block;
  margin: 0 0 16px;
  color: var(--color-gold);
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
}

/* The "Log in" and "Sign up" switch at the top of the login card */
.tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 24px;
  padding: 4px;
  border: 1px solid #444;
  border-radius: 999px;
}

.tab {
  margin: 0;
  background: transparent;
  color: var(--color-muted);
}

.tab[aria-pressed="true"] {
  background: var(--color-gold);
  color: var(--color-black);
}

.success {
  color: var(--color-success);
}

.account-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid #444;
  color: var(--color-muted);
  font-size: 16px;
  /* Long emails wrap instead of pushing the card wider than the phone */
  overflow-wrap: anywhere;
}

/* ----- The header on every page (nav.js) ----- */

/* Pages with the header scroll like a normal web page, with the header on
   top, instead of one card in the middle of the screen. */
body.landing,
body.with-header {
  display: block;
  /* Undo the centering from body above. New browsers center block pages
     with it too, which would squeeze the header and footer. */
  place-items: normal;
  padding: 0;
}

/* The card sits under the header, with the same 16px edges on a phone */
body.with-header > .card {
  width: calc(100% - 32px);
  margin: 8px auto 32px;
}

/* The header itself (logo, tabs, Log in) is styled in header.css */

/* ----- Landing page (landing.html) ----- */

.hero {
  display: grid;
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 16px;
  line-height: 1.15;
}

.text-red {
  color: var(--color-alert);
}

.lead {
  margin: 0 0 24px;
  color: var(--color-muted);
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* The pretend family alert next to the headline */
.alert-preview {
  padding: 24px;
  background: var(--color-surface);
  border: 2px solid var(--color-red);
  border-radius: var(--radius);
  /* A soft red glow, like the alert is calling for attention */
  box-shadow: 0 0 40px rgba(200, 16, 46, 0.35);
}

.alert-preview-label {
  margin: 0 0 8px;
  color: var(--color-alert);
  font-weight: 700;
}

.risk-score {
  margin: 0 0 12px;
  color: var(--color-muted);
}

.risk-score span {
  color: var(--color-alert);
  font-size: 3rem;
  font-weight: 800;
}

.reasons {
  margin: 0 0 20px;
  padding-left: 1.2em;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 16px;
  border-top: 1px solid #333;
}

.section h2 {
  margin-bottom: 24px;
  font-size: 1.8rem;
}

h3 {
  margin: 0 0 8px;
  color: var(--color-gold);
  font-size: 1.15rem;
}

/* "How it works": three numbered cards. The numbers come from the CSS
   counter below, drawn in a red circle. */
.step-cards {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-cards li,
.feature {
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid #3a3a3a;
  border-radius: var(--radius);
}

.step-cards li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--color-red);
  color: var(--color-text);
  font-weight: 800;
}

.step-cards p,
.feature p {
  margin: 0;
  color: var(--color-muted);
}

.feature-grid {
  display: grid;
  gap: 16px;
}

.feature {
  border-left: 4px solid var(--color-gold);
}

.cta {
  text-align: center;
}

/* "Learn more:" links under the feature cards on the home page */
.learn-more {
  margin-top: 28px;
  color: var(--color-muted);
  line-height: 2;
  text-align: center;
}

.site-footer {
  padding: 24px 16px 40px;
  border-top: 1px solid #333;
  color: var(--color-muted);
  font-size: 15px;
  text-align: center;
}

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

/* Tablets and computers: headline and alert side by side, cards in rows */
@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    padding-top: 64px;
    padding-bottom: 80px;
  }

  .hero h1 {
    font-size: 3.4rem;
  }

  .step-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ----- Your family: each senior and their past calls (family.js) ----- */

/* The heading over each group: Mom, Grandma... Other. */
.family-group {
  margin: 24px 0 8px;
  color: var(--color-gold);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.family-group:first-child {
  margin-top: 0;
}

/* "Who are they to you?" on each card. */
.relationship-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

.relationship-picker select {
  width: auto;
  margin-top: 0;
}

.senior {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid #444;
  border-radius: 12px;
  background: var(--color-black);
}

.senior-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.senior-top h3 {
  margin: 0;
}

.senior h4 {
  margin: 16px 0 8px;
  color: var(--color-muted);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.senior h5 {
  margin: 12px 0 4px;
  color: var(--color-gold);
  font-size: 16px;
}

/* The status next to the senior's name. Only "Protected" gets the gold,
   so it's easy to spot when someone ISN'T protected. */
.status-pill {
  padding: 2px 10px;
  border: 1px solid var(--color-muted);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 700;
}

.status-active {
  border-color: var(--color-gold);
  background: var(--color-gold);
  color: var(--color-black);
}

.pause .hint {
  margin: 4px 0 0;
}

.remove-question .hint {
  margin-bottom: 8px;
}

.call-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.call {
  border-top: 1px solid #333;
}

/* Each call is a big tap target that looks like a row, not a gold button */
.call-button {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px 0;
  border-radius: 0;
  background: none;
  color: var(--color-text);
  font-weight: 400;
  text-align: left;
}

.call-words {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.call-when {
  font-weight: 700;
}

.call-from,
.call-verdict {
  color: var(--color-muted);
  font-size: 16px;
}

/* The score in a circle. Red only for scams, gold for "take a look". */
.score {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid #555;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 800;
}

.score-high {
  border-color: var(--color-red);
  background: var(--color-red);
  color: var(--color-text);
}

.score-mid {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.score-low {
  color: var(--color-muted);
}

.call-details {
  padding: 0 0 12px;
}

/* Wider screens: line the details up with the words, next to the score circle */
@media (min-width: 480px) {
  .call-details {
    padding-left: 64px;
  }
}

.call-details p {
  margin: 4px 0;
}

.sources {
  margin: 0;
  padding-left: 1.2em;
  /* Long page titles and links wrap instead of making the page scroll sideways */
  overflow-wrap: anywhere;
}

/* "Was this a scam?" under a call's details */
.was-it-a-scam {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.answer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.answer-buttons button {
  width: auto;
  margin: 0;
}

/* The answer they picked is filled in gold, so it's clear what they said */
.answer-buttons button[aria-pressed="true"] {
  background: var(--color-gold);
  color: var(--color-black);
}

/* "Report and block" under a scam call's details */
.report-and-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

/* The FTC report text: easy to read, and easy to copy by hand */
.report-text {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid #555;
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 16px;
  resize: vertical;
}

.answer-buttons .button {
  margin: 0;
}

.phone-steps {
  margin-top: 12px;
}

.phone-steps summary {
  color: var(--color-gold);
  cursor: pointer;
}

/* Make sure the "hidden" attribute always wins over display rules above */
[hidden] {
  display: none !important;
}
