/* TariffSnap app styles — BlackBooks Lite visual language.
 *
 * Every colour, size, space and radius resolves to a token from
 * issaabuu-theme.css, which is a port of the BlackBooks Lite palette. Nothing
 * here invents a value. A buyer who has seen one Issaabuu product should not
 * have to be told this is the same company.
 *
 * The moves that make the family recognisable, in order of how much they carry:
 *   1. Warm parchment behind cream cards -- never a cold white page, and never
 *      a filled brand-colour banner across the top.
 *   2. A serif display face for titles and amounts, over a humanist body face.
 *      Card section headers are italic; nothing else is.
 *   3. An uppercase, letterspaced gold micro-label above a section.
 *   4. Generous card radii with a soft, warm shadow.
 *   5. A semantic figure sits on a pale wash of its own hue.
 *
 * What this replaced: Arial, a Material-palette blue belonging to no Issaabuu
 * surface, and text-align: center on body.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  /* Left-aligned. A customs broker reads this page; ragged-centre prose is
     slower to read and the old centring was why lists stranded their markers
     against the left edge. */
  text-align: left;
}

/* ---------------------------------------------------------------- header --*/

/* No filled banner. The family's header is the eyebrow label and a serif title
   sitting directly on the parchment. */
header {
  padding: var(--space-2xl) var(--space-xl) var(--space-lg);
}

.masthead {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-sm) var(--space-lg);
}

.brand {
  width: 100%;
}

header h1 {
  font-family: var(--font-display);
  font-size: var(--size-h2);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.3px;
  margin: var(--space-xs) 0 0;
  flex: 1 1 18rem;
}

.lang-label {
  font-size: var(--size-micro);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

#langSelect {
  margin-left: var(--space-xs);
  font: inherit;
  font-size: var(--size-small);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-surface-3);
  background: var(--color-surface);
  color: var(--color-text);
  max-width: 12rem;
}

/* ------------------------------------------------------------------ main --*/

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 var(--space-xl) var(--space-3xl);
}

main h2 {
  font-family: var(--font-display);
  font-size: var(--size-h3);
  font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-md);
}

main h3 {
  font-family: var(--font-body);
  font-size: var(--size-lead);
  font-weight: var(--weight-bold);
}

/* A section, on its own card, introduced by the question it answers. MAYA S9
   gives every primary surface exactly one question; the eyebrow is where the
   family puts that kind of label. */
.surface {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  margin: 0 0 var(--space-xl);
}

.surface__question {
  font-family: var(--font-body);
  font-size: var(--size-micro);
  font-weight: var(--weight-medium);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 0 0 var(--space-md);
}

/* ------------------------------------------------------------ the pitch --*/

#pitch {
  margin: 0 0 var(--space-xl);
  padding: 0 var(--space-xs);
}

.pitch-lead {
  font-size: var(--size-lead);
  line-height: var(--leading-base);
  margin: 0 0 var(--space-md);
  color: var(--color-text-secondary);
}

/* The free allowance, on a wash of the hue that means "this is in your
   favour" -- the same treatment BlackBooks Lite gives an income figure. */
.pitch-offer {
  display: inline-block;
  background: var(--color-success-tint);
  color: var(--color-success);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  font-weight: var(--weight-medium);
  margin: 0;
}

/* ------------------------------------------------------------- onboarding -*/

.onboarding-card {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.onboarding-card h2 {
  font-style: italic;
  margin-top: 0;
}

.onboarding-card h3 {
  margin: var(--space-xl) 0 var(--space-xs);
}

.onboarding-card ul,
.onboarding-card ol {
  margin: 0;
  padding-left: var(--space-xl);
  line-height: var(--leading-base);
  color: var(--color-text-secondary);
}

.onboarding-card p {
  line-height: var(--leading-base);
  margin: var(--space-xs) 0 0;
  color: var(--color-text-secondary);
}

.onboarding-caveat {
  font-size: var(--size-small);
  margin-top: var(--space-xl);
}

.onboarding-card .cta {
  margin-top: var(--space-xl);
}

/* ---------------------------------------------------------------- buttons -*/

/* The family's primary action: a gold gradient, full width, generously
   rounded, with a warm shadow under it. */
.cta {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, var(--color-gold-alt), var(--color-gold-dim));
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-gold);
  color: var(--color-text-inverse);
  font-family: var(--font-body);
  font-size: var(--size-lead);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.5px;
  padding: var(--space-lg) var(--space-xl);
  cursor: pointer;
  transition: filter var(--motion-fast) ease;
}

.cta:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* A disabled control states why it is disabled next to it, never on its own.
   MAYA S12: a paywalled or unready destination states the limit before the
   click. Reduced opacity alone is not a reason. */
.cta:disabled {
  background: var(--color-disabled);
  color: var(--color-text-secondary);
  box-shadow: none;
  cursor: not-allowed;
}

.notify-btn {
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  color: var(--color-gold);
  border: 1px solid var(--color-surface-3);
  border-radius: var(--radius-full);
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ plan / pay --*/

.plan-label {
  display: block;
  font-size: var(--size-small);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

#planSelect {
  font: inherit;
  font-size: var(--size-lead);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-surface-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text);
  width: 100%;
}

#usageMeter {
  margin: var(--space-lg) 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: var(--size-small);
  color: var(--color-text-secondary);
}

#usageProgress {
  flex: 1 1 8rem;
  height: var(--space-sm);
}

#upgradePrompt {
  width: 100%;
  margin: var(--space-xs) 0 0;
  color: var(--color-danger);
  font-weight: var(--weight-medium);
}

.charge-notice {
  margin-top: var(--space-md);
  font-size: var(--size-small);
  color: var(--color-text-secondary);
}

/* Not an alarm. This says "checkout is still waking up", which is a state the
   page is allowed to be in; it used to render as a red role="alert" above the
   fold on a first visit, before the visitor had asked for anything. The danger
   hue is reserved for a wrong answer at a border. */
#checkoutError {
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  font-size: var(--size-small);
  color: var(--color-text-secondary);
}

#referralMsg {
  font-size: var(--size-small);
  color: var(--color-text-tertiary);
  margin: 0 0 var(--space-xl);
  padding: 0 var(--space-xs);
}

/* ------------------------------------------------------------ duty rates --*/

#dutyTable {
  border-collapse: collapse;
  width: 100%;
}

#dutyTable th,
#dutyTable td {
  border-bottom: 1px solid var(--color-surface-3);
  padding: var(--space-md) var(--space-sm);
  text-align: left;
}

#dutyTable th {
  font-size: var(--size-micro);
  font-weight: var(--weight-medium);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* An amount is set in the display face, in gold, the way the family sets every
   figure that matters. */
#dutyTable td:last-child {
  font-family: var(--font-display);
  font-size: var(--size-lead);
  font-weight: var(--weight-semibold);
  color: var(--color-gold);
  text-align: right;
}

/* ------------------------------------------------------- classification --*/

#react-root h2 {
  font-style: italic;
}

#react-root input,
#react-root textarea {
  width: 100%;
  font: inherit;
  font-size: var(--size-lead);
  padding: var(--space-lg);
  margin-top: var(--space-md);
  border: 1px solid var(--color-surface-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text);
}

#react-root .cta {
  margin-top: var(--space-md);
}

#react-root .result {
  margin-top: var(--space-xl);
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

/* The HS code is this product's hero figure. It gets the treatment the
   balance gets on the BlackBooks Lite home screen. */
#react-root .result strong,
#react-root .hs-code {
  font-family: var(--font-display);
  font-size: var(--size-h3);
  font-weight: var(--weight-semibold);
  color: var(--color-gold);
  letter-spacing: 0.5px;
}

#react-root .status {
  margin-top: var(--space-md);
  color: var(--color-gold);
  font-weight: var(--weight-medium);
}

#react-root .error {
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-danger-tint);
  border-radius: var(--radius-md);
  color: var(--color-danger);
  font-weight: var(--weight-medium);
}

/* MAYA S10: colour alone never encodes confidence or risk, so "no code was
   produced" carries a rule and a weight as well as a colour. It sits where the
   HS code would have been, which is the point -- an absent classification must
   not read like a quiet footnote under a result. */
#react-root .unavailable {
  margin: 0 0 var(--space-md);
  padding-left: var(--space-md);
  border-left: 3px solid var(--color-danger);
  color: var(--color-danger);
  font-weight: var(--weight-bold);
}

#react-root .source,
#react-root .status-note {
  margin-top: var(--space-md);
  font-size: var(--size-small);
  color: var(--color-text-secondary);
}

/* ---------------------------------------------------------------- report --*/

#report {
  margin: 0 0 var(--space-xl);
}

#report dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-md) var(--space-xl);
  /* Rows were overlapping the download button underneath: a grid inside a
     centred column with no explicit flow still needs its items placed on rows,
     and `margin: 0` on dd left nothing to separate them. */
  align-items: baseline;
  margin: var(--space-lg) 0 var(--space-xl);
}

#report dt {
  font-size: var(--size-micro);
  font-weight: var(--weight-medium);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin: 0;
}

#report dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--size-lead);
  font-weight: var(--weight-semibold);
}

#report .disclaimer {
  margin-top: var(--space-md);
  font-size: var(--size-small);
  color: var(--color-text-secondary);
}

/* ---------------------------------------------------------------- footer --*/

footer {
  padding: var(--space-xl);
  text-align: center;
}

footer a {
  margin: 0 var(--space-sm);
  font-size: var(--size-small);
  color: var(--color-gold);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.social a {
  margin: 0 var(--space-sm);
  color: var(--color-gold);
  text-decoration: none;
}

/* ------------------------------------------------------------ responsive --*/

@media (max-width: 768px) {
  header {
    padding: var(--space-xl) var(--space-lg) var(--space-md);
  }

  header h1 {
    font-size: var(--size-h3);
  }

  main {
    padding: 0 var(--space-lg) var(--space-2xl);
  }

  .surface {
    padding: var(--space-lg);
  }

  #dutyTable th,
  #dutyTable td {
    padding: var(--space-md) var(--space-xs);
  }
}

/* MAYA S10: reduced-motion preferences are respected. The onboarding dismiss
   scrolls the classification form into view; for a user who has asked for less
   motion that jump is the whole animation budget spent at once. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
