/* ============================================================
   Areti Health — landing page (index.html)
   Card grid + featured engagement card + modals.
   Depends on _shared.css for brand tokens & chrome.
   ============================================================ */

.demos-section {
  background: var(--gray-50);
  padding: 64px 0 80px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

/* 2x2 grid on desktop, single column on mobile */
.demos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.demo-card {
  background: white;
  border-radius: 18px;
  padding: 32px 28px 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 14px 36px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--gray-200);
  min-height: 300px;
}
.demo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 24px 50px rgba(124,41,196,.14);
  border-color: rgba(124,41,196,.2);
}
.demo-num {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--purple);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.demo-card h3 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--dark);
}
.demo-card p {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.55;
  margin: 0 0 24px;
  flex: 1;
}
.demo-card .who {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-700);
  background: var(--gray-100);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 16px;
  align-self: flex-start;
}
.demo-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: var(--dark);
  color: white;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  align-self: flex-start;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.demo-cta:hover { background: var(--purple); }

/* Featured (engagement) card with embedded form */
.demo-card.featured {
  background: linear-gradient(135deg, var(--purple), var(--indigo));
  color: white;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 28px 56px rgba(124,41,196,.28);
  position: relative;
  overflow: hidden;
}
.demo-card.featured::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.demo-card.featured > * { position: relative; z-index: 1; }
.demo-card.featured .demo-num { color: var(--amber); }
.demo-card.featured h3 { color: white; }
.demo-card.featured p { color: rgba(255,255,255,.88); flex: 0; margin-bottom: 18px; }
.demo-card.featured .who { background: rgba(255,255,255,.18); color: white; }

.demo-card.featured .form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.demo-card.featured input {
  padding: 13px 16px;
  border: 1.5px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1);
  border-radius: 10px;
  color: white;
  font-size: 14px;
  width: 100%;
  font-family: inherit;
}
.demo-card.featured input::placeholder { color: rgba(255,255,255,.6); }
.demo-card.featured input:focus {
  outline: none;
  border-color: var(--amber);
  background: rgba(255,255,255,.16);
}
.demo-card.featured input.invalid {
  border-color: #ffd2da;
  background: rgba(209,55,78,.25);
}

.modal-btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.btn-modal {
  padding: 12px 8px;
  background: white;
  color: var(--purple);
  font-weight: 800;
  font-size: 13px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform .12s, opacity .15s;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.btn-modal:hover { transform: translateY(-2px); }
.btn-modal:disabled { opacity: .6; cursor: progress; transform: none; }
.btn-modal .ic { font-size: 18px; line-height: 1; }
.btn-modal .lbl { font-size: 11px; letter-spacing: 0.04em; }

/* Inline form feedback (assertive for screen readers) */
.form-status {
  min-height: 18px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
}
.form-status.error { color: #ffd2da; }
.form-status.success { color: var(--teal); }

/* Generic centered overlay used for chat + reporting modals */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,20,16,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  overflow-y: auto;
}
.overlay.open { display: flex; }
.overlay-panel {
  background: white;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  position: relative;
  max-width: 100%;
  margin: auto;
  overflow: hidden;
  animation: pop .22s ease-out;
}
@keyframes pop { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay-close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 5;
  background: rgba(0,0,0,.06);
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
  color: var(--gray-700);
  cursor: pointer;
  transition: background .15s;
}
.overlay-close:hover { background: rgba(0,0,0,.12); }

/* Chat modal — wraps the self-contained Areti widget (natural size ~400x633) */
.chat-panel { width: 430px; padding: 0; background: transparent; }
#areti-widget { max-width: 100%; margin: 0 auto; }
/* Close button sits over the widget's hero — keep it legible on any background */
.chat-panel .overlay-close {
  top: 16px;
  right: 16px;
  background: #fff;
  color: var(--dark);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.chat-panel .overlay-close:hover { background: var(--gray-100); }

/* Reporting modal */
.report-panel { width: min(1100px, 96vw); padding: 0; }
.report-panel img { display: block; width: 100%; height: auto; border-radius: 18px; }

@media (max-width: 900px) {
  .demos-grid { grid-template-columns: 1fr; }
  .demo-card { min-height: auto; }
}
