/* ==========================================================================
   styles.css — Journal of Tibb Mufrad Aza
   Design language inspired by IEEE: IEEE blue, dark utility bar, white header
   with underlined menu, clean white cards, orange call-to-action.

   HOW THIS FILE IS ORGANISED
     1. Design tokens (colours, fonts, spacing) — change the look here
     2. Base / reset
     3. Layout helpers
     4. Components (utility bar, header, buttons, cards, forms, footer ...)
     5. Page-specific (hero, membership)
     6. Responsive rules — MOBILE FIRST: the rules above are for phones;
        the @media (min-width: ...) blocks at the bottom enlarge the layout
        for tablets and desktops.

   RTL NOTE: logical properties (margin-inline-start, text-align: start, ...)
   are used so the same CSS works for Urdu (right-to-left) and English.
   ========================================================================== */


/* ---------- 1. Design tokens ---------- */
:root {
  /* Colours */
  --blue: #00629b;          /* IEEE blue: links, buttons, accents */
  --blue-dark: #004b75;
  --navy: #002a42;          /* utility bar, hero, footer */
  --ink: #1d1d1b;           /* main text */
  --muted: #5f6b73;         /* secondary text */
  --line: #d9dee2;          /* borders */
  --bg: #f4f6f8;            /* page background */
  --white: #fff;
  --accent: #f7941d;        /* call-to-action orange */
  --ok: #1e7b45;
  --error: #b3261e;

  /* Shape and spacing */
  --radius: 4px;
  --gap: 16px;
  --tap-min: 44px;          /* minimum touch target size recommended for phones */

  /* Fonts: Urdu uses Naskh, English uses Open Sans */
  --font-en: "Open Sans", "Segoe UI", Arial, sans-serif;
  --font-ur: "Noto Naskh Arabic", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
}


/* ---------- 2. Base / reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute must win over rules such as display:flex */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-en);
  line-height: 1.6;
}
/* Urdu needs a different font, a little more size and taller lines */
html[lang="ur"] body { font-family: var(--font-ur); font-size: 1.1rem; line-height: 1.9; }

img, svg { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Visible keyboard focus for accessibility */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

[hidden] { display: none !important; }   /* make the hidden attribute always win */


/* ---------- 3. Layout helpers ---------- */
.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 24px; }


/* ---------- 4. Components ---------- */

/* --- Utility bar (thin dark strip at the very top) --- */
.utility { background: var(--navy); color: #cfdde6; font-size: .85rem; }
.utility .container {
  display: flex; justify-content: space-between; align-items: center;
  direction: ltr; gap: 8px; min-height: 40px; padding-block: 8px;
}
.utility-text { display: none; }                      /* hidden on phones to save space */
.utility-text { order: 1; direction: rtl; text-align: right; }
.utility-actions {
  display: flex; order: -1; align-items: center; flex-wrap: nowrap; gap: 12px;
  width: auto; margin: 0 auto 0 0; direction: ltr;
}
.utility a { color: #fff; }
.utility-actions > a[data-i18n="util.login"] {
  display: inline-flex; order: -1; align-items: center; justify-content: center;
  min-height: 36px; padding: 6px 16px; border: 1px solid var(--accent);
  border-radius: 6px; background: var(--accent); color: var(--navy);
  font-size: .95rem; font-weight: 800; line-height: 1.2; text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2); white-space: nowrap;
}
.utility-actions > a[data-i18n="util.login"]:hover {
  background: #ffad45; border-color: #ffad45; color: var(--navy); text-decoration: none;
}

.lang-switch { display: inline-flex; border: 1px solid #4d7b94; border-radius: var(--radius); overflow: hidden; }
.lang-switch button {
  min-height: 32px; padding: 2px 14px;
  background: transparent; color: #fff; border: 0; cursor: pointer; font: inherit; font-size: .85rem;
}
.lang-switch button[aria-pressed="true"] { background: var(--blue); }

/* --- Header: logo + menu --- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; flex-wrap: wrap; }
body[data-page="it"] .site-header .main-nav,
body[data-page="it"] .site-header .nav-toggle,
body[data-page="finance"] .site-header .main-nav,
body[data-page="finance"] .site-header .nav-toggle,
body[data-page="secgen"] .site-header .main-nav,
body[data-page="secgen"] .site-header .nav-toggle,
body[data-page="oversight"] .site-header .main-nav,
body[data-page="oversight"] .site-header .nav-toggle,
body[data-page="ishaat"] .site-header .main-nav,
body[data-page="ishaat"] .site-header .nav-toggle,
body[data-page="referee"] .site-header .main-nav,
body[data-page="referee"] .site-header .nav-toggle,
body[data-page="election"] .site-header .main-nav,
body[data-page="election"] .site-header .nav-toggle { display: none; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--blue); color: #fff; border-radius: var(--radius);
  font: 800 .75rem var(--font-en);
}
.brand-name { font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.brand-sub { color: var(--muted); font-size: .78rem; line-height: 1.3; }

/* "Menu" button, visible on phones only */
.nav-toggle {
  min-height: var(--tap-min); padding: 6px 16px;
  background: var(--white); color: var(--blue); border: 2px solid var(--blue);
  border-radius: var(--radius); font: inherit; font-weight: 700; cursor: pointer;
}

/* Menu list: phones show it stacked under the header, only when opened */
.main-nav { display: none; width: 100%; }
.main-nav.open { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block; min-height: var(--tap-min); padding: 10px 4px;
  color: var(--ink); font-weight: 600; border-top: 1px solid var(--line);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--blue); text-decoration: none; }

/* --- Buttons --- */
.btn {
  display: inline-block; min-height: var(--tap-min); padding: 10px 22px;
  background: var(--blue); color: #fff; border: 2px solid var(--blue); border-radius: var(--radius);
  font: inherit; font-weight: 700; text-align: center; cursor: pointer;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-accent:hover { background: #e0830f; border-color: #e0830f; }
.btn-light { background: transparent; border-color: #fff; color: #fff; }   /* for dark backgrounds */
.btn-light:hover { background: #fff; color: var(--blue); }

/* --- Section headings --- */
.block { padding: 36px 0; }
.block-white { background: var(--white); }
.section-title { margin: 0 0 6px; font-size: 1.4rem; color: var(--navy); }
.section-title-bar { width: 56px; height: 4px; margin-bottom: 22px; background: var(--accent); }

/* --- Cards --- */
.card-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }   /* 1 column on phones */
.card {
  padding: 20px; background: var(--white);
  border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--radius);
}
.card h3 { margin: 0 0 8px; font-size: 1.1rem; color: var(--blue-dark); }
.card p { margin: 0; color: var(--muted); }
.card .card-actions { margin-top: 12px; }
.step-no {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px;
  background: var(--blue); color: #fff; border-radius: 50%; font: 700 1rem var(--font-en);
}

/* --- Page title band (used on inner pages) --- */
.page-band { padding: 20px 0; background: var(--white); border-bottom: 1px solid var(--line); }
.page-band h1 { margin: 0; font-size: 1.6rem; color: var(--navy); }
.policy-back { margin-top: 12px; min-height: 38px; padding: 5px 14px; font-size: .9rem; }
html[dir="rtl"] .policy-back::before { content: "→ "; }
html[dir="ltr"] .policy-back::before { content: "← "; }
.home-disclosure { margin-block: 16px; padding: 14px 18px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.home-disclosure summary { color: var(--blue); font-weight: 700; cursor: pointer; }
.home-disclosure p { margin: 12px 0; }

/* --- Panels (white boxes) --- */
.panel { padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { margin: 0 0 14px; font-size: 1.2rem; color: var(--navy); }
.panel h3 { margin: 0 0 8px; font-size: 1.05rem; }

/* --- Forms --- */
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }   /* 1 column on phones */
.field { display: flex; flex-direction: column; }
.field label { margin-bottom: 4px; font-weight: 700; font-size: .95rem; }
.req { margin-inline-start: 4px; color: var(--error); }

/* font-size 16px+ stops iPhones zooming in when a field is tapped */
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap-min); padding: 10px 12px;
  background: #fff; border: 1px solid #aab4bb; border-radius: var(--radius);
  font: inherit; font-size: 1rem;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: 3px solid rgba(0, 98, 155, .3); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--error); }

/* Multi-line boxes can only be stretched up and down */
.field textarea { resize: vertical; line-height: 1.6; }

/* Numbers (CNIC, phone) are always typed left-to-right, even on the Urdu page */
.field input.num { direction: ltr; }
html[dir="rtl"] .field input.num { text-align: right; }

.hint { margin-top: 3px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.error { margin-top: 3px; color: var(--error); font-size: .85rem; }

.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.form-actions .btn { flex: 1 1 140px; }   /* buttons share the row, wrap on tiny screens */

/* --- Footer --- */
.site-footer { padding: 28px 0 18px; background: var(--navy); color: #b9ccd8; }
.footer-cols { display: grid; gap: 20px; grid-template-columns: 1fr; }
.site-footer h4 { margin: 0 0 8px; color: #fff; }
.site-footer p { margin: 0; }
.site-footer a { display: block; padding: 4px 0; color: #d6e4ec; }
.copyright { margin-top: 20px; padding-top: 14px; border-top: 1px solid #1f5370; font-size: .85rem; }


/* ---------- 5. Page-specific ---------- */

/* --- Home: hero banner --- */
.hero { padding: 40px 0; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; }
.hero-grid { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: center; }
.hero h1 { margin: 0 0 12px; font-size: clamp(1.15rem, 6.6vw, 1.7rem); line-height: 1.5; }
html[lang="ur"] .hero h1 { white-space: nowrap; }
html[lang="en"] .hero h1 { line-height: 1.25; }
.hero p { margin: 0 0 22px; font-size: 1.05rem; opacity: .95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-membership { margin: 14px 0 0 !important; font-size: .95rem !important; }
.hero-membership a { color: #fff; text-decoration: underline; }
.home-note { margin-top: 18px; }

/* --- Membership page --- */
.member-layout { display: grid; gap: 20px; grid-template-columns: 1fr; padding-block: 20px 40px; align-items: start; }
.sidebar .panel + .panel { margin-top: 16px; }
.sidebar ul { margin: 0; padding-inline-start: 20px; color: var(--muted); }

/* Progress bar: Details > Payment > Registration number */
.stepper { display: flex; margin: 0 0 20px; padding: 0; list-style: none; }
.stepper li {
  flex: 1; padding: 8px 4px; text-align: center;
  color: var(--muted); font-size: .8rem; font-weight: 600; border-bottom: 4px solid var(--line);
}
.stepper li.active { color: var(--blue); border-bottom-color: var(--blue); }
.stepper li.done { color: var(--ok); border-bottom-color: var(--ok); }

.fee-box {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 18px; padding: 14px 16px; background: #eef6fb; border: 1px solid #b9d9ec; border-radius: var(--radius);
}
.fee-box strong { font-size: 1.5rem; color: var(--blue-dark); white-space: nowrap; }
.fee-box strong.fee-lines { font-size: 1.15rem; text-align: end; white-space: pre-line; line-height: 1.6; }
[data-membership-fee] { white-space: pre-line; line-height: 1.6; }
.fee-box strong[data-membership-fee] { font-size: 1.15rem; text-align: end; white-space: pre-line; }

.summary { width: 100%; margin-bottom: 18px; border-collapse: collapse; }
.summary th, .summary td { white-space: pre-line; padding: 8px 6px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.summary th { width: 38%; color: var(--muted); font-weight: 600; }

/* Highlighted drop area for the payment receipt */
.upload-box { padding: 16px; background: #f8fbfd; border: 2px dashed var(--blue); border-radius: var(--radius); }
.upload-box input[type="file"] { background: #fff; }

/* Payment account details (Easypaisa) */
.account-box { margin-bottom: 18px; padding: 0; background: #fff; border: 1px solid #b7dfc6; border-radius: var(--radius); overflow: hidden; }
.account-box h3 { margin: 0; padding: 12px 16px; background: var(--ok); color: #fff; font-size: 1.05rem; }
.account-fee { margin: 0; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; background: #f1faf4; border-bottom: 1px solid #b7dfc6; font-weight: 600; }
.account-fee strong { color: var(--blue-dark); font-size: 1.5rem; }
.account-fee small { color: var(--muted); font-weight: 400; }
.account-options { display: grid; gap: 14px; grid-template-columns: 1fr; padding: 14px 16px; }   /* stacked on phones */
.account-option { background: #fff; border: 1px solid #d5e3da; border-radius: var(--radius); overflow: hidden; }
.account-option h4 { margin: 0; padding: 8px 12px; background: #eef4f8; border-bottom: 1px solid #d5e3da; color: var(--navy); }
.account-list { display: grid; grid-template-columns: max-content 1fr; margin: 0; }
.account-list dt, .account-list dd { padding: 8px 12px; border-bottom: 1px solid #edf1ee; margin: 0; }
.account-list dt { color: var(--muted); font-weight: 600; }
.account-list dd { font-weight: 700; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-list dt:last-of-type, .account-list dd:last-of-type { border-bottom: 0; }
/* Account details: one option per row, label and value on the same line, numbers never broken */
.account-list { grid-template-columns: minmax(130px, 34%) 1fr; }
.account-list dd { flex-wrap: nowrap; justify-content: flex-start; }
.account-list dd.ltr-value { white-space: nowrap; overflow-wrap: normal; direction: ltr; justify-content: flex-start; }
.account-list dd .copy-btn { flex: none; margin-inline-start: auto; }
.account-fee { display: block; }
.account-fee > span { display: block; margin-bottom: 4px; color: var(--muted); font-weight: 600; }
.account-fee strong { display: block; font-size: 1.25rem; line-height: 1.7; white-space: pre-line; }
.account-fee ~ .account-options, .account-fee + .notice { margin-top: 0; }
.copy-btn { font: inherit; font-size: .8rem; font-weight: 600; padding: 2px 10px; border: 1px solid var(--blue-dark); border-radius: 999px; background: #fff; color: var(--blue-dark); cursor: pointer; }
.copy-btn:hover { background: var(--blue-dark); color: #fff; }
.account-note { margin: 0; padding: 10px 16px; background: #fff8e1; border-top: 1px solid #ecd9a0; color: #6b5200; font-size: .9rem; }


/* ==========================================================================
   VISUAL POLISH — softer shapes, shadows, spacing and gentle motion.
   This block comes last so it overrides the plainer rules above.
   ========================================================================== */
:root {
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 42, 66, .08);
  --shadow-md: 0 8px 24px rgba(0, 42, 66, .10);
}

body { background: linear-gradient(180deg, #eef3f7 0, var(--bg) 320px); -webkit-font-smoothing: antialiased; }
html[lang="ur"] body { font-size: 1.15rem; }

/* Header stays visible while scrolling */
.site-header { position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm); }
.brand-mark { width: 52px; height: 52px; border-radius: 50%; font-size: 0; color: transparent; overflow: hidden;
  background: url("../img/logo.svg") center / cover no-repeat; box-shadow: var(--shadow-sm); }
.brand-name { color: var(--navy); }
.main-nav a { transition: color .15s, background .15s; }

/* Utility bar: a little more refined */
.utility { background: linear-gradient(90deg, var(--navy), #00395a); }

/* Buttons */
.btn { border-radius: 999px; padding-inline: 28px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline, .btn-light { box-shadow: none; }
.nav-toggle { border-radius: 999px; }

/* Section headings: accent bar sits as a rounded pill */
.section-title { font-size: 1.6rem; }
.section-title-bar { border-radius: 4px; width: 64px; }

/* Cards and panels */
.card, .panel {
  border: 1px solid #e3e9ee; border-radius: 14px; box-shadow: var(--shadow-sm);
}
.card { border-top: 4px solid var(--blue); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.panel { padding: 22px; }
.panel h2 { padding-bottom: 10px; border-bottom: 2px solid #e6edf2; position: relative; }
.panel h2::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: -2px;
  width: 56px; height: 2px; background: var(--accent);
}
.step-no { background: linear-gradient(135deg, var(--blue), var(--navy)); box-shadow: var(--shadow-sm); }

/* Inner-page title band */
.page-band { background: linear-gradient(135deg, #ffffff, #eaf2f8); border-bottom: 3px solid var(--blue); padding: 26px 0; }
.page-band h1 { font-size: 1.9rem; }
.page-band .submit-dashboard-link { margin-top: 12px; }
#submit-dashboard-link[hidden] { display: none; }

/* Hero: depth with soft light spots */
.hero {
  padding: 64px 0;
  background:
    radial-gradient(600px 300px at 85% 10%, rgba(247, 148, 29, .22), transparent 70%),
    radial-gradient(500px 300px at 10% 100%, rgba(255, 255, 255, .10), transparent 70%),
    linear-gradient(135deg, var(--navy), var(--blue));
}
.hero h1 { font-size: clamp(1.4rem, 6.2vw, 2.1rem); }
.hero-card { border-radius: 16px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(6px); box-shadow: var(--shadow-md); }

/* Forms */
.field input, .field select, .field textarea { border-radius: 8px; border-color: #c3ccd3; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: 0 0 0 4px rgba(0, 98, 155, .15); outline: none; }
.fee-box, .account-box, .account-option, .upload-box { border-radius: 12px; }

/* Progress steps */
.stepper li { transition: color .2s, border-color .2s; }

/* Footer */
.site-footer { padding-top: 40px; background: linear-gradient(180deg, var(--navy), #001d2e); }
.site-footer a { transition: color .15s, padding .15s; }
.site-footer a:hover { color: var(--accent); text-decoration: none; }

/* Respect users who prefer no animation */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .btn:hover, .card:hover { transform: none; }
  .announcement-marquee-track { animation: none !important; }
}
.ltr-value { direction: ltr; text-align: start; unicode-bidi: isolate; }
html[dir="rtl"] .ltr-value { text-align: right; }

.notice { margin-bottom: 16px; padding: 12px 14px; background: #fff8e8; border: 1px solid #f0d28a; border-radius: var(--radius); font-size: .92rem; }

/* --- Paper submission page --- */
.paper-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); padding-block: 20px 40px; }

.instructions summary { min-height: var(--tap-min); cursor: pointer; font-size: 1.2rem; font-weight: 700; color: var(--navy); }
.instructions ol, .instructions ul { margin: 0 0 14px; padding-inline-start: 22px; }
.instructions li + li { margin-top: 8px; }
.instructions .sub-heading { margin: 18px 0 8px; }
.ref-example { padding: 10px 14px; background: #eef6fb; border-inline-start: 4px solid var(--blue); }
.word-box { margin-top: 14px; padding: 12px 14px; background: #fff8ea; border-inline-start: 4px solid var(--accent); }
.word-box p { margin: 6px 0 10px; }
.ref-sample { margin-top: 4px; color: var(--blue-dark); font-weight: 600; }

.form-section { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-section > h3 { margin: 0 0 12px; font-size: 1.15rem; color: var(--navy); }
.form-error { margin-top: 18px; font-weight: 700; }

/* One visit or one reference */
.entry { margin-bottom: 16px; padding: 14px; background: #f8fbfd; border: 1px solid var(--line); border-inline-start: 4px solid var(--blue); border-radius: var(--radius); }
/* Visits sit inside a patient card: lighter background so the nesting is visible */
.entry .entry { background: #fff; }
.sub-heading { margin: 18px 0 10px; font-size: 1rem; color: var(--blue); }
.entry-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.entry-head h3 { margin: 0; color: var(--navy); }
.btn-small { min-height: 36px; padding: 4px 14px; font-size: .9rem; }

/* Review tables: wide tables scroll sideways inside their box instead of breaking the page */
#review-body h3 { margin: 24px 0 8px; color: var(--navy); }
.table-scroll { overflow-x: auto; margin-bottom: 18px; border: 1px solid var(--line); }
.review-table { width: 100%; min-width: 520px; border-collapse: collapse; }
.review-table th, .review-table td { min-width: 150px; padding: 8px 10px; text-align: start; vertical-align: top; border: 1px solid var(--line); white-space: pre-line; overflow-wrap: anywhere; }
.review-table thead th { background: #eef6fb; color: var(--navy); }
.review-table tbody th { background: #f8fbfd; font-weight: 600; }

/* Step 3: success message */
.success { padding: 8px 0; text-align: center; }
.success .tick {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 12px;
  background: var(--ok); color: #fff; border-radius: 50%; font-size: 2rem;
}
.reg-number {
  display: inline-block; max-width: 100%; margin: 12px 0; padding: 12px 18px;
  background: #eef6fb; border: 2px dashed var(--blue); color: var(--blue-dark);
  font: 800 1.3rem var(--font-en); letter-spacing: 1px; direction: ltr; overflow-wrap: anywhere;
}
.success .form-actions { justify-content: center; }


/* ==========================================================================
   6. Responsive rules (mobile first)
   ========================================================================== */

/* Tablets and up (>= 700px) */
@media (min-width: 700px) {
  .container { padding-inline: 40px; }
  .utility-text { display: inline; }

  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
  .footer-cols { grid-template-columns: 2fr 1fr 1fr; }

  .block { padding: 48px 0; }
  .section-title { font-size: 1.6rem; }
  .hero { padding: 56px 0; }
  .hero h1 { font-size: clamp(1.5rem, 6.5vw, 2.1rem); }
  .panel { padding: 26px; }
  .page-band h1 { font-size: 1.9rem; }
  .stepper li { font-size: .9rem; }
  .form-actions .btn { flex: 0 0 auto; }
  .reg-number { font-size: 1.6rem; padding-inline: 26px; }
}

/* Desktop (>= 960px): menu becomes a horizontal bar, no "Menu" button */
@media (min-width: 960px) {
  .container { padding-inline: 56px; }
  .nav-toggle { display: none; }
  .header-row { flex-wrap: nowrap; min-height: 76px; }
  .brand-name { font-size: 1.2rem; }

  .main-nav { display: block; width: auto; }       /* always visible */
  .main-nav ul { display: flex; gap: 4px; }
  .main-nav a { padding: 28px 14px; border-top: 0; border-bottom: 3px solid transparent; }
  .main-nav a:hover, .main-nav a[aria-current="page"] { border-bottom-color: var(--blue); }
  /* thin vertical line between tabs (a short line, not full header height) */
  .main-nav li + li { position: relative; }
  .main-nav li + li::before {
    content: ""; position: absolute; inset-inline-start: -2px; top: 50%;
    height: 22px; transform: translateY(-50%); border-inline-start: 1px solid #d5dee6;
  }

  .hero-grid { grid-template-columns: 1.4fr 1fr; gap: 40px; }
  .member-layout { grid-template-columns: 2fr 1fr; gap: 28px; }
}

/* Printing (e.g. the registration number page): hide navigation and buttons */
@media print {
  .utility, .site-header, .site-footer, .form-actions, .sidebar, .page-band, .stepper { display: none !important; }
}

.announcement-bar {
  padding: 18px 0;
  background: linear-gradient(110deg, #003a5c, #00629b);
  border-bottom: 4px solid #f0a12b;
  box-shadow: 0 5px 16px rgba(0, 42, 66, .18);
}
.announcement-bar .container { display: flex; align-items: center; gap: 18px; }
.announcement-bar .announcement-label {
  display: inline-block;
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 6px;
  background: #f0a12b;
  color: #17212a;
  font-weight: 700;
  font-size: .95rem;
}
.announcement-viewport { flex: 1; min-width: 0; overflow: hidden; direction: ltr; }
.announcement-marquee-track {
  display: inline-block;
  white-space: nowrap;
  color: #fff;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .24);
}
.announcement-marquee-track.is-running {
  animation: announcement-marquee 42s linear infinite;
}
.announcement-viewport:hover .announcement-marquee-track,
.announcement-viewport:focus-within .announcement-marquee-track { animation-play-state: paused; }
@keyframes announcement-marquee {
  from { transform: translateX(100vw); }
  to { transform: translateX(calc(-100% - 100vw)); }
}
html[dir="rtl"] .announcement-marquee-track { animation-name: announcement-marquee-rtl; }
@keyframes announcement-marquee-rtl {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100% + 100vw)); }
}
#home-announcement { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.announcement-preview { color: var(--muted); }
.announcement-link { font-weight: 700; white-space: nowrap; }
.announcement-date { color: var(--muted); font-size: .88rem; }
.announcement-card { white-space: pre-line; }
.it-reset-result { margin-block: 16px; }
.it-reset-result strong { display: block; margin-bottom: 8px; }
.it-reset-password { margin: 8px 0; font-size: 1.05rem; }
.it-reset-password code { display: inline-block; padding: 6px 10px; border: 1px solid #d5dee6; border-radius: 6px; background: #fff; font-weight: 700; letter-spacing: .04em; }
.it-duplicate-note { display: block; margin-top: 4px; color: #8b4b00; font-size: .82rem; font-weight: 700; }
.it-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; border-bottom: 2px solid #d5dee6; }
.it-tab { padding: 10px 16px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #34495e; cursor: pointer; font: inherit; font-weight: 700; }
.it-tab.active { border-bottom-color: #00629b; color: #00629b; }
.it-tab:focus-visible { outline: 2px solid #00629b; outline-offset: 2px; }
.it-tab-panel[hidden] { display: none; }
.role-assignment { min-width: 0; margin: 0; padding: 12px; border: 1px solid #d5dee6; border-radius: 8px; }
.role-assignment legend { padding: 0 6px; font-weight: 700; }
.role-options { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0; }
.role-option { display: inline-flex; align-items: center; gap: 6px; }
.role-option input { width: auto; margin: 0; }
.it-role-summary { cursor: pointer; margin-bottom: 8px; font-weight: 700; }
.it-users-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; }
.it-users-pagination[hidden] { display: none; }
.council-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.council-card h2 { margin-top: 0; color: var(--navy); font-size: 1.25rem; }
.council-name { font-weight: 700; }
.council-vacant { color: var(--muted); font-style: italic; }
@media (max-width: 640px) {
  .announcement-bar { padding: 14px 0; }
  .announcement-bar .container { align-items: stretch; flex-direction: column; gap: 10px; }
  .announcement-bar .announcement-label { align-self: flex-start; }
  .announcement-viewport { width: 100%; padding-block: 4px; }
}

/* File-name rule under the upload box: its own lines, each line on a new row */
.hint-name { white-space: pre-line; font-weight: 600; color: var(--ink); }

/* About page: numbered lists inside panels, spacing for the cards */
.about-list ol { margin: 0; padding-inline-start: 22px; }
.about-list li + li { margin-top: 8px; }
.panel .card-grid { margin-top: 16px; }


/* ---------- Extra pages: papers, login, contact, Administrator panel ---------- */
.paper-layout.narrow { max-width: 560px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.toolbar .grow { flex: 1 1 240px; }

/* A single search result / issue card */
.result { padding: 16px 0; border-bottom: 1px solid #e6edf2; }
.result:last-child { border-bottom: 0; }
.result h3 { margin: 0 0 6px; font-size: 1.1rem; color: var(--blue-dark); }
.result p { margin: 0 0 4px; }
.result .btn { margin-top: 8px; min-height: 36px; padding: 4px 18px; }

.badge { display: inline-block; margin-inline-start: 10px; padding: 0 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; vertical-align: middle; }
.badge.open { background: #fde8e6; color: var(--error); }
.badge.done { background: #e1f3e8; color: var(--ok); }

.two-col { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); margin-bottom: 20px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* Chat window */
.chat { display: flex; flex-direction: column; gap: 10px; height: 320px; overflow-y: auto; padding: 12px; background: #f4f8fb; border: 1px solid #e0e8ee; border-radius: 12px; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid #e0e8ee; }
.bubble strong, .bubble span, .bubble small { display: block; }
.bubble small { color: var(--muted); font-size: .72rem; }
.bubble.mine { align-self: flex-start; background: #dcecf7; border-color: #b9d9ec; }
.bubble.theirs { align-self: flex-end; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { flex: 1; min-height: var(--tap-min); padding: 8px 12px; border: 1px solid #c3ccd3; border-radius: 999px; font: inherit; }
.chat-form .btn { padding-inline: 20px; }

/* Data table */
.table-wrap { overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; }
.data th, .data td { padding: 10px 8px; text-align: start; border-bottom: 1px solid #e6edf2; }
.it-user-name, .it-user-link { color: var(--blue); font-weight: 700; }
.it-user-link:hover, .it-user-link:focus-visible { color: var(--navy); text-decoration: underline; }
.data th { background: #f1f6fa; color: var(--navy); }
.data td:nth-child(2) { direction: ltr; text-align: end; }

.panel .card-grid + .card-grid { margin-top: 16px; }

.policy-read { margin: 0.5rem 0 0; font-weight: 600; }
.field label.check { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; }
.field label.check input { width: auto; margin-top: 0.3rem; }

/* Signed-in account navigation */
.session-bar {
  display: flex; flex: 1 1 520px; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 8px 14px; min-width: 0;
}
.session-name { color: #cfdde6; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.session-dashboard, .session-switcher > summary {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px;
  color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 5px;
  background: rgba(255,255,255,.06); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.session-dashboard:hover, .session-switcher > summary:hover { background: rgba(255,255,255,.16); color: #fff; text-decoration: none; }
.session-switcher { position: relative; }
.session-switcher > summary { list-style: none; }
.session-switcher > summary::-webkit-details-marker { display: none; }
.session-role-menu {
  position: absolute; z-index: 50; inset-block-start: calc(100% + 6px); inset-inline-end: 0;
  display: grid; min-width: 190px; gap: 4px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-md);
}
.session-role-menu button {
  padding: 8px 10px; text-align: start; color: var(--ink); background: #fff;
  border: 0; border-radius: 4px; font: inherit; cursor: pointer;
}
.session-role-menu button:hover { background: #e8f1f8; }
.session-role-menu button:disabled { opacity: .6; cursor: wait; }
.session-role-error { margin: 0; color: #9c2520; font-size: .82rem; }
.status-pill {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  background: #eaf2f8; color: var(--navy); font-weight: 700;
}
.status-pill.status-accepted, .status-pill.status-published { background: #e3f4e8; color: #176b35; }
.status-pill.status-rejected, .status-pill.status-payment_rejected { background: #fde8e7; color: #9c2520; }
.status-pill.status-revision, .status-pill.status-returned, .status-pill.status-recheck { background: #fff3d8; color: #76500a; }
.reason-box { display: block; width: min(100%, 620px); min-height: 110px; margin-top: 6px; padding: 10px 12px; font: inherit; resize: vertical; }
.session-out {
  min-height: 32px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45);
  border-radius: 5px; padding: 4px 10px; font: inherit; cursor: pointer;
}
.session-out:hover { background: rgba(255,255,255,.15); }
.admin-account-nav { background: #f1f6fa; border-bottom: 1px solid var(--line); }
.admin-account-nav .session-bar {
  box-sizing: border-box; width: min(100%, 1200px); margin-inline: auto; padding: 12px 24px;
  flex: 1 1 auto; justify-content: space-between; color: var(--ink);
}
.admin-account-nav .session-name { flex: 1 1 100%; max-width: none; color: var(--navy); font-weight: 700; }
.admin-account-nav .session-links { justify-content: flex-start; gap: 8px; }
.admin-account-nav .session-dashboard, .admin-account-nav .session-switcher > summary {
  min-height: 38px; color: var(--navy); border-color: #c5d5e0; background: #fff;
}
.admin-account-nav .session-dashboard:hover, .admin-account-nav .session-switcher > summary:hover {
  color: var(--navy); background: #e8f1f8;
}
.admin-account-nav .session-out { min-height: 38px; color: #8c2823; border-color: #d7aaa6; }
.admin-account-nav .session-out:hover { background: #fbecea; }

/* Membership form: grouped sections, 3 compact columns where there is room */
.group-title { margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--blue); color: var(--navy); font-size: 1.05rem; }
.form-grid.compact { gap: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-grid.compact .full { grid-column: 1 / -1; }
.form-grid.compact .hint { font-size: .8rem; margin-top: 2px; }
.form-grid.compact .field label { margin-bottom: 2px; }

/* Society members: clean table without borders */
.member-table-wrap { border: 0; margin: 16px 0; }
.member-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.member-table th, .member-table td { padding: 12px 16px; text-align: start; border: 0; }
.member-table thead th { background: var(--navy); color: #fff; font-weight: 600; white-space: nowrap; }
.member-table tbody tr:nth-child(even) { background: #f3f7fa; }
.member-table tbody tr:hover { background: #e8f1f8; }
.member-table .mt-no { width: 56px; color: var(--muted); }
.member-table .mt-reg { white-space: nowrap; direction: ltr; unicode-bidi: plaintext; text-align: start; font-variant-numeric: tabular-nums; color: var(--muted); }
.member-table .mt-name { font-weight: 600; color: var(--navy); }
.member-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #fff1de; color: #8a4b00; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.editorial-roster { max-width: 900px; margin-inline: auto; color: var(--ink); }
.editorial-roster > h2 { color: var(--navy); }
.editorial-group { margin: 12px 0; padding: 12px 18px; background: var(--white); border-inline-start: 4px solid var(--blue); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.editorial-group h3 { margin: 0 0 6px; color: var(--navy); }
.editorial-group ul { margin: 0; padding-inline-start: 24px; }
.editorial-group li { padding-block: 2px; }

/* City dropdown on the membership form */
.combo { position: relative; }
.combo input { width: 100%; padding-inline-end: 38px; }
.combo-arrow { position: absolute; inset-inline-end: 0; top: 0; height: 100%; width: 38px; border: 0; background: transparent; color: var(--blue); font-size: 1rem; cursor: pointer; }
.combo-list { position: absolute; inset-inline: 0; top: 100%; z-index: 30; max-height: 240px; overflow-y: auto; margin: 2px 0 0; padding: 0; list-style: none; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); }
.combo-list li { padding: 9px 14px; cursor: pointer; }
.combo-list li:hover { background: #e8f1f8; color: var(--blue-dark); }
@media (max-width: 600px) {
  .member-table th, .member-table td { padding: 10px 8px; font-size: .9rem; }
  .member-table .mt-no { width: 30px; }
  .member-table thead th { white-space: normal; }
  .member-table .mt-reg { font-size: .78rem; }
  .member-badge { white-space: normal; font-size: .7rem; padding: 2px 6px; }
}
