/* Health IT Systems — design tokens, cards, scroll reveals. Tweak :root to rebrand. */
:root {
  --his-ink: #0a1628;
  --his-navy: #0c2744;
  --his-navy-mid: #143a5c;
  --his-teal: #0d9488;
  --his-teal-bright: #14b8a6;
  --his-sky: #38bdf8;
  --his-accent: #f0b429;
  --his-accent-soft: #fcd34d;
  --his-surface: #eef2f7;
  --his-surface-warm: #f8fafc;
  --his-card-bg: rgba(255, 255, 255, 0.92);
  --his-border: rgba(15, 23, 42, 0.08);
  --his-shadow: 0 4px 6px -1px rgb(15 23 42 / 0.06), 0 10px 24px -12px rgb(15 23 42 / 0.12);
  --his-shadow-hover: 0 20px 40px -16px rgb(15 23 42 / 0.18), 0 8px 16px -6px rgb(15 23 42 / 0.08);
  --his-radius: 1.125rem;
  --his-radius-sm: 0.75rem;
  --his-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --his-reveal-duration: 0.65s;
  --his-reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.his-body {
  --bs-body-font-family: var(--his-font);
  --bs-body-color: #0f172a;
  --bs-primary: #0d9488;
  --bs-primary-rgb: 13, 148, 136;
  --bs-link-color: #0f766e;
  --bs-link-hover-color: #0d5c54;
  font-family: var(--his-font);
  background-color: var(--his-surface);
  color: var(--bs-body-color);
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-family: var(--his-font);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.his-main {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgb(20 184 166 / 0.09), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgb(56 189 248 / 0.07), transparent 45%),
    linear-gradient(180deg, var(--his-surface) 0%, var(--his-surface-warm) 55%, var(--his-surface) 100%);
}

.his-header {
  background: linear-gradient(
    115deg,
    var(--his-ink) 0%,
    var(--his-navy) 38%,
    var(--his-navy-mid) 62%,
    #0f5c4a 100%
  );
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  backdrop-filter: blur(8px);
}

.his-header .navbar {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.his-header .nav-link {
  position: relative;
  padding: 0.5rem 0.85rem;
  border-radius: var(--his-radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.his-header .nav-link:hover,
.his-header .nav-link:focus {
  color: #fff;
  background-color: rgb(255 255 255 / 0.08);
}

.his-header .nav-link::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.25rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--his-accent-soft), var(--his-teal-bright));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--his-reveal-ease);
}

.his-header .nav-link:hover::after,
.his-header .nav-link:focus::after {
  transform: scaleX(1);
}

.navbar-brand {
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar-brand:hover {
  transform: scale(1.03);
  opacity: 0.95;
}

.his-navbar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.btn-accent {
  background: linear-gradient(135deg, var(--his-accent) 0%, #e8a317 100%);
  border: none;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 4px 14px rgb(240 180 41 / 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-accent:hover {
  filter: brightness(1.03);
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgb(240 180 41 / 0.5);
}

.btn-accent:active {
  transform: translateY(0);
}

.his-body .btn-primary {
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 12px rgb(13 148 136 / 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.his-body .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgb(13 148 136 / 0.4);
  filter: brightness(1.02);
}

.his-card .card-header {
  background: linear-gradient(180deg, rgb(248 250 252) 0%, rgb(255 255 255 / 0.98) 100%);
  border-bottom: 1px solid var(--his-border);
  color: var(--his-navy);
}

.his-card .list-group-item {
  border-color: rgb(15 23 42 / 0.06);
}

.his-footer {
  background: linear-gradient(180deg, var(--his-ink) 0%, #050d18 100%);
  color: #cbd5e1;
  border-top: 1px solid rgb(56 189 248 / 0.12);
}

.his-footer a {
  transition: color 0.2s ease, opacity 0.2s ease;
}

.his-footer a:hover {
  color: var(--his-accent-soft) !important;
}

/* —— Hero —— */
.his-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--his-radius);
  padding: 2.5rem 2rem;
  background:
    radial-gradient(circle at 0% 0%, rgb(245 179 1 / 0.28), transparent 42%),
    radial-gradient(circle at 100% 20%, rgb(20 184 166 / 0.35), transparent 50%),
    linear-gradient(135deg, var(--his-ink) 0%, #0f3d5c 48%, #0a5c52 100%);
  color: #f8fafc;
  box-shadow: var(--his-shadow-hover);
}

.his-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: overlay;
}

.his-hero > * {
  position: relative;
  z-index: 1;
}

.his-hero h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.his-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  border: 1px solid rgb(255 255 255 / 0.2);
  color: #ecfdf5;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
}

.his-hero-panel {
  border-radius: var(--his-radius);
  padding: 1.25rem 1.35rem;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.18);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.2);
}

.his-hero-panel h2 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* —— Scroll reveal (progressive: no .his-js = visible) —— */
html.his-js .his-reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(1.75rem);
}

.his-reveal {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--his-reveal-duration) var(--his-reveal-ease),
    transform var(--his-reveal-duration) var(--his-reveal-ease);
  will-change: opacity, transform;
}

.his-reveal.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html.his-js .his-reveal:not(.is-visible) {
    opacity: 1;
    transform: none;
  }

  .his-reveal {
    transition: none;
  }

  .his-card:hover {
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Stagger home / services card grids */
.his-card-grid > .his-reveal:nth-child(1) {
  transition-delay: 0.03s;
}
.his-card-grid > .his-reveal:nth-child(2) {
  transition-delay: 0.07s;
}
.his-card-grid > .his-reveal:nth-child(3) {
  transition-delay: 0.11s;
}
.his-card-grid > .his-reveal:nth-child(4) {
  transition-delay: 0.15s;
}
.his-card-grid > .his-reveal:nth-child(5) {
  transition-delay: 0.19s;
}
.his-card-grid > .his-reveal:nth-child(6) {
  transition-delay: 0.23s;
}
.his-card-grid > .his-reveal:nth-child(7) {
  transition-delay: 0.27s;
}
.his-card-grid > .his-reveal:nth-child(8) {
  transition-delay: 0.31s;
}
.his-card-grid > .his-reveal:nth-child(9) {
  transition-delay: 0.35s;
}
.his-card-grid > .his-reveal:nth-child(10) {
  transition-delay: 0.39s;
}
.his-card-grid > .his-reveal:nth-child(11) {
  transition-delay: 0.43s;
}
.his-card-grid > .his-reveal:nth-child(12) {
  transition-delay: 0.47s;
}

/* —— Modern cards —— */
.his-card {
  position: relative;
  border: 1px solid var(--his-border) !important;
  border-radius: var(--his-radius) !important;
  background: var(--his-card-bg);
  box-shadow: var(--his-shadow);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition:
    transform 0.35s var(--his-reveal-ease),
    box-shadow 0.35s var(--his-reveal-ease),
    border-color 0.25s ease;
}

.his-card-media {
  position: relative;
  z-index: 0;
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
}

.his-card-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.his-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2;
  background: linear-gradient(90deg, var(--his-teal), var(--his-sky), var(--his-accent-soft));
  opacity: 0.85;
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.4s var(--his-reveal-ease);
}

.his-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--his-shadow-hover);
  border-color: rgb(13 148 136 / 0.18) !important;
}

.his-card:hover::before {
  transform: scaleX(1);
}

.his-card .card-body {
  padding: 1.35rem 1.4rem;
}

.his-card h2,
.his-card h3,
.his-card .h4,
.his-card .h5 {
  color: var(--his-navy);
  font-weight: 600;
}

.his-card p {
  color: #475569;
  line-height: 1.55;
}

/* Forms inside elevated cards */
.his-card .form-control,
.his-card .form-select {
  border-radius: var(--his-radius-sm);
  border-color: rgb(15 23 42 / 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.his-card .form-control:focus,
.his-card .form-select:focus {
  border-color: rgb(13 148 136 / 0.55);
  box-shadow: 0 0 0 0.2rem rgb(13 148 136 / 0.18);
}

/* Table in card (tickets list) */
.his-card .table {
  --bs-table-bg: transparent;
}

.his-card .table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-bottom-color: var(--his-border);
  font-weight: 600;
}

.his-card .table tbody tr {
  transition: background-color 0.15s ease;
}

.his-card .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgb(248 250 252 / 0.9);
}

.his-card .table tbody tr:hover > * {
  background-color: rgb(240 253 250 / 0.85);
}

/* Page intros */
.his-page-lead {
  max-width: 52rem;
  line-height: 1.65;
}

/* Photography — card thumbnails under wwwroot/images/cards */
.his-hero-photo {
  margin: 0;
}

.his-hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--his-radius);
  border: 1px solid rgb(255 255 255 / 0.28);
  box-shadow: 0 16px 48px rgb(0 0 0 / 0.28);
}

.his-visual-strip .his-visual-tile {
  margin: 0;
  height: 100%;
  border-radius: var(--his-radius);
  overflow: hidden;
  background: var(--his-card-bg);
  border: 1px solid var(--his-border);
  box-shadow: var(--his-shadow);
  transition: transform 0.35s var(--his-reveal-ease), box-shadow 0.35s var(--his-reveal-ease);
}

.his-visual-strip .his-visual-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--his-shadow-hover);
}

.his-visual-strip .his-visual-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.55s var(--his-reveal-ease);
}

.his-visual-strip .his-visual-tile:hover img {
  transform: scale(1.04);
}

.his-visual-strip figcaption {
  padding: 0.85rem 1.1rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #475569;
  border-top: 1px solid var(--his-border);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.98) 0%, rgb(248 250 252) 100%);
}

.his-page-banner {
  margin: 0 0 2rem;
  border-radius: var(--his-radius);
  overflow: hidden;
  border: 1px solid var(--his-border);
  box-shadow: var(--his-shadow);
}

.his-page-banner img {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 300px;
  object-fit: cover;
}

@media (max-width: 575.98px) {
  .his-page-banner img {
    aspect-ratio: 16 / 10;
    max-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .his-visual-strip .his-visual-tile:hover img {
    transform: none;
  }

  .his-visual-strip .his-visual-tile:hover {
    transform: none;
  }
}

/* Ticket bot */
.ticket-bot-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
}

#ticket-bot-toggle {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#ticket-bot-toggle:hover {
  transform: translateY(-2px);
}

.ticket-bot-panel {
  position: absolute;
  right: 0;
  bottom: 3.35rem;
  width: min(420px, 92vw);
  border-radius: var(--his-radius) !important;
  border: 1px solid var(--his-border);
  overflow: hidden;
  font-family: var(--his-font);
}

.ticket-bot-panel .card-header {
  background: linear-gradient(135deg, var(--his-navy) 0%, #0f5c4a 100%);
  color: #f1f5f9;
  border-bottom: none;
}

.ticket-bot-log {
  height: 280px;
  overflow-y: auto;
  background: var(--his-surface-warm);
  font-size: 0.9rem;
}

.ticket-bot-msg {
  margin-bottom: 0.65rem;
}

.ticket-bot-msg .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.ticket-bot-msg.user .bubble {
  background: #ccfbf1;
  border: 1px solid rgb(13 148 136 / 0.15);
}

.ticket-bot-msg.bot .bubble {
  background: #fff;
  border: 1px solid var(--his-border);
}

.ticket-bot-msg .bubble {
  border-radius: var(--his-radius-sm);
  padding: 0.5rem 0.85rem;
  white-space: pre-wrap;
}
