/* S365_PROFESSIONAL_REFRESH_V1 — polished, responsive presentation layer only. */
:root {
  --s365-ink: #14233d;
  --s365-navy: #0c2b4e;
  --s365-blue: #174a7e;
  --s365-blue-strong: #205f9d;
  --s365-orange: #f58220;
  --s365-orange-dark: #d96a0b;
  --s365-bg: #f5f8fc;
  --s365-surface: #ffffff;
  --s365-line: #e2e9f2;
  --s365-muted: #607089;
  --s365-shadow: 0 8px 28px rgba(17, 43, 78, .075);
  --s365-shadow-hover: 0 15px 36px rgba(17, 43, 78, .13);
  --s365-radius: 16px;
}

html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  color: var(--s365-ink);
  background: var(--s365-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body * { box-sizing: border-box; }
main { min-height: 62vh; }
.shell { width: min(1200px, calc(100% - 40px)); margin-left: auto; margin-right: auto; }

/* Header and navigation */
body > header, header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(218,228,240,.95);
  box-shadow: 0 4px 20px rgba(12,43,78,.045);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
header .shell.nav {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 76px;
  padding-top: 10px;
  padding-bottom: 10px;
}
header .brand {
  display: inline-flex;
  align-items: baseline;
  flex-shrink: 0;
  color: var(--s365-navy);
  font-size: 1.27rem;
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: 1.1;
  text-decoration: none;
}
header .brand span { color: var(--s365-orange); }
header nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}
header nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #344761;
  font-size: .88rem;
  font-weight: 680;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}
header nav a:hover, header nav a:focus-visible {
  color: var(--s365-blue);
  background: #edf4fb;
  text-decoration: none;
}
header .account { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
header .account a:not(.pill) { color: #344761; font-size: .9rem; font-weight: 700; text-decoration: none; }
header .account form { margin: 0; }
header .account button {
  border: 1px solid var(--s365-line);
  border-radius: 9px;
  background: #fff;
  color: var(--s365-ink);
  padding: 9px 12px;
  font: inherit;
  font-size: .88rem;
  font-weight: 750;
  cursor: pointer;
}

/* Consistent typography and spacing */
h1, h2, h3, h4 { color: var(--s365-ink); letter-spacing: -.025em; line-height: 1.22; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 850; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2.15rem); font-weight: 820; }
h3 { font-size: 1.12rem; font-weight: 780; }
p { color: inherit; }
main a:not(.primary):not(.pill) { text-underline-offset: 3px; }
main a:not(.primary):not(.pill):hover { color: var(--s365-blue-strong); }

/* Hero area on the homepage */
body.s365-homepage main .hero,
body.s365-homepage main .home-hero,
body.s365-homepage main .hero-section,
body.s365-homepage main .hero-wrap,
body.s365-homepage main > section:first-of-type:has(h1) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: clamp(44px, 6vw, 78px);
  padding-bottom: clamp(46px, 6vw, 82px);
  background: linear-gradient(120deg, #0b294a 0%, #123f6d 54%, #205e91 100%);
  color: #fff;
  border-bottom: 4px solid var(--s365-orange);
}
body.s365-homepage main .hero::after,
body.s365-homepage main .home-hero::after,
body.s365-homepage main .hero-section::after,
body.s365-homepage main .hero-wrap::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(48vw, 560px);
  aspect-ratio: 1;
  right: -9%;
  top: -42%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 42px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.02);
  pointer-events: none;
}
body.s365-homepage main .hero h1,
body.s365-homepage main .home-hero h1,
body.s365-homepage main .hero-section h1,
body.s365-homepage main .hero-wrap h1,
body.s365-homepage main > section:first-of-type:has(h1) h1 {
  max-width: 800px;
  margin-top: 8px;
  margin-bottom: 18px;
  color: #fff;
  font-size: clamp(2.45rem, 5.5vw, 4.25rem);
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: 1.04;
}
body.s365-homepage main .hero p,
body.s365-homepage main .home-hero p,
body.s365-homepage main .hero-section p,
body.s365-homepage main .hero-wrap p,
body.s365-homepage main > section:first-of-type:has(h1) p {
  max-width: 690px;
  color: rgba(255,255,255,.86);
  font-size: clamp(1rem, 1.6vw, 1.13rem);
  line-height: 1.75;
}
body.s365-homepage main .hero small,
body.s365-homepage main .home-hero small,
body.s365-homepage main .hero-section small,
body.s365-homepage main .hero-wrap small { color: #ffd6ad; font-weight: 800; letter-spacing: .11em; }

/* Section rhythm and card system */
.section { padding-top: clamp(30px, 4.5vw, 54px); padding-bottom: clamp(30px, 4.5vw, 54px); }
body.s365-homepage main .section.shell { max-width: 1200px; }
body.s365-homepage main .section h2 { margin-top: 0; margin-bottom: 12px; }
.pagehead {
  padding-top: clamp(32px, 4vw, 52px);
  padding-bottom: clamp(32px, 4vw, 52px);
  color: #fff;
  background: linear-gradient(120deg, #0c2b4e, #1c568a);
  border-bottom: 4px solid var(--s365-orange);
}
.pagehead h1, .pagehead h2, .pagehead h3 { color: #fff; }
.pagehead p { max-width: 760px; color: rgba(255,255,255,.84); }
.pagehead small { color: #ffd6ad; font-size: .78rem; font-weight: 850; letter-spacing: .12em; }
.card, .cards > .card {
  min-width: 0;
  border: 1px solid var(--s365-line);
  border-radius: var(--s365-radius);
  background: var(--s365-surface);
  box-shadow: var(--s365-shadow);
  overflow-wrap: anywhere;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cards { gap: 18px; }
.cards > .card { height: 100%; }
.cards > .card:hover, .card:hover { border-color: #c6d7eb; box-shadow: var(--s365-shadow-hover); }
.cards > .card:hover { transform: translateY(-3px); }

/* Buttons and links */
a.primary, button.primary, .primary, a.pill, button, input[type="submit"] {
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
}
a.primary, button.primary, .primary, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid var(--s365-orange);
  background: var(--s365-orange);
  color: #fff !important;
  text-align: center;
  text-decoration: none !important;
  line-height: 1.25;
  box-shadow: 0 5px 12px rgba(245,130,32,.16);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
a.primary:hover, button.primary:hover, .primary:hover, input[type="submit"]:hover {
  background: var(--s365-orange-dark);
  border-color: var(--s365-orange-dark);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(217,106,11,.22);
}
a.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  background: var(--s365-blue);
  color: #fff !important;
  text-decoration: none !important;
}
button { cursor: pointer; }
:where(a, button, input, select, textarea):focus-visible { outline: 3px solid rgba(245,130,32,.7); outline-offset: 3px; }

/* Forms, tables, alerts and utility content */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  max-width: 100%;
  border: 1px solid #ccd7e5;
  border-radius: 10px;
  background: #fff;
  color: var(--s365-ink);
  padding: 11px 13px;
  font: inherit;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: var(--s365-blue-strong);
  box-shadow: 0 0 0 3px rgba(32,95,157,.1);
}
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
th { background: #edf3fa; color: #173654; font-weight: 800; text-align: left; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--s365-line); }
.msgs { margin-top: 18px; margin-bottom: 18px; }
.msgs > div { padding: 12px 15px; border: 1px solid #d5e4f3; border-radius: 10px; background: #eff6ff; color: #173654; }

/* Footer */
footer {
  margin-top: 28px;
  border-top: 4px solid var(--s365-orange);
  background: #0b223d;
  color: rgba(255,255,255,.8);
}
footer .foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding-top: 34px; padding-bottom: 34px; }
footer b, footer strong { color: #fff; }
footer p { color: rgba(255,255,255,.74); }
footer a { color: #ffd1a7 !important; }

/* Make common anchored sections land below the sticky header. */
#tests, #notifications, #categories, #s365-featured-series, #s365-home-materials, #s365-home-bundles { scroll-margin-top: 96px; }

@media (min-width: 761px) and (max-width: 1120px) {
  header .shell.nav { flex-wrap: wrap; gap: 10px 16px; padding-top: 13px; padding-bottom: 13px; }
  header .brand { margin-right: auto; }
  header .account { margin-left: auto; }
  header nav { order: 3; flex: 1 0 100%; justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1200px); }
  header .shell.nav {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "brand account" "nav nav";
    gap: 9px 12px;
    min-height: 0;
    padding-top: 12px;
    padding-bottom: 10px;
  }
  header .brand { grid-area: brand; font-size: 1.2rem; }
  header nav {
    grid-area: nav;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 2px 0 5px;
    scrollbar-width: thin;
  }
  header nav a { min-height: 36px; padding: 8px 10px; font-size: .82rem; }
  header .account { grid-area: account; gap: 7px; }
  header .account a:not(.pill) { font-size: .84rem; }
  header .account .pill { min-height: 36px; padding: 8px 11px; font-size: .84rem; }
  header .account button { padding: 7px 9px; font-size: .82rem; }
  .section { padding-top: 30px; padding-bottom: 30px; }
  .cards { grid-template-columns: 1fr; }
  footer .foot { flex-direction: column; gap: 14px; }
  table { display: block; overflow-x: auto; }
}
@media (max-width: 420px) {
  .shell { width: calc(100% - 24px); }
  header .brand { font-size: 1.1rem; }
  header .account { gap: 5px; }
  header .account .pill { padding: 7px 9px; }
  body.s365-homepage main .hero h1,
  body.s365-homepage main .home-hero h1,
  body.s365-homepage main .hero-section h1,
  body.s365-homepage main .hero-wrap h1 { font-size: 2.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
