/* ============================================================
   CANAAN AI — shared site styles (landing + portal)
   Brand: navy #0D2B55 · gold #C9920A · trace blue #1E3A6A
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #0D2B55;
  --navy2:  #162E52;
  --trace:  #1E3A6A;
  --blue:   #1E5FA8;
  --gold:   #C9920A;
  --gold-d: #A87808;
  --gold-l: #FFF3CC;
  --white:  #FFFFFF;
  --off:    #F5F7FA;
  --dark:   #1A1A2E;
  --gray:   #555566;
  --lgray:  #E8ECF2;
  --border: #C0CEDF;
  --good:   #15803d;
  --bad:    #b91c1c;
  --warn:   #b45309;
}

html { scroll-behavior: smooth; }
body { font-family: Calibri, 'Segoe UI', Arial, sans-serif; color: var(--dark); background: var(--white); }
a { color: inherit; }

/* ── NAV ── */
nav.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 64px;
  border-bottom: 3px solid var(--gold);
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo svg { width: 36px; height: 36px; }
.nav-logo-text { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.nav-logo-text span { color: var(--gold); }
.nav-links { display: flex; gap: 28px; list-style: none; align-items: center; }
.nav-links a { color: #99AABB; text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--gold); }
.nav-cta { background: var(--gold); color: #fff; padding: 8px 20px; border-radius: 6px; font-size: 14px; font-weight: 700; text-decoration: none; transition: background .2s; white-space: nowrap; }
.nav-cta:hover { background: var(--gold-d); }

/* ── BUTTONS ── */
.btn-primary { display:inline-block; background: var(--gold); color: #fff; padding: 14px 28px; border-radius: 8px; font-size: 15px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; transition: background .2s; font-family: inherit; }
.btn-primary:hover { background: var(--gold-d); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-secondary { display:inline-block; background: transparent; color: #fff; padding: 13px 28px; border-radius: 8px; font-size: 15px; font-weight: 600; text-decoration: none; border: 1.5px solid rgba(255,255,255,.25); cursor: pointer; transition: border-color .2s, color .2s; font-family: inherit; }
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-navy { display:inline-block; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 7px; font-size: 13px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; transition: background .2s; font-family: inherit; }
.btn-navy:hover { background: var(--blue); }
.btn-line { display:inline-block; background: #fff; color: var(--navy); padding: 9px 17px; border-radius: 7px; font-size: 13px; font-weight: 600; text-decoration: none; border: 1.5px solid var(--border); cursor: pointer; transition: border-color .2s, color .2s; font-family: inherit; }
.btn-line:hover { border-color: var(--gold); color: var(--gold-d); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }

/* ── HERO ── */
.hero { background: var(--navy); padding: 90px 40px 80px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(var(--navy2) 1px, transparent 1px), linear-gradient(90deg, var(--navy2) 1px, transparent 1px);
  background-size: 80px 80px; opacity: .5;
}
.hero-inner { max-width: 1100px; margin: 0 auto; position: relative; display: flex; align-items: center; gap: 60px; }
.hero-text { flex: 1; }
.hero-badge { display: inline-block; background: rgba(201,146,10,.15); color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 2px; padding: 5px 14px; border-radius: 20px; border: 1px solid rgba(201,146,10,.3); margin-bottom: 20px; }
.hero h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 700; color: #fff; line-height: 1.1; margin-bottom: 20px; font-family: Georgia, serif; }
.hero h1 span { color: var(--gold); }
.hero-sub { font-size: 18px; color: #99AABB; line-height: 1.7; margin-bottom: 36px; max-width: 560px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-icon { flex-shrink: 0; }
.hero-icon svg { width: 220px; height: 220px; }

/* ── STATS ── */
.stats-bar { background: var(--gold); padding: 20px 40px; }
.stats-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-around; gap: 20px; flex-wrap: wrap; }
.stat { text-align: center; color: #fff; }
.stat-num { font-size: 28px; font-weight: 700; font-family: Georgia, serif; }
.stat-lbl { font-size: 12px; opacity: .85; margin-top: 2px; }

/* ── SECTIONS ── */
section.site { padding: 80px 40px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--gold); text-transform: uppercase; margin-bottom: 10px; }
h2.site { font-size: clamp(26px, 3.5vw, 40px); font-weight: 700; color: var(--navy); font-family: Georgia, serif; margin-bottom: 14px; }
.section-sub { font-size: 16px; color: var(--gray); max-width: 640px; line-height: 1.7; margin-bottom: 48px; }

/* ── SERVICES GRID ── */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.svc-card { background: var(--off); border: 1px solid var(--border); border-radius: 10px; padding: 24px; border-top: 4px solid var(--navy); transition: border-top-color .2s, box-shadow .2s; }
.svc-card:hover { border-top-color: var(--gold); box-shadow: 0 4px 20px rgba(13,43,85,.1); }
.svc-icon { font-size: 24px; margin-bottom: 12px; }
.svc-card h3 { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.svc-card p { font-size: 13px; color: var(--gray); line-height: 1.6; }

/* ── PRODUCTS ── */
.products-section { background: var(--navy); }
.products-section h2.site { color: #fff; }
.products-section .section-sub { color: #99AABB; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.prod-card { background: var(--navy2); border: 1px solid var(--trace); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; }
.prod-card-top { height: 4px; border-radius: 2px; margin-bottom: 16px; background: var(--blue); }
.prod-name { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.prod-year { font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: 1px; margin-bottom: 10px; text-transform: uppercase; }
.prod-desc { font-size: 13px; color: #AABBCC; line-height: 1.6; flex: 1; }
.prod-cta { margin-top: 14px; font-size: 12.5px; color: var(--gold); text-decoration: none; font-weight: 700; }
.prod-cta:hover { text-decoration: underline; }

/* ── WHY ── */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.why-card { border-left: 4px solid var(--gold); padding: 24px 24px 24px 28px; background: var(--off); border-radius: 0 10px 10px 0; }
.why-card h3 { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.why-card p { font-size: 14px; color: var(--gray); line-height: 1.65; }

/* ── SECTORS ── */
.sectors-list { display: flex; flex-wrap: wrap; gap: 12px; }
.sector-pill { background: var(--navy); color: #AABBCC; padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1px solid var(--trace); }

/* ── CTA / CONTACT ── */
.cta-section { background: var(--navy); text-align: center; }
.cta-section h2.site { color: #fff; margin-bottom: 14px; }
.cta-section p { color: #99AABB; font-size: 16px; margin-bottom: 32px; }
.cta-btns { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.contact-lines { color: #7A9ABB; font-size: 14px; margin-top: 28px; line-height: 2; }
.contact-lines a { color: #AABBCC; text-decoration: none; }
.contact-lines a:hover { color: var(--gold); }

/* ── FOOTER ── */
footer.site { background: #071A38; padding: 40px; border-top: 4px solid var(--gold); }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-logo { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.footer-logo span { color: var(--gold); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: #7A9ABB; font-size: 13px; text-decoration: none; }
.footer-links a:hover { color: var(--gold); }
.footer-copy { color: #4A6080; font-size: 12px; width: 100%; text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--trace); line-height: 1.8; }

/* ============================================================
   PORTAL
   ============================================================ */
.portal-wrap { min-height: calc(100vh - 64px); background: var(--off); }

/* auth card */
.auth-stage { display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.auth-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 34px 30px; width: 100%; max-width: 430px; box-shadow: 0 14px 44px rgba(13,43,85,.10); }
.auth-card h2 { font-family: Georgia, serif; color: var(--navy); font-size: 24px; margin-bottom: 6px; }
.auth-sub { font-size: 13px; color: var(--gray); margin-bottom: 22px; line-height: 1.6; }
.auth-switch { text-align: center; font-size: 13px; color: var(--gray); margin-top: 16px; }
.auth-switch a { color: var(--gold-d); font-weight: 700; text-decoration: none; cursor: pointer; }

/* form controls */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 5px; letter-spacing: .02em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--dark); background: #fff; outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { min-height: 110px; resize: vertical; }
.field .hint { font-size: 11px; color: var(--gray); margin-top: 4px; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-msg { font-size: 13px; margin: 10px 0 0; min-height: 18px; }
.form-msg.err { color: var(--bad); }
.form-msg.ok { color: var(--good); }

/* portal shell */
.portal-shell { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.portal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.portal-head h2 { font-family: Georgia, serif; color: var(--navy); font-size: 26px; }
.portal-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.ptab { background: #fff; border: 1.5px solid var(--border); color: var(--gray); border-radius: 999px; padding: 9px 18px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all .15s; position: relative; }
.ptab:hover { border-color: var(--gold); color: var(--gold-d); }
.ptab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.ptab .dot { position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--off); }

/* cards & lists */
.pcard { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 16px; }
.pcard h3 { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.pcard .muted { font-size: 13px; color: var(--gray); line-height: 1.6; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.price-line { font-family: Georgia, serif; font-size: 22px; font-weight: 700; color: var(--blue); margin: 10px 0 2px; }
.price-note { font-size: 12px; color: var(--gray); margin-bottom: 12px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 11px; border-radius: 999px; letter-spacing: .03em; }
.badge.new       { background: #E8EFFC; color: #1d4ed8; }
.badge.reviewing { background: #FFF4E0; color: var(--warn); }
.badge.invoiced  { background: #FFF4E0; color: var(--warn); }
.badge.quoted    { background: #EDE9FE; color: #6d28d9; }
.badge.paid      { background: #E8F6EE; color: var(--good); }
.badge.delivered { background: #E8F6EE; color: var(--good); }
.badge.accepted  { background: #E8F6EE; color: var(--good); }
.badge.declined  { background: #FDECEC; color: var(--bad); }
.badge.cancelled { background: #EEF2F7; color: var(--gray); }
.badge.closed    { background: #EEF2F7; color: var(--gray); }
.row-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--lgray); }
.row-line:last-child { border-bottom: 0; }
.row-main { min-width: 0; }
.row-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.row-meta { font-size: 12px; color: var(--gray); margin-top: 2px; }

/* modal */
.pmodal-overlay { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(10,18,32,.55); align-items: center; justify-content: center; padding: 18px; }
.pmodal-overlay.active { display: flex; }
.pmodal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 26px 26px 22px; box-shadow: 0 30px 80px rgba(8,15,28,.4); }
.pmodal h3 { font-family: Georgia, serif; color: var(--navy); font-size: 20px; margin-bottom: 4px; }
.pmodal .pm-sub { font-size: 13px; color: var(--gray); margin-bottom: 18px; line-height: 1.6; }
.pm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* messages */
.msg-box { display: flex; flex-direction: column; height: 60vh; min-height: 380px; }
.msg-list { flex: 1; overflow-y: auto; padding: 6px 2px; }
.msg { max-width: 78%; margin-bottom: 10px; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; }
.msg .m-meta { font-size: 10.5px; opacity: .65; margin-top: 4px; }
.msg.me { margin-left: auto; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { margin-right: auto; background: #fff; border: 1px solid var(--border); color: var(--dark); border-bottom-left-radius: 4px; }
.msg-compose { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--lgray); align-items: flex-end; }
.msg-compose textarea { flex: 1; min-height: 46px; max-height: 130px; padding: 11px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 13.5px; resize: vertical; outline: none; }
.msg-compose textarea:focus { border-color: var(--gold); }
.msg-email-opt { font-size: 11.5px; color: var(--gray); display: flex; align-items: center; gap: 6px; margin-top: 6px; }

/* empty state */
.pempty { text-align: center; padding: 46px 16px; color: var(--gray); }
.pempty .e-ic { font-size: 34px; margin-bottom: 10px; }
.pempty .e-t { font-weight: 700; color: var(--navy); font-size: 15px; margin-bottom: 4px; }
.pempty .e-s { font-size: 13px; }

/* config warning */
.config-warn { background: var(--gold-l); border: 1px solid #E5C86A; color: #6b5312; border-radius: 10px; padding: 14px 18px; font-size: 13.5px; line-height: 1.65; margin: 20px auto; max-width: 720px; }

@media (max-width: 768px) {
  nav.site-nav { padding: 0 16px; }
  .nav-links { display: none; }
  .hero { padding: 60px 20px; }
  .hero-inner { flex-direction: column; gap: 40px; }
  .hero-icon { display: none; }
  section.site { padding: 60px 20px; }
  .split-2 { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
}
