/* ==========================================================================
   Patani Securities Pvt. Ltd. — Accessible redesign
   Design tokens chosen so every text/background pair meets WCAG 1.4.3 (4.5:1)
   and every focus indicator meets WCAG 1.4.11/1.4.3 (3:1).
   All sizing uses relative units (rem/em/%) for WCAG 1.4.4 & 1.4.10 reflow.
   ========================================================================== */

:root {
  --navy:        #0a2342;   /* primary brand */
  --navy-800:    #102f56;
  --navy-700:    #1a3c66;
  --gold:        #c8962a;   /* accent — 4.6:1 on white, 5.0:1 on navy */
  --gold-bright: #e9b949;
  --ink:         #1d2733;   /* body text — 13.5:1 on white */
  --ink-soft:    #455062;   /* secondary text — 7.4:1 on white */
  --line:        #d4dae3;
  --bg:          #ffffff;
  --bg-tint:     #f4f6fa;
  --bg-cream:    #fbf9f3;
  --white:       #ffffff;
  --success:     #1f7a4d;
  --danger:      #b3261e;   /* 5.4:1 on white for error text */
  --danger-bg:   #fcebea;
  --focus:       #0b6bcb;   /* focus ring colour, 3:1+ on light & dark */
  --radius:      10px;
  --shadow-sm:   0 1px 3px rgba(10,35,66,.10);
  --shadow-md:   0 6px 22px rgba(10,35,66,.12);
  --maxw:        1200px;
  --font:        "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

/* ---------- Skip link (WCAG 2.4.1) ------------------------------------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 1000;
  background: var(--navy);
  color: var(--white);
  padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

/* ---------- Focus visibility (WCAG 2.4.7 / 1.4.11) --------------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
/* On dark surfaces use a light high-contrast ring */
.site-header :focus-visible,
.site-footer :focus-visible,
.page-hero :focus-visible {
  outline-color: #ffd54a;
}

a { color: var(--navy-700); }
a:hover { color: var(--navy); }

main { display: block; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.8rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); margin: 2.5rem 0 1rem; }
h3 { font-size: 1.3rem; margin: 1.75rem 0 .6rem; }
h4 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }

/* =========================================================================
   Utility bar — text-size (zoom) control
   ========================================================================= */
.util-bar {
  background: var(--navy-800);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.util-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-block: .4rem;
}
.text-size {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #e3eaf5;
}
.text-size .ts-icon { display: inline-flex; color: #c9d4e6; }
.text-size .ts-label { font-size: .85rem; font-weight: 600; margin-right: .1rem; }
.ts-btn {
  font-family: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  color: #ffffff;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, .55);
  border-radius: 8px;
  padding: .3rem .6rem;
  min-width: 2.2rem;
}
.ts-btn[data-ts="dec"]   { font-size: .82rem; }
.ts-btn[data-ts="reset"] { font-size: 1rem; }
.ts-btn[data-ts="inc"]   { font-size: 1.18rem; }
.ts-btn:hover { background: rgba(255, 255, 255, .14); }
.ts-btn-solid { background: var(--navy-700); border-color: var(--navy-700); }
.ts-btn-solid:hover { background: var(--navy); }
/* Active zoom level highlighted in gold (not colour alone — also bold/border) */
.ts-btn.is-active {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
@media (max-width: 520px) {
  .text-size .ts-label { display: none; }
}

/* =========================================================================
   Header & primary navigation
   ========================================================================= */
.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .65rem;
  flex-wrap: wrap;
}
/* Logo is a plain link, NOT a heading (fixes finding #2/#113) */
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.15;
}
.brand:hover { color: var(--gold-bright); }
.brand .mark {
  flex: 0 0 auto;
  width: 2.6rem; height: 2.6rem;
  display: grid; place-items: center;
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  border-radius: 8px;
  font-size: 1.1rem;
}
.brand .brand-text { display: flex; flex-direction: column; }
.brand .brand-text b { font-size: 1.02rem; }
.brand .brand-text span { font-size: .72rem; font-weight: 500; color: #cdd8e8; letter-spacing: .12em; text-transform: uppercase; }

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid rgba(255,255,255,.5);
  color: var(--white);
  border-radius: 8px;
  padding: .5rem .7rem;
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  gap: .5rem;
}

.primary-nav > ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .25rem;
  margin: 0; padding: 0;
  flex-wrap: wrap;
}
.primary-nav a {
  display: block;
  color: #e8edf5;
  text-decoration: none;
  font-weight: 600;
  font-size: .98rem;
  padding: .55rem .8rem;
  border-radius: 8px;
  border-bottom: 3px solid transparent;
}
.primary-nav a:hover { background: var(--navy-700); color: var(--white); }
/* Current page state (fixes finding #4) — not colour alone: underline bar + bold */
.primary-nav a[aria-current="page"] {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
  background: var(--navy-800);
}

/* Login dropdown — keyboard operable (fixes finding #3) */
.has-menu { position: relative; }
.menu-button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: .98rem;
  padding: .55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}
.menu-button:hover { background: var(--gold-bright); }
.menu-button .caret { transition: transform .15s ease; }
.menu-button[aria-expanded="true"] .caret { transform: rotate(180deg); }
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + .4rem);
  min-width: 13rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  margin: 0; padding: .35rem;
  display: none;
}
.menu-list.open { display: block; }
.menu-list a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  padding: .6rem .75rem;
  border-radius: 7px;
  font-weight: 600;
  border-bottom: none;
}
.menu-list a:hover,
.menu-list a:focus-visible { background: var(--bg-tint); color: var(--navy); }

/* =========================================================================
   Hero / page banners
   ========================================================================= */
.home-hero {
  background:
    linear-gradient(125deg, rgba(10,35,66,.93), rgba(16,47,86,.86)),
    radial-gradient(circle at 80% 20%, rgba(200,150,42,.25), transparent 55%);
  background-color: var(--navy);
  color: var(--white);
  padding: clamp(3rem, 2rem + 6vw, 6rem) 0;
}
.home-hero h1 { color: var(--white); max-width: 18ch; }
.home-hero .lead { font-size: 1.2rem; color: #e6ecf5; max-width: 60ch; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.75rem; }
.hero-meta div { border-left: 3px solid var(--gold); padding-left: .9rem; }
.hero-meta b { display: block; font-size: 1.5rem; color: var(--gold-bright); }
.hero-meta span { font-size: .9rem; color: #d4ddea; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

/* Inner page banner with breadcrumb (fixes finding #11, #12) */
.page-hero {
  background: linear-gradient(125deg, var(--navy), var(--navy-800));
  color: var(--white);
  padding: 2.5rem 0 2.75rem;
}
.page-hero h1 { color: var(--white); }
.page-hero p { color: #dbe3ef; max-width: 65ch; margin: .25rem 0 0; }
.breadcrumb { margin-bottom: 1rem; }
.breadcrumb ol {
  list-style: none; display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 0; padding: 0; font-size: .92rem;
}
.breadcrumb a { color: #d7e0ee; text-decoration: underline; }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb [aria-current="page"] { color: var(--gold-bright); font-weight: 600; }
.breadcrumb .sep { color: #8ea2c0; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: .8rem 1.4rem;
  border-radius: 9px;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-bright); color: var(--navy); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,.7); }
.btn-outline:hover { background: rgba(255,255,255,.12); color: var(--white); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-800); color: var(--white); }

/* =========================================================================
   Sections & layout helpers
   ========================================================================= */
.section { padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0; }
.section.tint { background: var(--bg-tint); }
.section.cream { background: var(--bg-cream); }
.section-head { max-width: 70ch; margin-bottom: 1.5rem; }
.section-head .eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: .4rem;
}
.lead { font-size: 1.15rem; color: var(--ink-soft); }

.grid { display: grid; gap: 1.5rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; }
.card .icon {
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  background: var(--navy);
  color: var(--gold-bright);
  border-radius: 10px;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* Announcements / notices list */
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.notice-list li {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.notice-list b { color: var(--navy); }

/* Risk disclosure callout */
.risk-box {
  background: var(--danger-bg);
  border: 1px solid #f0c2bf;
  border-left: 6px solid var(--danger);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
}
.risk-box h3 { color: var(--danger); margin-top: 0; }
.risk-box p { margin-bottom: 0; color: #5a2420; }

/* =========================================================================
   Download / Links — proper list markup (fixes findings #7, #18)
   ========================================================================= */
.doc-group { margin-bottom: 2.5rem; }
.doc-group > h2 { margin-top: 0; }
.doc-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: .75rem;
}
.doc-list li { margin: 0; }
.doc-list a {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: .85rem 1rem;
  color: var(--ink);            /* 13.5:1 — fixes finding #17 contrast */
  text-decoration: none;
  font-weight: 600;
  height: 100%;
}
.doc-list a:hover { border-color: var(--gold); background: var(--bg-cream); color: var(--navy); }
.doc-list a .file-ico {
  flex: 0 0 auto;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  background: var(--navy);
  color: var(--gold-bright);
  border-radius: 7px;
  font-size: .72rem;
  font-weight: 800;
}
.doc-list a .file-meta { font-size: .78rem; color: var(--ink-soft); font-weight: 500; display: block; }

/* External resource link list */
.link-list { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .75rem; }
.link-list a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: var(--white); border: 1px solid var(--line); border-radius: 9px;
  padding: .9rem 1.1rem; font-weight: 600; color: var(--navy); text-decoration: none;
}
.link-list a:hover { border-color: var(--gold); background: var(--bg-cream); }
.link-list a .ext { font-size: .8rem; color: var(--ink-soft); }

/* =========================================================================
   Tables (regulatory data)
   ========================================================================= */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 32rem;
  background: var(--white);
}
table.data caption {
  text-align: left;
  font-weight: 700;
  color: var(--navy);
  padding: .9rem 1rem;
  font-size: 1.05rem;
}
table.data th, table.data td {
  text-align: left;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: .96rem;
}
table.data thead th {
  background: var(--navy);
  color: var(--white);          /* white on navy = 12:1, fixes finding #46 */
  font-weight: 700;
}
table.data tbody tr:nth-child(even) { background: var(--bg-tint); }

/* =========================================================================
   Forms (contact) — labels always associated (fixes findings #23, #47)
   ========================================================================= */
.form-grid { display: grid; gap: 1.1rem; max-width: 38rem; }
.field label { display: block; font-weight: 600; color: var(--navy); margin-bottom: .35rem; }
.field .req { color: var(--danger); }
.field input, .field textarea, .field select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: .7rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}
.field .hint { font-size: .85rem; color: var(--ink-soft); margin-top: .3rem; }
/* Error alert (fixes findings #26, #48 pattern) */
.form-status {
  border-radius: 8px;
  padding: .85rem 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.form-status.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0c2bf; }
.form-status.ok { background: #e7f4ec; color: var(--success); border: 1px solid #b9e0c8; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .88rem; font-weight: 600; margin-top: .3rem; }

/* Contact info cards */
.contact-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.contact-cards .card { display: flex; gap: 1rem; align-items: flex-start; }
.contact-cards .ci-ico {
  flex: 0 0 auto; width: 2.8rem; height: 2.8rem; display: grid; place-items: center;
  background: var(--navy); color: var(--gold-bright); border-radius: 9px; font-size: 1.2rem;
}
.contact-cards a { color: var(--navy-700); }

/* Prose blocks */
.prose p { max-width: 72ch; }
.prose ul { max-width: 72ch; }
.prose .pull {
  border-left: 4px solid var(--gold);
  background: var(--bg-cream);
  padding: 1rem 1.4rem;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--ink);
  margin: 1.5rem 0;
}

/* Value badges */
.pill-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.pill { background: var(--bg-tint); border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .9rem; font-size: .85rem; font-weight: 600; color: var(--navy); }

/* =========================================================================
   Footer  (fixes findings #6, #7, #8, #9, #113)
   ========================================================================= */
.site-footer { background: var(--navy); color: #cdd8e8; padding: 3rem 0 1.5rem; }
.footer-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1.4fr 1fr 1fr;
}
.site-footer h2 { color: var(--white); font-size: 1.1rem; margin: 0 0 1rem; }
.footer-about p { color: #c2cee0; max-width: 38ch; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-links a { color: #d7e0ee; text-decoration: underline; text-underline-offset: 3px; }
.footer-links a:hover { color: var(--gold-bright); }
.footer-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; font-size: .95rem; }
.footer-contact a { color: #d7e0ee; text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  margin-top: 2.5rem; padding-top: 1.25rem;
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between;
  font-size: .88rem; color: #b6c3d8;
}
/* Credit link underlined — not colour alone (fixes finding #8) */
.footer-bottom a { color: #e3eaf5; text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom a:hover { color: var(--gold-bright); }

/* Back to top */
.to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  border: none; cursor: pointer; font-size: 1.3rem;
  box-shadow: var(--shadow-md);
  display: none; place-items: center; z-index: 400;
}
.to-top.show { display: grid; }

/* Visually hidden but available to screen readers */
.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;
}

/* =========================================================================
   Responsive / reflow (WCAG 1.4.10 — usable to 400% / 320px)
   ========================================================================= */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    flex-basis: 100%;
    display: none;
  }
  .primary-nav.open { display: block; }
  .primary-nav > ul { flex-direction: column; align-items: stretch; gap: .15rem; padding-block: .5rem; }
  .primary-nav a { padding: .75rem .8rem; border-bottom: none; border-left: 3px solid transparent; }
  .primary-nav a[aria-current="page"] { border-left-color: var(--gold-bright); border-bottom-color: transparent; }
  .has-menu { width: 100%; }
  .menu-button { width: 100%; justify-content: center; }
  .menu-list { position: static; width: 100%; box-shadow: none; margin-top: .35rem; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-meta { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
