/* e-Softworks brand guide, screen palette. Red is one button and one rule. */
:root {
  --navy: #0B2340;
  --navy-deep: #061627;
  --navy-mid: #163A5C;
  --navy-soft: #2A5478;
  --red: #E31B23;
  --paper: #F4F6F8;
  --mist: #E6EBF0;
  --silver: #C5CED6;
  --slate: #6B7A88;
  --ink: #1A2330;
  --white: #FFFFFF;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
  font-size: 1.05rem;
  line-height: 1.55;
}
h1, h2, h3, .wordmark {
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  letter-spacing: 0;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0; }
h2 { font-weight: 500; }
a { color: var(--navy); }
a:hover { color: var(--navy-mid); }
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 2000;
  background: var(--white);
  color: var(--navy);
  padding: .5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { left: 12px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--navy-soft);
  outline-offset: 2px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.25rem;
  background: var(--white);
  border-bottom: 1px solid var(--mist);
}
.wordmark {
  color: var(--navy);
  text-decoration: none;
  font-size: 1.05rem;
}
.wordmark span {
  display: block;
  height: 3px;
  margin-top: .28rem;
  background: var(--red);
  width: 100%;
}
.site-nav { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.site-nav a { color: var(--navy); text-decoration: none; font-weight: 600; }
.site-nav a[aria-current="page"] { color: var(--navy-soft); }

.hero {
  background: var(--navy-deep);
  color: var(--white);
  padding: 3.2rem 1.25rem 2.6rem;
}
.hero-inner { max-width: 1100px; margin: 0 auto; }
.kicker {
  margin: 0 0 .6rem;
  font-family: Montserrat, sans-serif;
  font-weight: 500;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9eb0c4;
}
.hero .subtitle { max-width: 40rem; margin: .9rem 0 0; font-size: 1.15rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }
.btn {
  display: inline-block;
  padding: .7rem 1.15rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: #B5121A; color: var(--white); }
.btn-secondary { background: transparent; color: var(--white); border-color: var(--white); }
.btn-secondary:hover { background: var(--white); color: var(--navy); }
.btn-navy { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-navy:hover { background: var(--navy); color: var(--white); }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .9rem;
  margin: 0 0 1.6rem;
}
.hub a {
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
}
.hub a strong { display: block; color: var(--navy); margin-bottom: .25rem; }
.hub a span { color: var(--slate); font-size: .95rem; }
.search, input[type="text"], input[type="email"], input[type="search"], select {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--silver);
  border-radius: var(--radius);
  font: inherit;
  background: var(--white);
  color: var(--ink);
}
.search { margin: .4rem 0 1.2rem; }
.phase {
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.phase-header {
  background: var(--navy);
  color: var(--white);
  padding: .9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.phase-header::-webkit-details-marker { display: none; }
.phase-header h2 { margin: 0; font-size: 1.15rem; color: var(--white); }
.phase-days { padding: 1rem; background: var(--paper); }
.day {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-bottom: .7rem;
  padding: .85rem 1rem;
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
}
.day h3 { margin: 0; font-size: 1.02rem; flex: 1 1 280px; font-weight: 500; }
.resources { flex: 1 1 240px; }
.resources ul { margin: 0; padding: 0; list-style: none; }
.resources a { font-weight: 600; text-decoration: none; }
.hidden { display: none !important; }
.code-list { columns: 2; padding-left: 1.1rem; }
.note { color: var(--slate); font-size: .95rem; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.product {
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.product .line {
  margin: 0;
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .02em;
  color: var(--navy);
}
.product h2 { margin: 0; font-size: 1.15rem; }
.price { margin: 0; font-size: 1.35rem; font-weight: 600; color: var(--navy); }
.product form { display: grid; gap: .45rem; margin-top: auto; }
.product label, .checkout label { font-weight: 600; font-size: .92rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.banner {
  background: var(--white);
  border: 1px solid var(--mist);
  border-left: 4px solid var(--navy);
  padding: .9rem 1rem;
  margin: 0 0 1rem;
}
.error {
  background: #fff;
  border: 1px solid var(--red);
  color: var(--ink);
  padding: .8rem 1rem;
  margin: 0 0 1rem;
}
.cart-table { width: 100%; border-collapse: collapse; background: var(--white); }
.cart-table th, .cart-table td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--mist); vertical-align: middle; }
.cart-table input[type="text"] { width: 4.5rem; }
.checkout { display: grid; gap: .7rem; max-width: 36rem; margin-top: 1.2rem; }
.legal { margin-top: 2rem; font-size: .95rem; color: var(--slate); }
.legal address { font-style: normal; color: var(--ink); }

footer {
  background: var(--navy-deep);
  color: #c5d0da;
  padding: 2rem 1.25rem;
}
footer .footer-inner { max-width: 1100px; margin: 0 auto; }
footer a { color: #d5e2ef; }
footer address { font-style: normal; margin: .5rem 0 1rem; }

#aiw-chat-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 1000;
}
#aiw-chat-panel {
  position: fixed;
  bottom: 5.6rem;
  right: 1.5rem;
  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 480px;
  max-height: calc(100vh - 8rem);
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  z-index: 1000;
}
#aiw-chat-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.aiw-chat-header {
  background: var(--navy);
  color: var(--white);
  padding: .85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.aiw-chat-header button { background: none; border: none; color: var(--white); font-size: 1.4rem; cursor: pointer; }
#aiw-chat-messages { flex: 1; overflow-y: auto; padding: 1rem; background: var(--paper); }
.aiw-msg { display: flex; margin-bottom: .8rem; }
.aiw-msg-user { justify-content: flex-end; }
.aiw-bubble { max-width: 82%; padding: .6rem .85rem; border-radius: var(--radius); font-size: .95rem; white-space: pre-wrap; }
.aiw-msg-bot .aiw-bubble { background: var(--white); }
.aiw-msg-user .aiw-bubble { background: var(--navy); color: var(--white); }
.aiw-sources { display: flex; flex-direction: column; gap: .3rem; margin: -.4rem 0 .8rem .2rem; }
.aiw-sources a { font-size: .8rem; }
.aiw-starters { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 .7rem .4rem; }
.aiw-starters button {
  border: 1px solid var(--silver);
  background: var(--white);
  border-radius: var(--radius);
  padding: .25rem .55rem;
  font-size: .78rem;
  cursor: pointer;
}
#aiw-chat-form { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--mist); }
#aiw-chat-input { flex: 1; }
#aiw-chat-form button[type="submit"] {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
}
@media (max-width: 720px) {
  .day, .phase-header { flex-direction: column; align-items: flex-start; }
  .code-list { columns: 1; }
  .site-header { align-items: flex-start; flex-direction: column; }
}
