/* Utility & Layout System */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-8);
}
.container-wide {
  width: 100%;
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 0 var(--space-8);
}
.container-narrow {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

@media (max-width: 768px) {
  .container,
  .container-wide,
  .container-narrow { padding: 0 var(--space-5); }
}

/* Section Spacing */
.section { padding: var(--space-24) 0; }
.section-sm { padding: var(--space-16) 0; }
.section-lg { padding: var(--space-32) 0; }

/* Section headers */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.section-header h2 { margin: 0; }
.section-header p { font-size: var(--text-lg); }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); }

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Flex utilities */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.items-center{ align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Colors */
.text-teal   { color: var(--h2eo-teal); }
.text-blue   { color: var(--h2eo-mid-blue); }
.text-muted  { color: var(--text-muted); }
.text-white  { color: var(--white); }

/* Backgrounds */
.bg-white  { background: var(--white); }
.bg-off    { background: var(--off-white); }
.bg-soft   { background: var(--surface-soft); }
.bg-dark   { background: var(--surface-dark); }
.bg-teal   { background: var(--h2eo-teal); }
.bg-gradient-dark {
  background: linear-gradient(135deg, var(--h2eo-navy) 0%, var(--h2eo-blue) 100%);
}
.bg-gradient-teal {
  background: linear-gradient(135deg, var(--h2eo-teal) 0%, var(--h2eo-mid-blue) 100%);
}

/* Dark CTA section */
.cta-dark {
  background: linear-gradient(135deg, var(--h2eo-navy) 0%, #0f2d52 60%, #0d3d3a 100%);
  position: relative;
  overflow: hidden;
}
.cta-dark::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(13,148,136,0.2), transparent 70%);
  border-radius: 50%; filter: blur(80px);
  top: -100px; right: -80px; pointer-events: none;
}
.cta-dark .glass-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
}

/* Stats bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  text-align: center;
}
@media (max-width: 768px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .stats-bar { grid-template-columns: 1fr; }
}
.stat-item { display: flex; flex-direction: column; gap: var(--space-2); }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--h2eo-navy);
  line-height: 1;
}
.stat-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

/* Dividers */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-8) 0;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-teal  { background: rgba(13,148,136,0.1);  color: var(--h2eo-teal); }
.badge-blue  { background: rgba(26,58,107,0.1);   color: var(--h2eo-mid-blue); }
.badge-gold  { background: rgba(212,168,67,0.12); color: #9c6f10; }
.badge-gray  { background: var(--gray-100);        color: var(--text-muted); }
.badge-green { background: rgba(34,197,94,0.1);   color: #16a34a; }

/* Tag list */
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Trust strip */
.trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-4) var(--space-8);
  background: var(--surface-soft);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.trust-item {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.trust-item::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--h2eo-teal);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--h2eo-teal), var(--h2eo-teal-light));
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease-out);
}

/* Image */
img { max-width: 100%; height: auto; display: block; }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Focus ring */
:focus-visible {
  outline: 2.5px solid var(--h2eo-teal);
  outline-offset: 3px;
}

/* Footer */
.site-footer {
  background: var(--h2eo-navy);
  color: rgba(255,255,255,0.72);
  padding: var(--space-20) 0 var(--space-10);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { display: flex; flex-direction: column; gap: var(--space-5); }
.footer-logo { height: 36px; width: auto; filter: brightness(0) invert(1); }
.footer-desc { font-size: var(--text-sm); line-height: 1.7; color: rgba(255,255,255,0.55); }
.footer-social { display: flex; gap: var(--space-3); }
.footer-social-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.55);
  transition: background var(--duration-fast), color var(--duration-fast);
  font-size: var(--text-sm);
}
.footer-social-link:hover { background: var(--h2eo-teal); color: white; }

.footer-col h5 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}
.footer-links-list { display: flex; flex-direction: column; gap: var(--space-3); list-style: none; }
.footer-links-list a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color var(--duration-fast);
}
.footer-links-list a:hover { color: var(--white); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-copyright { font-size: var(--text-sm); color: rgba(255,255,255,0.4); }
.footer-legal { display: flex; gap: var(--space-6); }
.footer-legal a { font-size: var(--text-sm); color: rgba(255,255,255,0.4); text-decoration: none; }
.footer-legal a:hover { color: rgba(255,255,255,0.8); }

@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .trust-strip { gap: var(--space-4); }
}

/* Toast notification container */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
  max-width: 360px;
}
.toast {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  pointer-events: auto;
  animation: slideInRight 0.35s var(--ease-out) both;
  position: relative;
}
.toast.toast-exit { animation: slideOutRight 0.3s var(--ease-out) both; }
@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(120%); }
}
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.toast-success .toast-icon { background: rgba(34,197,94,0.12); color: #16a34a; }
.toast-error   .toast-icon { background: rgba(239,68,68,0.1);  color: #dc2626; }
.toast-info    .toast-icon { background: rgba(13,148,136,0.1); color: var(--h2eo-teal); }
.toast-warning .toast-icon { background: rgba(245,158,11,0.1); color: #d97706; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }
.toast-message { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-subtle);
  font-size: 18px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color var(--duration-fast);
}
.toast-close:hover { color: var(--text-primary); }

@media (max-width: 480px) {
  #toast-container { left: var(--space-4); right: var(--space-4); max-width: none; }
}
