/* APS Bank Christmas 2026 | shared design system
   Premium, calm and warm. Brand greens, warm off-white, one restrained gold accent. */

/* ---------- Fonts: APS Font 2.1 from /brand/fonts ---------- */
@font-face { font-family: "APS Font"; src: url("/brand/fonts/APSFont-Thin.woff2") format("woff2"); font-weight: 150; font-style: normal; font-display: swap; }
@font-face { font-family: "APS Font"; src: url("/brand/fonts/APSFont-ExtraLight.woff2") format("woff2"); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: "APS Font"; src: url("/brand/fonts/APSFont-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "APS Font"; src: url("/brand/fonts/APSFont-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "APS Font"; src: url("/brand/fonts/APSFont-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "APS Font"; src: url("/brand/fonts/APSFont-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "APS Font"; src: url("/brand/fonts/APSFont-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "APS Font"; src: url("/brand/fonts/APSFont-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "APS Font"; src: url("/brand/fonts/APSFont-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* Brand greens. --aps-green is sampled from /brand/logo/aps-logo-green.png (#17430E,
     the logo's only solid colour). Dark and light are derived from it. */
  --aps-green-dark: #0f2d09;
  --aps-green: #17430e;
  --aps-green-light: #4a6c43;
  --aps-green-tint: #edf1eb;
  --aps-green-mist: #f5f7f3;

  /* Warm neutrals */
  --paper: #fbf8f3;
  --paper-2: #f4eee4;
  --limestone: #e8dcc6;
  --limestone-dark: #cdbb9c;
  --white: #ffffff;
  --ink: #262626;
  --ink-2: #4f4a43;
  --ink-3: #6b655c;
  --line: #e4dccf;
  --line-strong: #cfc4b2;

  /* One restrained festive accent */
  --gold: #b8893a;
  --gold-text: #85601d;
  --gold-soft: #f3e8d2;

  --danger: #a3311f;
  --danger-soft: #fbece8;
  --success: var(--aps-green);

  --font: "APS Font", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;
  --shadow-s: 0 1px 2px rgba(38, 30, 18, 0.06), 0 1px 1px rgba(38, 30, 18, 0.04);
  --shadow: 0 2px 6px rgba(38, 30, 18, 0.06), 0 10px 28px rgba(38, 30, 18, 0.07);
  --shadow-l: 0 6px 16px rgba(38, 30, 18, 0.08), 0 24px 60px rgba(38, 30, 18, 0.12);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;
  --container: 1120px;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--aps-green);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 17px; line-height: 1.55; font-weight: 400;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; color: var(--aps-green-dark); margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--aps-green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--aps-green-dark); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: var(--gold-soft); }
[hidden] { display: none !important; }
:lang(ar), [dir="rtl"] { font-family: var(--font); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.container--narrow { max-width: 720px; }
.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.center { text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-text); margin-bottom: var(--space-3); }
.lead { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); color: var(--ink-2); max-width: 46ch; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--aps-green); color: var(--white); padding: 10px 16px; border-radius: var(--radius-s); text-decoration: none; font-weight: 600; transition: top .15s; }
.skip-link:focus { top: 12px; color: var(--white); }
.divider-gold { width: 56px; height: 2px; background: var(--gold); border: 0; margin: var(--space-4) 0; }
.center .divider-gold, .divider-gold.center { margin-left: auto; margin-right: auto; }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header__inner { display: flex; align-items: center; gap: var(--space-4); min-height: 64px; }
.site-header__logo { display: inline-flex; align-items: center; flex: none; }
.site-header__logo img { width: 112px; height: auto; display: block; }
.site-header__app { font-weight: 700; color: var(--aps-green-dark); font-size: 1rem; padding-left: var(--space-4); border-left: 1px solid var(--line); line-height: 1.2; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.site-header__spacer { flex: 1; }
@media (min-width: 720px) { .site-header__inner { min-height: 76px; } .site-header__logo img { width: 132px; } .site-header__app { font-size: 1.05rem; } }
@media (max-width: 420px) { .site-header__inner { gap: var(--space-3); } .site-header__app { font-size: 0.86rem; padding-left: var(--space-3); } .site-header__logo img { width: 92px; } .lang-toggle button { min-width: 40px; padding: 10px 6px; } }

/* Language toggle: EN | MT */
.lang-toggle { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; flex: none; font-weight: 700; font-size: 0.85rem; color: var(--ink-3); }
.lang-toggle button {
  font: inherit; color: var(--ink-3); background: none; border: 0; cursor: pointer;
  padding: 10px 8px; min-width: 44px; min-height: 44px; border-radius: var(--radius-s); letter-spacing: 0.06em;
}
.lang-toggle button[aria-pressed="true"] { color: var(--aps-green); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.lang-toggle button:hover { color: var(--aps-green-dark); }

.demo-badge {
  position: fixed; right: 12px; bottom: 12px; z-index: 90;
  background: var(--aps-green-dark); color: var(--white); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; box-shadow: var(--shadow); border: 1px solid var(--gold);
}

/* ---------- Footer ---------- */
.site-footer { background: var(--white); border-top: 1px solid var(--line); margin-top: var(--space-8); padding: var(--space-6) 0 var(--space-5); color: var(--ink-2); font-size: 0.9rem; }
.site-footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.site-footer__logo { width: 84px; height: auto; display: block; }
.site-footer__endline { font-weight: 700; color: var(--aps-green-dark); margin: 0; font-size: 1rem; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: var(--space-4) 0; padding: 0; list-style: none; }
.site-footer__nav a { color: var(--ink-2); text-decoration: none; display: inline-block; padding: 6px 0; }
.site-footer__nav a:hover { color: var(--aps-green); text-decoration: underline; }
.site-footer__privacy { font-size: 0.82rem; color: var(--ink-3); max-width: 70ch; margin: var(--space-3) 0 var(--space-2); }
.site-footer__legal { font-size: 0.78rem; color: var(--ink-3); margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--aps-green); --btn-fg: var(--white); --btn-border: var(--aps-green);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; letter-spacing: 0.005em;
  min-height: 48px; padding: 12px 24px; border-radius: 999px; cursor: pointer;
  color: var(--btn-fg); background: var(--btn-bg); border: 1.5px solid var(--btn-border);
  text-decoration: none; transition: background .18s var(--ease), color .18s var(--ease), border-color .18s, transform .12s, box-shadow .18s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { --btn-bg: var(--aps-green-dark); --btn-border: var(--aps-green-dark); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--secondary { --btn-bg: var(--white); --btn-fg: var(--aps-green); --btn-border: var(--aps-green); }
.btn--secondary:hover { --btn-bg: var(--aps-green-tint); --btn-fg: var(--aps-green-dark); --btn-border: var(--aps-green-dark); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--aps-green); --btn-border: transparent; padding-left: 14px; padding-right: 14px; }
.btn--ghost:hover { --btn-bg: var(--aps-green-tint); --btn-fg: var(--aps-green-dark); --btn-border: transparent; }
.btn--gold { --btn-bg: var(--gold-soft); --btn-fg: var(--aps-green-dark); --btn-border: var(--gold); }
.btn--gold:hover { --btn-bg: #ecdcbc; --btn-fg: var(--aps-green-dark); --btn-border: var(--gold); }
.btn--danger { --btn-bg: var(--white); --btn-fg: var(--danger); --btn-border: var(--danger); }
.btn--danger:hover { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-border: var(--danger); }
.btn--small { min-height: 40px; padding: 8px 16px; font-size: 0.9rem; }
.btn--large { min-height: 56px; padding: 16px 32px; font-size: 1.1rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 48px; min-width: 48px; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.btn-row--center { justify-content: center; }

/* ---------- Cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-s); padding: clamp(20px, 3vw, 32px); }
.card--flat { box-shadow: none; }
.card--raised { box-shadow: var(--shadow); }
.card--paper { background: var(--paper); }
.card--link { display: block; color: inherit; text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-l); border-color: var(--line-strong); color: inherit; }
.card__title { margin: 0 0 6px; font-size: 1.3rem; }
.card__meta { font-size: 0.85rem; color: var(--ink-3); }
.grid { display: grid; gap: clamp(16px, 2.4vw, 24px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field__label { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.field__hint { font-size: 0.85rem; color: var(--ink-3); }
.field__error { font-size: 0.85rem; color: var(--danger); font-weight: 600; min-height: 0; }
.input, .select, .textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-s); padding: 12px 14px; min-height: 48px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #8b847a; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--aps-green); box-shadow: 0 0 0 3px rgba(23, 67, 14, 0.18); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.textarea { min-height: 96px; resize: vertical; }
.char-count { font-size: 0.8rem; color: var(--ink-3); align-self: flex-end; }

.choice-group { display: flex; flex-wrap: wrap; gap: var(--space-2); border: 0; padding: 0; margin: 0 0 var(--space-4); }
.choice-group legend { font-weight: 700; margin-bottom: var(--space-2); padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border: 1.5px solid var(--line-strong); background: var(--white); color: var(--ink); border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: var(--aps-green-light); }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip:has(input:checked) { background: var(--aps-green); border-color: var(--aps-green); color: var(--white); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { box-shadow: var(--focus); }

/* Segmented control */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--paper-2); border-radius: 999px; border: 1px solid var(--line); }
.segmented button { font: inherit; font-weight: 700; font-size: 0.92rem; border: 0; background: transparent; color: var(--ink-2); padding: 10px 18px; min-height: 44px; border-radius: 999px; cursor: pointer; }
.segmented button[aria-pressed="true"], .segmented button[aria-checked="true"] { background: var(--white); color: var(--aps-green-dark); box-shadow: var(--shadow-s); }

/* Stepper */
.steps { display: flex; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-5); counter-reset: step; }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--ink-3); counter-increment: step; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--white); font-weight: 700; }
.steps li[aria-current="step"] { color: var(--aps-green-dark); }
.steps li[aria-current="step"]::before { background: var(--aps-green); border-color: var(--aps-green); color: var(--white); }
.steps li.is-done::before { content: "\2713"; background: var(--aps-green-tint); border-color: var(--aps-green-light); color: var(--aps-green); font-family: system-ui, sans-serif; }

/* ---------- Feedback ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--gold-soft); border: 1px solid #e6d3ad; color: var(--ink); font-size: 0.95rem; }
.notice--green { background: var(--aps-green-tint); border-color: #cfdbc9; }
.notice--danger { background: var(--danger-soft); border-color: #f0c9bf; color: #6d1f12; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--aps-green-tint); color: var(--aps-green-dark); }
.badge--gold { background: var(--gold-soft); color: var(--gold-text); }

.toast-region { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast { background: var(--aps-green-dark); color: var(--white); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; box-shadow: var(--shadow-l); animation: toast-in .25s var(--ease); text-align: center; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--aps-green-tint); border-top-color: var(--aps-green); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Dialog ---------- */
.dialog { border: 0; padding: 0; border-radius: var(--radius-l); box-shadow: var(--shadow-l); width: min(94vw, 560px); max-height: 90vh; color: var(--ink); background: var(--white); }
.dialog::backdrop { background: rgba(20, 28, 18, 0.45); backdrop-filter: blur(2px); }
.dialog__body { padding: clamp(20px, 4vw, 32px); overflow: auto; max-height: 90vh; }
.dialog__close { position: absolute; top: 10px; right: 10px; }
.dialog[open] { animation: dialog-in .22s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Share panel ---------- */
.share-panel { display: flex; flex-direction: column; gap: var(--space-4); align-items: center; }
.share-panel__preview { width: min(100%, 360px); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); background: var(--paper); aspect-ratio: 4 / 5; object-fit: contain; }

/* ---------- Page sections ---------- */
.hero { padding: clamp(32px, 7vw, 88px) 0 clamp(24px, 5vw, 56px); }
.section { padding: clamp(28px, 5vw, 56px) 0; }
.section--tint { background: var(--paper-2); }
.page-title { margin-top: var(--space-6); }

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