/* === Base Reset === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

/* === Layout === */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto 3rem auto;
}

/* === Header === */

.top-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #1f2937;
  background: radial-gradient(circle at top left, #1e293b, #020617);
}



/* === Logo badge (true circle) === */
.logo-badge{
  /* 30% larger and nearly touching the ring (not cramped) */
  --logo-badge-size: 125px;
  --logo-inset: 1%;

  width: var(--logo-badge-size);
  height: var(--logo-badge-size);
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Logo image inside the badge (no distortion) */
.logo-badge .lt-logo{
  width: calc(100% - (var(--logo-inset) * 2));
  height: calc(100% - (var(--logo-inset) * 2));
  object-fit: contain;
  display: block;
}

/* Safety net: never allow the logo to overflow its container */
img.lt-logo{
  max-width: 100%;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lt-logo {
  display: block;
  width: auto;
  height: auto;
}

.practice-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.practice-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.practice-provider {
  font-size: 0.85rem;
  color: #9ca3af;
}

.practice-licensure {
  font-size: 0.75rem;
  color: #6b7280;
  max-width: 260px;
}

.header-right {
  text-align: right;
  margin-top: 0.5rem;
}

.header-right h1 {
  margin: 0;
  font-size: 1.3rem;
  color: #e5e7eb;
}

.version-text {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* === Cards and Panels === */

.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1rem 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

/* === Intro === */

.intro-panel {
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.intro-panel h2 {
  margin-bottom: 0.5rem;
}

.intro-panel p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.small-note {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* === Map Layout === */

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* === Partner Controls === */

.partner-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.partner-block {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.partner-label {
  font-size: 0.8rem;
  color: #9ca3af;
}

.partner-name-input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.85rem;
}

.partner-name-input::placeholder {
  color: #6b7280;
}

.partner-active-toggle {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #facc15;
}

/* === Chart Card === */

.chart-card {
  text-align: center;
}

.chart-card canvas {
  max-width: 100%;
}

.chart-caption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* === Buttons === */

.action-buttons {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.primary-btn,
.secondary-btn {
  flex: 1;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.primary-btn {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  color: #052e16;
  font-weight: 600;
}

.secondary-btn {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}

/* === Jump Buttons === */

.jump-card {
  padding-bottom: 0.75rem;
}

.jump-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jump-buttons {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.jump-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
  cursor: pointer;
}

.jump-btn:hover {
  background: #111827;
}

/* === Scores Table (Partners vertical, scores horizontal) === */

.scores-card h2 {
  margin-bottom: 0.3rem;
}

.scores-note {
  margin: 0 0 0.5rem 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

.scores-table-wrapper {
  overflow-x: auto;
}

.scores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.scores-table th,
.scores-table td {
  border: 1px solid #1f2937;
  padding: 0.35rem 0.4rem;
  text-align: center;
}

.scores-table th {
  background: #020617;
  font-weight: 600;
  white-space: nowrap;
}

.scores-table td:first-child,
.scores-table th:first-child {
  text-align: left;
  white-space: nowrap;
}

/* === Intimacy Descriptions (Accordion) === */

.descriptions-card {
  margin-bottom: 2rem;
}

.descriptions-intro {
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.intimacy-block {
  border-radius: 12px;
  border: 1px solid #1f2937;
  margin-bottom: 0.5rem;
  background: #020617;
}

.intimacy-header {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: transparent;
  border: none;
  color: #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.intimacy-header:hover {
  background: #0b1220;
}

.intimacy-title {
  font-size: 0.9rem;
}

.accordion-arrow {
  font-size: 0.8rem;
  color: #94a3b8;
}

.intimacy-content {
  padding: 0.5rem 0.8rem 0.7rem;
  border-top: 1px solid #1f2937;
}

.level-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.4rem;
}

.level-pill {
  padding: 0.4rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.level-pill:hover {
  background: #0b1220;
}

.level-pill.selectedA {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.6);
}

.level-pill.selectedB {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
}

.level-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background: #111827;
  border: 1px solid #374151;
  margin-right: 0.3rem;
  font-size: 0.75rem;
}

/* === Responsive === */

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
  }

  .header-right {
    text-align: left;
    margin-top: 0.5rem;
  }

  .top-header {
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .partner-controls {
    flex-direction: column;
  }

  .jump-buttons {
    gap: 0.25rem;
  }

  .jump-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .scores-table {
    font-size: 0.7rem;
  }
}



/* ===== v4.13 dropdown + cards selector ===== */
.type-selector {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#intimacyTypeSelect {
  width: 100%;
  background: #0b1220;
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.cards-grid .card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.9rem;
  padding: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.cards-grid .card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.card-title { font-weight: 700; font-size: 1rem; color: #f8fafc; margin-bottom: 0.25rem; }
.card-sub { font-size: 0.85rem; color: #aab3c2; }

/* Hide any legacy jump button bar if still present */
.jump-buttons { display: none !important; }

/* ===== Make radar chart reliably visible ===== */
.chart-card {
  min-height: 340px;
}

.chart-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-btn {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #e5e7eb;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.10);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn.is-active {
  border-color: rgba(34,197,94,0.75);
  background: rgba(34,197,94,0.18);
  color: #ffffff;
}
.chart-card canvas {
  width: 100% !important;
  height: 320px !important;
  display: block;
  background: transparent;
}

/* ===== Fix anchor jumping off-screen ===== */
.intimacy-block {
  scroll-margin-top: 130px;
}

@media (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .cards-grid { grid-template-columns: 1fr; }
}


/* ===== Inline area under Choose Intimacy Type ===== */
.inline-area {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(0,0,0,0.25);
}

.inline-header {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: #fff;
}

/* Selected card state */
.jump-btn.card.selected {
  border-color: rgba(99,102,241,0.9);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.35), 0 10px 18px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}


/* Hide original intimacy blocks; inlineArea shows chosen one */
.areas-hidden { display: none !important; }


/* Selected anchor card */
.jump-btn.selected {
  outline: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15), 0 8px 22px rgba(0,0,0,0.5);
}


/* === Privacy / Partner View === */
.is-hidden { display: none !important; }



/* === Visibility safeguard (keeps selector/cards above any full-page overlays) === */
.type-selector,
.cards-grid {
  position: relative;
  z-index: 10000;
}
.cards-grid .card,
.jump-buttons .jump-btn.card {
  position: relative;
  z-index: 10001;
}


/* ==========================================================
  v1.33.2 Secure Login Gate + Overlay Stabilizer (added)
   ========================================================== */

.secure-overlay{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  z-index: 20000;
}

.overlay-card{
  width: min(560px, 92vw);
  background: rgba(20,24,32,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 18px 55px rgba(0,0,0,.55);
}

.brand-title{
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .2px;
}

.brand-subtitle{
  opacity: .8;
  margin-top: 4px;
  font-size: 13px;
}

.tabs{
  margin-top: 14px;
  display: flex;
  gap: 10px;
  padding: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
}

.tab{
  flex: 1;
  border: none;
  background: transparent;
  color: inherit;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  opacity: .8;
}
.tab.is-active{
  background: rgba(255,255,255,.14);
  opacity: 1;
}

.tab-panels{ padding-top: 14px; }
.panel{ display: none; }
.panel.is-active{ display: block; }

.label{
  display: block;
  margin: 6px 0 8px 0;
  font-size: 13px;
  opacity: .85;
}

#pwA, #pwB{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
  color: inherit;
}

.help-row{
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.hint{
  font-size: 12px;
  opacity: .75;
}

.error{
  margin-top: 10px;
  min-height: 18px;
  color: #ffb7b7;
  font-size: 13px;
}

.smallprint{
  margin-top: 10px;
  font-size: 12px;
  opacity: .7;
}

/* Overlay stabilizer: once authenticated, ensure overlay cannot intercept clicks */
.is-authenticated #loginOverlay{
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Ensure app content sits above any lingering overlays */
#appShell{
  position: relative;
  z-index: 1;
}



/* Intro instructions numbering */
.instruction-list{margin:10px 0 0 18px; padding:0;}
.instruction-list li{margin:6px 0;}

/* =====================================================
   FINAL, AUTHORITATIVE LOGO BADGE OVERRIDE
   (This overrides all earlier conflicting rules)
   ===================================================== */

.logo-badge {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

/* Force the logo to be visible and proportional */
.logo-badge > img.lt-logo {
  width: 130% !important;
  height: 130% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  display: block !important;
}
