/* ==========================================================================
   Academic Support Platform (PHP edition) — shared styles.
   Brand color/font come from CSS variables set in includes/header.php,
   which reads them from config/config.php. Change branding there, not here.
   ========================================================================== */

:root {
  --ink-soft: #4a5a5e;
  --line: #d5ddd8;
  --line-strong: #9aa8a6;
  --surface: #ffffff;
  --mark: #b5302c;
  --ok: #1d6a49;
  --ok-tint: #e1f0e8;
  --warn: #86560a;
  --warn-tint: #f8ecd0;
  --bad-tint: #f8e6e3;
  --info: #0d4b70;
  --info-tint: #e0ecf5;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--brand-ink, #16252a);
  background: var(--brand-paper, #f3f5f1);
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-heading, sans-serif); font-weight: 700; line-height: 1.18; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-primary-dark, #0d4b50); text-decoration-thickness: 1px; }
a:hover { color: var(--brand-ink); }
.wrap { max-width: 1140px; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.narrow { max-width: 46rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.skip-link { position: absolute; left: -999px; top: .5rem; background: var(--brand-ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: .5rem; }

/* ---------------------------------------------------------------- header */
.site-header { background: var(--brand-paper); border-bottom: 1px solid var(--line); position: relative; z-index: 50; }


.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: var(--brand-ink); text-decoration: none; }
.brand-mark { width: 1.8rem; height: 1.8rem; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; font-size: .95rem; }
.site-nav a { color: var(--brand-ink); text-decoration: none; padding: .3rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--line-strong); }
.site-nav a.nav-cta { border: 1px solid var(--brand-primary-dark); color: var(--brand-primary-dark); padding: .4rem .9rem; border-radius: var(--radius); font-weight: 600; }
.site-nav a.nav-cta:hover { background: var(--brand-primary); color: var(--brand-ink); border-color: var(--brand-primary); }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .6rem .8rem; cursor: pointer; }
.nav-toggle-bar { display: block; width: 20px; height: 2px; background: var(--brand-ink); border-radius: 2px; }
@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--brand-paper); border-bottom: 1px solid var(--line); padding: .5rem 1rem 1.25rem; }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
}

/* ---------------------------------------------------------------- buttons / notices / badges */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .7rem 1.3rem; border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--brand-primary); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-primary-dark); color: #fff; }
.btn-secondary { background: transparent; border-color: var(--brand-primary-dark); color: var(--brand-primary-dark); }
.btn-secondary:hover { background: var(--brand-paper); }
.btn-danger { border-color: var(--mark); color: var(--mark); background: transparent; }
.btn-small { min-height: 36px; padding: .4rem .85rem; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.notice { border-left: 4px solid var(--info); background: var(--info-tint); padding: .8rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1rem 0; }
.notice-error { border-color: var(--mark); background: var(--bad-tint); }
.notice-success { border-color: var(--ok); background: var(--ok-tint); }
.notice-warn, .notice-warning { border-color: var(--warn); background: var(--warn-tint); }

.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #e8ecea; color: var(--ink-soft); }
.badge[data-tone="ok"] { background: var(--ok-tint); color: var(--ok); }
.badge[data-tone="warn"] { background: var(--warn-tint); color: var(--warn); }
.badge[data-tone="bad"] { background: var(--bad-tint); color: var(--mark); }
.badge[data-tone="info"] { background: var(--info-tint); color: var(--info); }

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-band { background: var(--surface); border-block: 1px solid var(--line); }
.section-dark { background: var(--brand-ink); color: #eef4f2; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark a { color: var(--brand-primary); }
.section-head { max-width: 42rem; margin-bottom: 2rem; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }
.section-dark .section-head p { color: #cfe0dc; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; min-height: 480px; display: flex; align-items: center; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.hero-slide.is-active { opacity: 1; pointer-events: auto; position: relative; }
.hero-slide .slide-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.55)); z-index: 1; }
.hero-slide .slide-copy { position: relative; z-index: 2; color: #fff; max-width: 40rem; padding: 4rem clamp(1rem, 4vw, 2rem); }
.hero-slide .slide-copy h1, .hero-slide .slide-copy h2 { color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.12; }
.hero-slide .slide-copy p { color: #e6f0ee; font-size: 1.15rem; }
.hero-dots { position: absolute; bottom: 1.25rem; left: 50%; transform: translateX(-50%); display: flex; gap: .5rem; z-index: 3; }
.hero-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.hero-dots button.is-active { background: var(--brand-primary); }
.hero-empty { padding: 5rem 0; text-align: center; }

/* ---------------------------------------------------------------- university logo strip */
.logo-strip { padding: 2rem 0; background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; }
.logo-strip p.strip-label { text-align: center; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 1rem; }
.logo-track { display: flex; gap: clamp(2rem, 5vw, 4rem); align-items: center; justify-content: center; flex-wrap: wrap; }
.logo-track img { max-height: 42px; filter: grayscale(1); opacity: .75; }

/* ---------------------------------------------------------------- team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.team-card { text-align: center; }
.team-card img { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; margin-bottom: .75rem; border: 3px solid var(--brand-primary); }
.team-card h3 { margin-bottom: .15rem; font-size: 1.05rem; }
.team-card .role { color: var(--brand-primary-dark); font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.team-card p.bio { color: var(--ink-soft); font-size: .92rem; }

/* ---------------------------------------------------------------- portfolio / proof of work */
.portfolio-cats { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.5rem; }
.portfolio-cats button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: .5rem 1.1rem; font: inherit; cursor: pointer; }
.portfolio-cats button[aria-pressed="true"] { background: var(--brand-ink); color: #fff; border-color: var(--brand-ink); }
.portfolio-panel { display: none; }
.portfolio-panel.is-active { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.portfolio-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.portfolio-item img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.portfolio-item .cap { padding: .8rem 1rem; }
.portfolio-item h4 { margin-bottom: .3rem; font-size: 1rem; }
.portfolio-item p { margin: 0; font-size: .88rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- toc / services */
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: .25rem 2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.toc .toc-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; }
.toc .toc-desc { color: var(--ink-soft); margin: 0; }
@media (max-width: 720px) { .toc li { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- FAQ */
.faq { border-top: 1px solid var(--line-strong); max-width: 50rem; }
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary { cursor: pointer; padding: 1rem 2rem 1rem 0; font-weight: 600; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .85rem; font-size: 1.3rem; color: var(--brand-primary-dark); }
.faq details[open] summary::after { content: "\2212"; }

/* ---------------------------------------------------------------- forms */
.form-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.field { display: grid; gap: .35rem; margin-bottom: 1.1rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .87rem; color: var(--ink-soft); margin: 0; }
.blog-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.75rem; margin-top: 1.5rem; }
.blog-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.08); }
.blog-card-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--brand-paper); }
.blog-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.blog-card:hover .blog-card-media img { transform: scale(1.06); }
.blog-card-media-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 700; color: var(--brand-primary-dark, var(--brand-ink)); background: linear-gradient(135deg, var(--brand-paper), #fff); }
.blog-card-category { position: absolute; top: .7rem; left: .7rem; background: rgba(255,255,255,.92); color: var(--brand-ink); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .25rem .6rem; border-radius: 999px; }
.blog-card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.blog-card-date { font-size: .78rem; color: var(--ink-soft); margin: 0 0 .35rem; }
.blog-card-title { font-size: 1.15rem; line-height: 1.35; margin: 0 0 .5rem; }
.blog-card-title a { color: inherit; text-decoration: none; }
.blog-card-title a:hover { color: var(--brand-primary-dark, var(--brand-ink)); }
.blog-card-excerpt { color: var(--ink-soft); font-size: .92rem; line-height: 1.55; margin: 0 0 .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.blog-card-readmore { font-size: .88rem; font-weight: 700; color: var(--brand-primary-dark, var(--brand-ink)); text-decoration: none; margin-top: auto; }
.blog-card-readmore:hover { text-decoration: underline; }

.quick-replies { display: flex; flex-wrap: wrap; gap: .5rem; padding: .7rem 0; }
.quick-reply-chip { background: var(--brand-paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: .4rem .9rem; font-size: .85rem; cursor: pointer; color: var(--brand-ink); }
.quick-reply-chip:hover { border-color: var(--brand-primary); background: #fff; }

.order-tracker { display: flex; overflow-x: auto; gap: 0; margin: 1.25rem 0; padding: .5rem 0; }
.order-tracker-step { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 90px; position: relative; text-align: center; }
.order-tracker-step::before { content: ''; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); z-index: 0; }
.order-tracker-step:first-child::before { display: none; }
.order-tracker-step.done::before, .order-tracker-step.current::before { background: var(--brand-primary); }
.order-tracker-dot { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); z-index: 1; margin-bottom: .4rem; }
.order-tracker-step.done .order-tracker-dot { background: var(--brand-primary); border-color: var(--brand-primary); }
.order-tracker-step.current .order-tracker-dot { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-paper), 0 0 0 5px var(--brand-primary); }
.order-tracker-label { font-size: .75rem; color: var(--ink-soft); }
.order-tracker-step.current .order-tracker-label { color: var(--brand-ink); font-weight: 700; }

.order-notes-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.order-notes-list li { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .6rem .8rem; }
.order-notes-list li p { margin: .3rem 0 0; white-space: pre-wrap; }

.req-badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--brand-primary); color: var(--brand-ink); border-radius: 999px; padding: .15rem .55rem; margin-left: .4rem; vertical-align: middle; }
.brief-file-list { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.brief-file-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: var(--brand-paper); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .5rem .7rem; font-size: .88rem; }
.brief-file-list li .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brief-file-list li .file-remove { background: none; border: none; color: var(--mark); cursor: pointer; font-weight: 700; flex-shrink: 0; }
.brief-file-list li.uploading { color: var(--ink-soft); }
.brief-file-list li.failed { color: var(--mark); border-color: var(--mark); }
.field-error { color: var(--mark); font-size: .9rem; margin: 0; }
input, select, textarea { font: inherit; width: 100%; padding: .7rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; min-height: 44px; }
textarea { min-height: 8rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand-primary) 45%, transparent); border-color: var(--brand-primary-dark); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; }
.check input { width: 1.15rem; height: 1.15rem; min-height: 0; margin-top: .2rem; accent-color: var(--brand-primary-dark); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.form-narrow { max-width: 30rem; margin-inline: auto; }
.auth-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line-strong); margin-bottom: 1.5rem; }
.auth-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem 0; font: inherit; font-weight: 600; color: var(--ink-soft); cursor: pointer; margin-bottom: -1px; }
.auth-tabs button[aria-selected="true"] { color: var(--brand-ink); border-bottom-color: var(--brand-primary); }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--brand-ink); color: #b9d0cc; padding: 3rem 0 1.5rem; font-size: .95rem; }
.site-footer a { color: #e6f0ee; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2rem; }
.site-footer h2 { font-family: var(--font-body); font-size: .95rem; color: #fff; margin-bottom: .75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4rem; }
.foot-brand { font-family: var(--font-heading); font-size: 1.3rem; color: #fff; margin-bottom: .5rem; }
.legal { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- consultation / trust */
.consult-banner { background: var(--brand-primary); color: var(--brand-ink); border-radius: var(--radius); padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem); display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: space-between; align-items: center; }
.consult-banner p { margin: 0; max-width: 34rem; font-weight: 500; }
.trust-note { max-width: 42rem; }

/* ---------------------------------------------------------------- floating chat launcher (placeholder, wired up later) */
.chat-launcher { position: fixed; bottom: 1.25rem; right: 1.25rem; background: var(--brand-primary); color: var(--brand-ink); border-radius: 999px; padding: .85rem 1.4rem; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.18); text-decoration: none; z-index: 40; }
.chat-launcher:hover { background: var(--brand-primary-dark); color: #fff; }

@media print { .site-header, .site-footer, .chat-launcher { display: none; } }

/* ---------------------------------------------------------------- chat widget */
.chat-box { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.chat-header { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--brand-paper); font-weight: 600; }
#chat-active-indicator { font-size: .82rem; font-weight: 500; color: var(--ok, #1d6a49); }
#chat-messages { max-height: 22rem; min-height: 12rem; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.chat-msg { max-width: 80%; padding: .55rem .8rem; border-radius: 10px; font-size: .93rem; line-height: 1.45; }
.chat-msg .chat-who { display: block; font-size: .74rem; color: var(--ink-soft); margin-bottom: .15rem; text-transform: capitalize; }
.chat-msg-mine { align-self: flex-end; background: color-mix(in srgb, var(--brand-primary) 30%, #fff); }
.chat-msg-theirs { align-self: flex-start; background: var(--brand-paper); border: 1px solid var(--line); }
.chat-writer-toggle { display: block; margin-top: .35rem; font-size: .7rem; background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: .15rem .5rem; cursor: pointer; color: var(--ink-soft); }
.chat-writer-toggle[data-hidden="1"] { color: var(--mark); border-color: var(--mark); }
.chat-form { display: flex; gap: .6rem; padding: .75rem; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 2.75rem; resize: none; }
