/* ==============================================================================
   MedRegia Public Portal — Landing Screen & Hero Styles
   Mobile First Screen, ECG Animations, MediWorld Features & Fixed Bottom CTA Bar
   ============================================================================== */

/* ================= 1. MOBILE LANDING FIRST SCREEN ================= */
#view-landing {
  padding: 24px 20px 32px;
  position: relative;
  overflow: hidden;
}

.landing-hero-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
}

/* Branded ECG Badge */
.landing-ecg-badge {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #04342C 0%, #0B2E2B 100%);
  border: 1px solid rgba(93, 202, 165, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(4, 52, 44, 0.8), 0 0 16px rgba(93, 202, 165, 0.2);
  position: relative;
}

.landing-ecg-badge svg {
  width: 34px;
  height: 34px;
}

.landing-ecg-badge path {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: ecgStroke 2.2s ease-in-out infinite;
}

@keyframes ecgStroke {
  0% {
    stroke-dashoffset: 80;
  }
  50% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -80;
  }
}

/* Category / Portal Tag */
.landing-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 5px 13px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: #38BDF8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Main Hero Heading */
.landing-title {
  font-family: 'Fraunces', serif;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.24;
  color: #F4F7F5;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.landing-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 390px;
  margin: 0 auto 24px;
}

/* Animated ECG Pulse Ribbon */
.landing-pulse-strip {
  width: 100%;
  height: 38px;
  margin-bottom: 22px;
  overflow: hidden;
  opacity: 0.75;
}

.landing-pulse-strip svg {
  width: 100%;
  height: 100%;
}

/* Feature Grid */
.landing-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.landing-feature-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: default;
  user-select: none;
}

.landing-feature-card.token {
  border-left: 3.5px solid #0284C7;
}

.landing-feature-card.zero-wait {
  border-left: 3.5px solid #27AE60;
}

.landing-feature-card.records {
  border-left: 3.5px solid #C98A3B;
}

.feature-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.landing-feature-card.token .feature-icon-box {
  background: rgba(2, 132, 199, 0.16);
  color: #38BDF8;
}

.landing-feature-card.zero-wait .feature-icon-box {
  background: rgba(39, 174, 96, 0.16);
  color: #7DCEA0;
}

.landing-feature-card.records .feature-icon-box {
  background: rgba(201, 138, 59, 0.16);
  color: #E7C696;
}

.feature-text-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.feature-text-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ================= 2. FIXED BOTTOM ACTION BAR ================= */
.landing-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  padding: 12px 18px;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 0.5px solid var(--border-strong);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
}

.btn-landing-cta {
  flex: 1;
  height: 48px;
  background: linear-gradient(135deg, #0F6E56 0%, #16A34A 100%);
  color: #FFFFFF;
  border: 1px solid rgba(93, 202, 165, 0.45);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 4px 18px rgba(15, 110, 86, 0.5);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-landing-cta:hover {
  background: linear-gradient(135deg, #137e63 0%, #18b352 100%);
  box-shadow: 0 6px 22px rgba(15, 110, 86, 0.65);
}

.btn-landing-cta:active {
  transform: scale(0.975);
}

.btn-landing-secondary {
  height: 48px;
  padding: 0 16px;
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-landing-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn-landing-secondary:active {
  transform: scale(0.975);
}

.btn-primary-mobile {
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary-mobile:hover {
  filter: brightness(1.08);
}

.btn-primary-mobile:active {
  transform: scale(0.98);
}

/* ================= 3. DESKTOP VIEWPORT LAYOUT ================= */
@media (min-width: 769px) {
  .desktop-portal {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
  }

  .desktop-portal.is-hidden,
  #desktop-landing.is-hidden,
  body.is-authenticated .desktop-portal,
  body.is-authenticated #desktop-landing {
    display: none !important;
  }

  .panel-left {
    flex: 5 1 0%;
    position: relative;
    overflow: visible;
    order: 1;
    background:
      radial-gradient(circle at 22% 18%, rgba(255,255,255,0.06), transparent 45%),
      linear-gradient(200deg, var(--teal-deep) 0%, #0B2E2B 55%, #081F1D 100%);
  }

  .panel-left .hub-topbar {
    position: absolute !important;
    top: 24px !important;
    right: 32px !important;
    z-index: 20 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
  }

  .panel-left svg.scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
  }

  .hub-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 36px 64px 36px;
    overflow-y: auto;
  }

  .hub-inner {
    max-width: 560px;
    width: 100%;
  }

  .master-logo {
    width: 300px;
    height: auto;
    margin: 0 auto 8px auto;
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
    outline: none;
    object-fit: contain;
  }

  @media (max-width: 960px) {
    .master-logo {
      width: 230px !important;
    }
    .hub-overlay {
      padding: 36px 24px !important;
    }
  }

  .portal-segmented-control, .platform-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3px;
    border-radius: 9999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .panel-left .seg-btn, .seg-btn, .toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    color: #C9D6D0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .panel-left .seg-btn.active.is-public, .seg-btn.active.is-public, .toggle-pill.active.is-public {
    color: #FFFFFF !important;
    background: #0D9488 !important;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.45) !important;
    font-weight: 700 !important;
    border: none !important;
  }

  .panel-left .seg-btn.active.is-business, .seg-btn.active.is-business, .toggle-pill.active.is-business {
    color: #FFFFFF !important;
    background: #C98A3B !important;
    box-shadow: 0 2px 8px rgba(201, 138, 59, 0.45) !important;
    font-weight: 700 !important;
    border: none !important;
  }

  .panel-right {
    flex: 1 1 0%;
    min-width: 380px;
    max-width: 480px;
    background: var(--paper);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 32px 52px 20px 52px;
    position: relative;
    order: 2;
    height: 100vh;
    overflow-y: auto;
  }

  /* When unauthenticated on wide screens, hide the mobile container */
  body:not(.is-authenticated) .mobile-only {
    display: none !important;
  }

  /* When authenticated on wide screens, show patient portal centered */
  body.is-authenticated .app,
  body.is-authenticated #app,
  #app:not(.mobile-only) {
    display: block !important;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  }
}

@media (max-width: 768px) {
  .desktop-portal,
  #desktop-landing {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }

  /* Completely HIDE top segmented switch on mobile (<= 768px) */
  .platform-toggle,
  .portal-segmented,
  .portal-segmented-control,
  .seg-toggle,
  .mobile-toggle-wrapper,
  #segBtnPublic,
  #segBtnBusiness {
    display: none !important;
  }

  /* Master logo on mobile landing matching CMS mobile */
  .master-logo {
    width: 230px !important;
    max-width: 80% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto 14px auto !important;
  }

  /* Feature highlight cards non-clickable and static on mobile */
  .landing-feature-card {
    cursor: default !important;
    transform: none !important;
    pointer-events: none !important;
  }
}

