/*
 * SunUp app stylesheet (ADR 0067). Fonts, tokens and base copied from the demo's sunup.css,
 * built from docs/SunUp_Brand_Guidelines_v1.md; the rest is the app's own.
 *
 * - Gold-led sunrise on navy. The signed-out site is Deep Navy, like the deck's cover: a full
 *   height Sunup Gold stripe on the left edge and the Rising U wordmark.
 * - Plus Jakarta Sans (700/800) for titles; Calibri for body text, with the bundled Carlito.
 * - Fonts load from ./fonts/, never from the internet.
 * - Sunup Gold is text on dark only; on light, colored text is Gold Deep or Ember Deep.
 * - Nothing in the 20° to 35° hue range (Command Alkon orange).
 * - Responsive from the start: phone, laptop and projector.
 */

/* Fonts (SIL Open Font License; licenses in ./fonts/) */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Carlito";
  src: url("fonts/Carlito-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Carlito";
  src: url("fonts/Carlito-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Carlito";
  src: url("fonts/Carlito-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Tokens */
:root {
  --su-deep-navy: #0d1b2a;
  --su-navy-mid: #1b3a5c;
  --su-navy-card: #17304f;
  --su-gold: #f2b230; /* Sunup Gold: accents, and text on dark only */
  --su-gold-deep: #a16207; /* gold for text on light */
  --su-ember: #d9472b; /* second accent, sparing; never text on light */
  --su-ember-deep: #b3361c; /* ember for text on light: problems only */
  --su-off-white: #fbf8f3;
  --su-warm-tint: #f5efe4;
  --su-white: #ffffff;
  --su-dark: #1e293b;
  --su-slate: #64748b;
  --su-muted: #94a3b8; /* secondary text on dark */
  --su-success-green: #10b981; /* the gain arrow (brand guidelines: Success Green) */
  --su-success-deep: #047857; /* dollars gained, as text on light */

  --su-font-display: "Plus Jakarta Sans", Calibri, Carlito, system-ui, sans-serif;
  --su-font-body: Calibri, Carlito, "Segoe UI", system-ui, sans-serif;

  --su-space-2: 8px;
  --su-space-3: 12px;
  --su-space-4: 16px;
  --su-space-5: 24px;
  --su-space-6: 32px;
  --su-space-7: 48px;
  --su-radius: 10px;
  --su-stripe: clamp(8px, 2.2vw, 22px); /* the cover's gold stripe: 0.22" of a 10" slide */
}

/* Base */
[hidden] {
  display: none !important;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 16px;
}
body {
  margin: 0;
  font-family: var(--su-font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,
h2 {
  font-family: var(--su-font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
:focus-visible {
  outline: 3px solid var(--su-gold);
  outline-offset: 2px;
}

/* The signed-out site: Deep Navy, like the deck's cover */
.su-cover {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--su-deep-navy);
  color: var(--su-white);
  border-left: var(--su-stripe) solid var(--su-gold);
  padding: clamp(24px, 6vw, 72px) clamp(20px, 7vw, 96px);
}
.su-cover__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 960px;
}
.su-cover__wordmark {
  font-size: clamp(3.5rem, 14vw, 8rem);
  line-height: 1;
}
.su-cover__wordmark a,
.su-cover__brand a {
  color: inherit;
  text-decoration: none;
}
.su-cover__tagline {
  margin: clamp(16px, 3vw, 28px) 0 0;
  font-family: var(--su-font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  color: var(--su-gold);
}
.su-cover__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--su-space-4);
  margin-top: clamp(32px, 6vw, 56px);
}

/* The smaller wordmark at the top of the other signed-out pages */
.su-cover__brand {
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1;
}
.su-cover__panel {
  width: 100%;
  max-width: 520px;
  margin-top: clamp(32px, 6vw, 56px);
}
.su-cover__panel h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}
.su-cover__lead {
  margin: var(--su-space-3) 0 0;
  color: var(--su-muted);
}

/* Buttons */
.su-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px; /* a comfortable tap target on a phone */
  padding: 0 var(--su-space-5);
  border-radius: var(--su-radius);
  border: 2px solid var(--su-gold);
  background: var(--su-gold);
  color: var(--su-deep-navy);
  font-family: var(--su-font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  cursor: pointer;
}
.su-button:hover {
  filter: brightness(1.06);
}
.su-button:disabled {
  opacity: 0.6;
  cursor: progress;
}
.su-button--outline {
  background: transparent;
  color: var(--su-white);
  border-color: var(--su-muted);
}
.su-button--outline:hover {
  border-color: var(--su-white);
}
.su-link {
  color: var(--su-gold);
}

/* The waitlist form */
.su-form {
  display: grid;
  gap: var(--su-space-4);
  margin-top: var(--su-space-6);
}
.su-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--su-space-4);
}
.su-field {
  display: grid;
  gap: 6px;
}
.su-field label {
  font-weight: 700;
}
.su-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--su-space-3);
  border: 2px solid var(--su-navy-mid);
  border-radius: var(--su-radius);
  background: var(--su-white);
  color: var(--su-dark);
  font: inherit;
}
.su-field input:focus {
  border-color: var(--su-gold);
  outline: none;
}
.su-form__error {
  margin: 0;
  padding: var(--su-space-3) var(--su-space-4);
  border-left: 4px solid var(--su-ember);
  background: var(--su-navy-card);
  color: var(--su-white);
}
.su-form .su-button {
  justify-self: start;
}

/* Signed in: a Deep Navy bar with the wordmark, then light content */
.su-app {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--su-off-white);
  color: var(--su-dark);
}
.su-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--su-space-4);
  padding: var(--su-space-4) clamp(16px, 4vw, 48px);
  background: var(--su-deep-navy);
  color: var(--su-white);
}
.su-bar__wordmark {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1;
  text-decoration: none;
}
.su-button--small {
  min-height: 40px;
  padding: 0 var(--su-space-4);
  font-size: 0.9375rem;
}
.su-app__main {
  max-width: 960px;
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 48px);
}
.su-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--su-space-3);
  border: 2px solid var(--su-navy-mid);
  border-radius: var(--su-radius);
  background: var(--su-white);
  color: var(--su-dark);
  font: inherit;
}

/* The signed-in header: wordmark, Quotes, who's signed in, the producer picker, Log out */
.su-bar {
  flex-wrap: wrap;
}
.su-bar__nav {
  display: flex;
  gap: var(--su-space-2);
  margin-right: auto;
  align-self: flex-end;
  /* the links reach the header's bottom edge, so the current page's bar sits on it */
  margin-bottom: calc(-1 * var(--su-space-4));
}
/* Header links, like the demo's tabs (its .su-tab, copied): Muted, white on hover, and the
   current page white with a 4px Sunup Gold bar on the header's bottom edge */
.su-bar__link {
  color: var(--su-muted);
  font-family: var(--su-font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  padding: var(--su-space-3) var(--su-space-4);
  border-bottom: 4px solid transparent;
}
.su-bar__link:hover {
  color: var(--su-white);
}
.su-bar__link[aria-current="page"] {
  color: var(--su-white);
  border-bottom-color: var(--su-gold);
}
@media (max-width: 640px) {
  /* On a phone the header wraps: the links take their own row at the bottom */
  .su-bar__nav {
    order: 3;
    width: 100%;
  }
}
.su-bar__right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--su-space-3) var(--su-space-4);
}
.su-bar__who {
  color: var(--su-muted);
}
.su-bar__producers select {
  min-height: 40px;
  padding: 0 var(--su-space-3);
  border: 2px solid var(--su-navy-mid);
  border-radius: var(--su-radius);
  background: var(--su-white);
  color: var(--su-dark);
  font: inherit;
}
.su-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.su-app__main--wide {
  max-width: 1320px;
  margin: 0 auto;
}
.su-app__title {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
}
.su-app__lead {
  margin: var(--su-space-2) 0 var(--su-space-5);
  color: var(--su-slate);
}
.su-empty {
  padding: var(--su-space-6);
  border: 2px dashed var(--su-warm-tint);
  border-radius: var(--su-radius);
  color: var(--su-slate);
  text-align: center;
}
.su-back {
  margin: 0 0 var(--su-space-4);
}
.su-back a {
  color: var(--su-gold-deep);
  font-weight: 700;
}

/* Tables, and the Quotes list (from the demo's Quotes tab, ADR 0065): a list, not a dashboard.
   The Decision cell uses the decision bar's parts: the word in Gold Deep, the price, a gain in
   green, or who it waits on. A lower price is never red. */
.su-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--su-white);
}
.su-table th {
  background: var(--su-navy-mid);
  color: var(--su-white);
  text-align: left;
  font-weight: 700;
  padding: var(--su-space-2) var(--su-space-3);
}
.su-table td {
  padding: var(--su-space-3);
  border-bottom: 1px solid var(--su-warm-tint);
}
.su-table tr:nth-child(even) td {
  background: var(--su-off-white);
}
.su-quotes {
  overflow-x: auto;
}
.su-quotes__table td,
.su-quotes__table th {
  vertical-align: top;
}
.su-quotes__row {
  cursor: pointer;
}
.su-quotes__row:hover td {
  background: var(--su-warm-tint);
}
.su-quotes__link {
  color: var(--su-dark);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.su-quotes__num {
  text-align: right;
  white-space: nowrap;
}
.su-quotes__word {
  font-family: var(--su-font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--su-gold-deep);
}
.su-quotes__price {
  font-family: var(--su-font-display);
  font-weight: 700;
  color: var(--su-dark);
}
.su-quotes__waiting {
  display: block;
  color: var(--su-slate);
  font-style: italic;
}
.su-gain {
  font-weight: 700;
  color: var(--su-success-deep);
  white-space: nowrap;
}
.su-gain__arrow {
  color: var(--su-success-green);
  margin-right: var(--su-space-2);
  font-size: 0.85em;
}
.su-quotes__decision .su-gain__arrow {
  margin-right: 4px;
}
.su-gain--neutral {
  color: var(--su-slate);
}

/* Quote detail: the decision bar, then the record, then the messages as an email thread */
.su-card {
  background: var(--su-white);
  border: 1px solid var(--su-warm-tint);
  border-radius: var(--su-radius);
  padding: var(--su-space-5);
  margin-top: var(--su-space-5);
}
.su-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--su-space-3) var(--su-space-6);
  border-left: 5px solid var(--su-gold);
}
.su-result .su-quotes__word,
.su-result .su-quotes__price {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}
.su-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.su-stat__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--su-slate);
}
.su-stat__value {
  font-family: var(--su-font-display);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.15;
  white-space: nowrap;
}
.su-stat__value--gain {
  color: var(--su-success-deep);
}
.su-stat__value .su-gain__arrow {
  font-size: 0.6em;
  vertical-align: 0.25em;
}
.su-quote__heading {
  font-size: 1.25rem;
  margin-bottom: var(--su-space-3);
}
.su-quote__label {
  margin: var(--su-space-4) 0 var(--su-space-2);
  font-weight: 700;
}
.su-quote__list {
  margin: 0;
  padding-left: var(--su-space-5);
}
.su-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--su-space-2) var(--su-space-5);
  margin: var(--su-space-3) 0 0;
}
.su-facts dt {
  color: var(--su-slate);
}
.su-facts dd {
  margin: 0;
  font-weight: 700;
}
.su-email {
  border: 1px solid var(--su-warm-tint);
  border-radius: var(--su-radius);
  padding: var(--su-space-4);
  margin-top: var(--su-space-4);
}
.su-email--out {
  border-left: 5px solid var(--su-gold);
  background: var(--su-off-white);
}
.su-email--in {
  border-left: 5px solid var(--su-navy-mid);
}
.su-email__head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--su-space-2);
  color: var(--su-slate);
  font-size: 0.9375rem;
}
.su-email__who {
  font-weight: 700;
  color: var(--su-dark);
}
.su-email__subject {
  margin: var(--su-space-2) 0;
  font-weight: 700;
}
.su-email__body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Phones */
@media (max-width: 720px) {
  /* The Quotes list becomes stacked cards */
  .su-quotes__table thead {
    display: none;
  }
  .su-quotes__table,
  .su-quotes__table tbody,
  .su-quotes__table tr,
  .su-quotes__table td {
    display: block;
    width: 100%;
  }
  .su-quotes__table tr {
    border: 1px solid var(--su-warm-tint);
    border-radius: var(--su-radius);
    margin-bottom: var(--su-space-3);
    background: var(--su-white);
    overflow: hidden;
  }
  .su-quotes__table td,
  .su-quotes__table tr:nth-child(even) td {
    display: flex;
    justify-content: space-between;
    gap: var(--su-space-4);
    border-bottom: 1px solid var(--su-off-white);
    text-align: right;
    background: var(--su-white);
  }
  .su-quotes__table td::before {
    content: attr(data-label);
    color: var(--su-slate);
    text-align: left;
    flex: none;
  }
  .su-quotes__table td.su-quotes__num {
    text-align: right;
  }
  .su-facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .su-facts dd {
    margin-bottom: var(--su-space-2);
  }
  .su-stat {
    align-items: flex-start;
    text-align: left;
  }
  .su-bar__right {
    width: 100%;
  }
}
@media (max-width: 520px) {
  .su-form__row {
    grid-template-columns: 1fr;
  }
  .su-cover__actions .su-button,
  .su-form .su-button {
    width: 100%;
    justify-self: stretch;
  }
}

/* Quote detail: a chat shown as the conversation (ADR 0075), in the demo's chat look */
.su-chatlog {
  display: flex;
  flex-direction: column;
  gap: var(--su-space-3);
}
.su-chatlog__msg {
  max-width: min(640px, 88%);
  padding: var(--su-space-3) var(--su-space-4);
  border-radius: 14px;
  background: var(--su-white);
  border: 1px solid var(--su-warm-tint);
}
.su-chatlog__msg--rep {
  align-self: flex-end;
  background: var(--su-navy-mid);
  border-color: var(--su-navy-mid);
  color: var(--su-white);
}
.su-chatlog__head {
  display: flex;
  justify-content: space-between;
  gap: var(--su-space-4);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.su-chatlog__msg--sunup .su-chatlog__when {
  color: var(--su-slate);
  font-weight: 400;
}
.su-chatlog__msg--rep .su-chatlog__when {
  color: var(--su-muted);
  font-weight: 400;
}
.su-chatlog__text {
  white-space: pre-wrap;
}

/* The Chat page (ADR 0075): the demo's chat look, copied, with the input pinned at the
   bottom on a phone */
/* The page is a column as tall as the screen, whatever the header's height (two rows on a
   phone): the chat fills what's left, and its input stays at the bottom */
.su-app--chat {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}
.su-chatpage {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.su-chatpage__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--su-space-4);
}
.su-button--outline-dark {
  background: transparent;
  color: var(--su-navy-mid);
  border-color: var(--su-navy-mid);
}
.su-button--outline-dark:hover {
  background: var(--su-warm-tint);
}
.su-chatpage__log {
  flex: 1;
  margin-top: var(--su-space-5);
  padding-bottom: var(--su-space-5);
}
.su-chatpage__log .su-chatlog__msg--sunup {
  border-left: 3px solid var(--su-gold);
}
.su-chatlog__bar {
  margin-top: var(--su-space-3);
  padding-top: var(--su-space-3);
  border-top: 1px solid var(--su-warm-tint);
  font-size: 1.0625rem;
}
.su-chatlog__time {
  align-self: flex-start;
  margin-top: calc(-1 * var(--su-space-2));
  font-size: 0.8125rem;
  color: var(--su-slate);
}
.su-typing {
  display: inline-flex;
  gap: 5px;
  padding: var(--su-space-2) 0;
}
.su-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--su-gold);
  animation: su-typing 1.2s infinite ease-in-out;
}
.su-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.su-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes su-typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .su-typing span {
    animation: none;
    opacity: 0.8;
  }
}
.su-chatpage__form {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: var(--su-space-2);
  align-items: flex-end;
  padding: var(--su-space-3) 0 var(--su-space-4);
  background: var(--su-off-white);
  border-top: 1px solid var(--su-warm-tint);
}
.su-chatpage__input {
  flex: 1;
  min-height: 48px;
  max-height: 180px;
  padding: var(--su-space-3);
  border: 2px solid var(--su-navy-mid);
  border-radius: var(--su-radius);
  background: var(--su-white);
  color: var(--su-dark);
  font: inherit;
  resize: none;
}
.su-chatpage__input:focus {
  border-color: var(--su-gold);
  outline: none;
}
.su-error {
  margin: var(--su-space-3) 0 0;
  color: var(--su-ember-deep);
}
@media (max-width: 520px) {
  .su-chatpage .su-chatlog__msg {
    max-width: 92%;
  }
  .su-chatpage__form .su-button {
    min-height: 48px;
  }
}
