/* ══════════════════════════════════════════════════════════════
   medai.care — Shared Design System
   ══════════════════════════════════════════════════════════════ */

:root {
  --deep-blue: #155A7D;
  --teal: #12978A;
  --sand: #F4F1ED;
  --sand-dark: #E8E4DE;
  --white: #FFFFFF;
  --black: #1A1A1A;
  --gray: #4A5568;
  --gray-light: #718096;
  --border: rgba(21, 90, 125, 0.07);
  --shadow: 0 4px 24px rgba(21, 90, 125, 0.06);
  --shadow-hover: 0 12px 40px -8px rgba(21, 90, 125, 0.12);
  --shadow-lift: 0 20px 60px -15px rgba(21, 90, 125, 0.1);
  --shadow-diffuse: 0 20px 80px -20px rgba(21, 90, 125, 0.08);
  --serif: 'Playfair Display', Georgia, serif;
  --display: 'Outfit', sans-serif;
  --body: 'Outfit', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: rgba(18, 151, 138, 0.15); color: var(--deep-blue); }

body {
  font-family: var(--body);
  background: var(--sand);
  color: var(--black);
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Grain texture ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.02;
  background-image: 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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
}

.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 20% 10%, rgba(21, 90, 125, 0.04) 0%, transparent 60%),
              radial-gradient(ellipse 60% 50% at 80% 80%, rgba(18, 151, 138, 0.03) 0%, transparent 50%);
}

.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 200;
  padding: 12px 24px; background: var(--deep-blue); color: white;
  font-weight: 600; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ══════════════════════ NAV ══════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #F2EDE7;
  backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 -1px 0 rgba(21, 90, 125, 0.04);
}
nav.scrolled { box-shadow: 0 1px 20px rgba(21, 90, 125, 0.06), inset 0 -1px 0 rgba(21, 90, 125, 0.04); }

.nav-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 68px;
}
.nav-logo {
  font-family: var(--display); font-size: 1.4rem; font-weight: 700;
  color: var(--deep-blue); text-decoration: none; letter-spacing: -0.03em;
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-logo em { font-style: normal; color: var(--teal); }
.nav-logo-icon {
  height: 68px;
  display: inline-block; flex-shrink: 0;
}
.nav-links { display: flex; gap: 28px; list-style: none; align-items: center; }
.nav-links a {
  font-size: 0.85rem; font-weight: 500; color: var(--gray);
  text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: var(--deep-blue); }
.nav-links a:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 4px; }
.nav-cta {
  padding: 10px 24px; background: var(--deep-blue); color: var(--white) !important;
  border-radius: 100px; font-weight: 600; transition: all 0.3s var(--ease);
}
.nav-cta:hover { background: var(--teal); transform: translateY(-1px); }
.nav-cta:active { transform: scale(0.97); }
.nav-back { font-size: 0.85rem; font-weight: 500; color: var(--gray); text-decoration: none; }
.nav-back:hover { color: var(--deep-blue); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--deep-blue); }

/* ══════════════════════ LAYOUT ══════════════════════ */
.container { position: relative; z-index: 1; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
section { padding: 120px 0; }

.section-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 100px;
  background: rgba(18, 151, 138, 0.06);
  border: 1px solid rgba(18, 151, 138, 0.1);
  font-family: var(--display); font-size: 0.72rem; font-weight: 600;
  color: var(--teal); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--serif); font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 700; color: var(--deep-blue); line-height: 1.15;
  letter-spacing: -0.02em; margin-bottom: 16px; text-wrap: balance;
}

/* ══════════════════════ SCROLL REVEAL ══════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ══════════════════════ BUTTONS ══════════════════════ */
.btn-primary {
  padding: 16px 32px; background: var(--deep-blue); color: white;
  font-family: var(--body); font-size: 1rem; font-weight: 600;
  border: none; border-radius: 12px; cursor: pointer; text-decoration: none;
  transition: all 0.3s var(--ease); display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 8px rgba(21, 90, 125, 0.2);
}
.btn-primary:hover {
  background: var(--teal); transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(18, 151, 138, 0.3);
}
.btn-primary:active { transform: translateY(0) scale(0.98); box-shadow: 0 1px 4px rgba(21, 90, 125, 0.15); }
.btn-primary:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

.btn-arrow {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.3s var(--ease);
}
.btn-primary:hover .btn-arrow { transform: translateX(2px); }
.btn-arrow svg { width: 14px; height: 14px; stroke: white; fill: none; }

/* ══════════════════════ CONTACT ══════════════════════ */
#contact { padding-bottom: 60px; }
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 32px; align-items: start; }
.contact-info p { font-size: 0.95rem; color: var(--gray); line-height: 1.6; margin-bottom: 24px; max-width: 65ch; }
.contact-item { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.contact-item svg { width: 18px; height: 18px; stroke: var(--teal); fill: none; flex-shrink: 0; }
.contact-item a, .contact-item span { font-size: 0.9rem; color: var(--gray); text-decoration: none; }
.contact-item a:hover { color: var(--teal); }
.contact-card {
  background: rgba(255, 255, 255, 0.85); border-radius: 20px; padding: 40px;
  box-shadow: var(--shadow-diffuse), inset 0 1px 0 rgba(255,255,255,0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  position: relative; overflow: hidden;
}
.contact-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--teal); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--deep-blue); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 13px 16px; border: 1px solid rgba(21, 90, 125, 0.1);
  border-radius: 10px; font-family: var(--body); font-size: 0.95rem;
  color: var(--black); background: var(--sand); transition: all 0.3s var(--ease);
}
textarea.form-control { resize: vertical; min-height: 88px; }
.form-control:focus {
  outline: none; border-color: var(--teal); background: var(--white);
  box-shadow: 0 0 0 3px rgba(18, 151, 138, 0.06), 0 2px 8px rgba(21, 90, 125, 0.04);
}
.form-control.invalid { border-color: #c0392b; }
.form-error { font-size: 0.78rem; color: #c0392b; margin-top: 4px; display: none; }
.form-control.invalid + .form-error { display: block; }

/* ══════════════════════ DISCLAIMER ══════════════════════ */
.disclaimer {
  text-align: center; padding: 24px 24px 0; font-size: 0.72rem;
  color: var(--gray-light); max-width: 700px; margin: 0 auto; line-height: 1.5;
  border-top: 1px solid var(--border); position: relative; z-index: 1;
}

/* ══════════════════════ FOOTER ══════════════════════ */
footer {
  text-align: center; padding: 40px 24px; color: var(--gray);
  font-size: 0.85rem; border-top: 1px solid var(--border); position: relative; z-index: 1;
}
footer strong { color: var(--deep-blue); }
footer a { color: var(--teal); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-links { margin-top: 12px; display: flex; justify-content: center; gap: 20px; font-size: 0.78rem; }
.footer-links a { color: var(--gray-light); }

/* ══════════════════════ SECTION DIVIDER ══════════════════════ */
.section-divider {
  position: relative; z-index: 1;
  line-height: 0; overflow: hidden;
  padding: 0; margin: 0;
}
.section-divider svg { width: 100%; height: 40px; display: block; }

/* ══════════════════════ IMAGE PLACEHOLDERS ══════════════════════ */
.image-placeholder { position: relative; overflow: hidden; border-radius: 16px; }
.image-placeholder img { width: 100%; height: 100%; object-fit: cover; display: block; }
.placeholder-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(21,90,125,0.08) 0%, rgba(18,151,138,0.05) 100%);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s;
}
.placeholder-active .placeholder-overlay,
.image-placeholder:not(:has(img[src])) .placeholder-overlay { opacity: 1; }
.placeholder-label {
  padding: 8px 16px; border-radius: 8px;
  background: rgba(255,255,255,0.9); backdrop-filter: blur(8px);
  font-size: 0.75rem; font-weight: 600; color: var(--gray);
  letter-spacing: 0.02em;
}

/* ══════════════════════ WHY A RING ══════════════════════ */
.why-ring-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.why-ring-image {
  border-radius: 24px; overflow: hidden; aspect-ratio: 4/3;
  box-shadow: var(--shadow-diffuse);
  border: 1px solid rgba(255,255,255,0.3);
}
.why-ring-image img, .why-ring-image .image-placeholder { width: 100%; height: 100%; }
.why-ring-stats { display: flex; gap: 32px; margin-top: 8px; }
.wr-num {
  font-family: var(--serif); font-size: 2.4rem; font-weight: 700;
  color: var(--teal); line-height: 1; letter-spacing: -0.02em;
}
.wr-label { font-size: 0.82rem; color: var(--gray); margin-top: 4px; }

/* ══════════════════════ TESTIMONIALS ══════════════════════ */
/* Asymmetric layout: featured card (60%) + stacked pair (40%) */
.testimonial-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-top: 40px;
  text-align: left;
}
.testimonial-card {
  background: var(--white); border-radius: 20px; padding: 36px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.testimonial-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.testimonial-card:active { transform: scale(0.99); }
/* Featured card spans full height of left column */
.testimonial-card:first-child {
  grid-row: 1 / 3;
  display: flex; flex-direction: column; justify-content: center;
  border-left: 3px solid var(--teal);
  padding: 44px 40px;
}
.testimonial-card:first-child .testimonial-text {
  font-size: 1.1rem; line-height: 1.7;
}
.quote-mark { position: absolute; top: 24px; right: 24px; width: 36px; height: 28px; opacity: 0.5; }
.testimonial-text {
  font-size: 0.92rem; color: var(--gray); line-height: 1.65;
  margin-bottom: 24px; margin-top: 8px;
  font-family: var(--serif); font-style: italic;
}
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.author-avatar {
  width: 42px; height: 42px; border-radius: 14px;
  background: rgba(18, 151, 138, 0.08);
  border: 1px solid rgba(18, 151, 138, 0.12);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 0.78rem; font-weight: 700;
  color: var(--teal); flex-shrink: 0;
}
.author-name {
  font-family: var(--display); font-size: 0.82rem; font-weight: 600;
  color: var(--deep-blue);
}
.author-role { font-size: 0.72rem; color: var(--gray-light); }

/* ══════════════════════ BROWSER FRAME / DASHBOARD EMBED ══════════════════════ */
.browser-frame {
  background: var(--sand-dark); border-radius: 12px 12px 0 0; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.browser-dots { display: flex; gap: 6px; }
.browser-dots span { width: 10px; height: 10px; border-radius: 50%; }
.browser-dots span:nth-child(1) { background: #E8685D; }
.browser-dots span:nth-child(2) { background: #DEB044; }
.browser-dots span:nth-child(3) { background: #62C554; }
.browser-bar {
  font-size: 0.72rem; color: var(--gray-light);
  background: rgba(255,255,255,0.6); padding: 4px 16px;
  border-radius: 6px; flex: 1; text-align: center;
}
.dashboard-embed {
  background: var(--sand); border-radius: 0 0 12px 12px;
  border: 1px solid var(--border); border-top: none; overflow: hidden;
}
.dashboard-img { width: 100%; display: block; }
.portal-preview {
  max-width: 800px; margin-left: auto; margin-right: auto;
  box-shadow: 0 20px 80px rgba(21,90,125,0.08), 0 4px 24px rgba(21,90,125,0.04);
  border-radius: 12px;
}

/* ══════════════════════ RESPONSIVE ══════════════════════ */
@media (max-width: 900px) {
  section { padding: 80px 0; }
  .contact-layout { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: rgba(244, 241, 237, 0.97); backdrop-filter: blur(16px);
    padding: 16px 24px 24px; gap: 14px; border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: block; }
  .why-ring-layout { grid-template-columns: 1fr; gap: 32px; }
  .why-ring-stats { flex-direction: column; gap: 16px; }
  .testimonial-grid { grid-template-columns: 1fr; }
}
