/* HSBC GLOBAL design tokens.
   Source: hsbcglobal_Bank_Brandbook_v1 + ТЗ v1.1 (contrast corrections are marked). */
:root {
  /* brand palette (brandbook p.6) */
  --navy: #071E3B;
  --gold: #C99B43;
  --ivory: #F8F7F2;
  --slate: #536579;
  --mist: #E9EDF0;
  --white: #FFFFFF;
  --green: #19816D;
  --red: #B64C4B;

  /* additions for accessibility (ТЗ v1.1, B1-B3) */
  --gold-deep: #8A6420;   /* 4.99:1 on ivory, 5.35:1 on white. Use for text, borders and progress on light surfaces */
  --green-ink: #167360;   /* 5.36:1 on ivory, 4.88:1 on mist. Text version of Functional Green */
  --red-ink: #A94241;     /* 5.03:1 on mist. Text version of Functional Red */

  /* derived surfaces */
  --navy-2: #0D2B52;
  --navy-3: #16365F;
  --on-navy-soft: #B8C5D3;     /* 9.5:1 on navy */
  --input-border: #7D8B9B;     /* >= 3:1 against white */
  --line: #E1E6EA;

  /* shape (ТЗ §4) */
  --r-card: 22px;
  --r-input: 12px;
  --r-btn: 13px;
  --r-modal: 24px;

  --font: Lato, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(7, 30, 59, .05), 0 10px 28px rgba(7, 30, 59, .07);
  --ribbon-h: 0px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--navy); background: var(--ivory); line-height: 1.55; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible { outline-color: #E3C078; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--navy); color: #fff; padding: .7rem 1rem; border-radius: 10px; font-weight: 700; }
.skip:focus { left: 12px; }

/* persistent demo ribbon (ТЗ §4: status must always be visible) */
.ribbon {
  position: sticky; top: 0; z-index: 90; height: var(--ribbon-h);
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  background: var(--gold); color: var(--navy);
  font: 800 11.5px/1 var(--font); letter-spacing: .09em; text-transform: uppercase; padding: 0 12px; text-align: center;
}
.ribbon span + span::before { content: "\00b7"; margin-right: .6rem; }
@media (max-width: 520px) { .ribbon span:nth-child(3) { display: none; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .7rem 1.35rem; border-radius: var(--r-btn);
  border: 1.5px solid var(--navy); background: var(--navy); color: #fff;
  font-weight: 700; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.btn:hover { background: var(--navy-3); border-color: var(--navy-3); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--mist); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.gold:hover { background: #D6AB58; border-color: #D6AB58; }
.btn.danger { background: var(--red-ink); border-color: var(--red-ink); }
.btn.danger:hover { background: #8F3534; border-color: #8F3534; }
.btn.small { min-height: 38px; padding: .45rem .95rem; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.on-dark .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .6); }
.on-dark .btn.ghost:hover { background: rgba(255, 255, 255, .12); }

/* language switch */
.lang { display: inline-flex; border: 1.5px solid var(--input-border); border-radius: 10px; overflow: hidden; flex: none; background: transparent; }
.lang button { appearance: none; border: 0; background: transparent; cursor: pointer; padding: .38rem .6rem; font-weight: 800; font-size: 12px; letter-spacing: .05em; color: var(--slate); min-height: 32px; }
.lang button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.lang button:focus-visible { outline-offset: -3px; }
.on-dark .lang { border-color: rgba(255, 255, 255, .45); }
.on-dark .lang button { color: var(--on-navy-soft); }
.on-dark .lang button[aria-pressed="true"] { background: #fff; color: var(--navy); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
