/* Primeros pasos de las cuentas nuevas: el recorrido guiado que aparece en Fichas después de la bienvenida legal.
   Todo queda acotado a .first-steps (cada parte lleva su clase fs-*). Sin :root y sin selectores globales. */
.first-steps, .first-steps *, .first-steps *::before, .first-steps *::after { box-sizing: border-box; }
.first-steps {
  --fs-ink: #1f2a44; --fs-soft: #55627d; --fs-line: #d9e2f1; --fs-blue: #3e46e0; --fs-green: #12924f; --fs-green-soft: #e4f6ec;
  --fs-grad: linear-gradient(155deg, #168cf5 0%, #4036df 56%, #7438df 100%);
  --fs-orange: linear-gradient(135deg, #f07e00, #f69a09 56%, #efa817);
  container-type: inline-size; margin: 0 0 16px; color: var(--fs-ink); font-family: 'Burotec Sans', Inter, system-ui, sans-serif;
}
.first-steps[hidden] { display: none !important; }
.first-steps .app-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.first-steps button:focus-visible, .first-steps a:focus-visible { outline: 3px solid #7fb4ff; outline-offset: 2px; }

.first-steps .fs-card { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); overflow: hidden; border: 1px solid #d5ddf0; border-radius: 20px; background: #fff; box-shadow: 0 12px 30px rgba(40, 48, 120, .10); }

/* ---------- Carril de la marca: título, progreso y estaciones ---------- */
.first-steps .fs-rail { position: relative; display: grid; align-content: start; gap: 18px; padding: 22px 22px 18px; background: var(--fs-grad); color: #fff; }
.first-steps .fs-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #d7e6ff; }
.first-steps .fs-rail h2 { margin: 4px 0 0; font-size: 22px; line-height: 1.15; font-weight: 900; letter-spacing: -.02em; text-wrap: balance; }
.first-steps .fs-meter { display: grid; gap: 8px; }
.first-steps .fs-meter-label { display: flex; align-items: baseline; gap: 6px; margin: 0; font-size: 14px; font-weight: 700; color: #e4e9ff; }
.first-steps .fs-meter-label b { font-size: 22px; font-weight: 900; color: #fff; }
.first-steps .fs-meter-bar { display: grid; grid-template-columns: repeat(var(--fs-total, 4), minmax(0, 1fr)); gap: 5px; }
.first-steps .fs-meter-bar i { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .26); }
.first-steps .fs-meter-bar i.is-on { background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 0 12px rgba(160, 230, 255, .7); }

.first-steps .fs-track { position: relative; display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.first-steps .fs-stop { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 50px; }
.first-steps .fs-stop:not(:last-child)::after { content: ''; position: absolute; left: 18px; top: 42px; bottom: -6px; width: 2px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.first-steps .fs-stop.is-done:not(:last-child)::after { background: #fff; }
.first-steps .fs-dot { position: relative; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .55); color: #fff; }
.first-steps .fs-dot .app-icon { width: 18px; height: 18px; }
.first-steps .fs-stop.is-done .fs-dot { border: 0; background: #fff; color: var(--fs-green); box-shadow: 0 4px 12px rgba(10, 20, 80, .25); }
.first-steps .fs-stop.is-done .fs-dot .app-icon { stroke-width: 3; }
.first-steps .fs-stop.is-current .fs-dot { border: 2px solid #fff; background: rgba(255, 255, 255, .22); }
.first-steps .fs-stop.is-current .fs-dot::before { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); animation: fs-pulse 2.2s ease-out infinite; }
.first-steps .fs-stop.is-waiting .fs-dot { border-style: solid; border-color: rgba(255, 255, 255, .7); }
.first-steps .fs-stop-text { display: grid; min-width: 0; }
.first-steps .fs-stop-text b { font-size: 15px; font-weight: 800; line-height: 1.2; }
.first-steps .fs-stop-text small { font-size: 13px; font-weight: 700; color: #d7e0ff; }
.first-steps .fs-stop.is-done .fs-stop-text small { color: #b8f5d2; }
.first-steps .fs-stop:not(.is-done):not(.is-current) .fs-stop-text b { color: #e2e6ff; }

.first-steps .fs-hide { justify-self: start; min-height: 40px; padding: 8px 2px; border: 0; background: transparent; color: #e4e9ff; font: 700 14px 'Burotec Sans', sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.first-steps .fs-hide:hover { color: #fff; }

/* ---------- Objetivo actual ---------- */
.first-steps .fs-goal { display: grid; align-content: start; gap: 14px; min-width: 0; padding: 24px clamp(18px, 3.4cqw, 34px) 24px; }
.first-steps .fs-ribbon { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--fs-green-soft); color: #0d6b3a; font-size: 15px; font-weight: 800; }
.first-steps .fs-ribbon span { display: grid; width: 28px; height: 28px; flex: none; place-items: center; border-radius: 50%; background: var(--fs-green); color: #fff; animation: fs-pop .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.first-steps .fs-ribbon span .app-icon { width: 16px; height: 16px; stroke-width: 3; }
.first-steps .fs-step { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--fs-blue); }
.first-steps .fs-goal h3 { margin: -6px 0 0; font-size: clamp(22px, 3.2cqw, 28px); line-height: 1.15; font-weight: 900; letter-spacing: -.025em; text-wrap: balance; }
.first-steps .fs-lead { max-width: 62ch; margin: 0; color: var(--fs-soft); font-size: 16px; line-height: 1.5; }

.first-steps .fs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.first-steps .fs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 20px; border: 0; border-radius: 13px; background: linear-gradient(135deg, #287ff0, #4a40e6 55%, #7135d6); color: #fff; font: 800 16px 'Burotec Sans', sans-serif; cursor: pointer; box-shadow: 0 8px 18px rgba(74, 64, 230, .22); transition: transform .15s ease, box-shadow .15s ease; }
.first-steps .fs-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 22px rgba(74, 64, 230, .28); }
.first-steps .fs-btn--orange { background: var(--fs-orange); box-shadow: 0 8px 18px rgba(242, 137, 0, .26); }
.first-steps .fs-btn--orange:hover { box-shadow: 0 11px 22px rgba(242, 137, 0, .32); }
.first-steps .fs-btn--soft { background: #eceeff; color: #2f36b8; box-shadow: none; }
.first-steps .fs-btn--soft:hover { box-shadow: none; background: #e2e5ff; }
.first-steps .fs-link { min-height: 44px; padding: 8px 4px; border: 0; background: transparent; color: #45536f; font: 800 15px 'Burotec Sans', sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Paso 1: el lugar vacío donde aparece la primera ficha */
.first-steps .fs-slot { display: flex; align-items: center; gap: 14px; max-width: 520px; padding: 14px 16px; border: 2px dashed #c6d0ea; border-radius: 16px; background: #f7f9ff; }
.first-steps .fs-slot-avatar { display: grid; width: 46px; height: 46px; flex: none; place-items: center; border-radius: 50%; background: #e6e9ff; color: var(--fs-blue); }
.first-steps .fs-slot-avatar .app-icon { width: 22px; height: 22px; }
.first-steps .fs-slot-lines { display: grid; gap: 7px; flex: 1; }
.first-steps .fs-slot-lines i { display: block; height: 10px; border-radius: 99px; background: #e0e6f5; }
.first-steps .fs-slot-lines i:first-child { width: 58%; }
.first-steps .fs-slot-lines i:last-child { width: 36%; }
.first-steps .fs-slot-count { flex: none; font-size: 14px; font-weight: 800; color: var(--fs-soft); }

/* Paso 2: la bifurcación */
.first-steps .fs-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 760px; }
.first-steps .fs-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start; min-height: 100%; padding: 16px 18px; border: 2px solid #d4dcf0; border-radius: 16px; background: #fff; color: var(--fs-ink); text-align: left; font-family: 'Burotec Sans', sans-serif; cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.first-steps .fs-choice:hover { border-color: #8f97f0; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(62, 70, 224, .12); }
.first-steps .fs-choice > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: #eceeff; color: var(--fs-blue); grid-row: span 2; }
.first-steps .fs-choice.is-yes { border-color: #8f97f0; background: #f7f7ff; }
.first-steps .fs-choice.is-yes > span { background: linear-gradient(135deg, #287ff0, #4a40e6 55%, #7135d6); color: #fff; }
.first-steps .fs-choice b { font-size: 17px; font-weight: 900; line-height: 1.25; }
.first-steps .fs-choice small { color: var(--fs-soft); font-size: 14px; font-weight: 600; line-height: 1.4; }
.first-steps .fs-found { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; max-width: 760px; padding: 12px 14px; border-radius: 14px; background: #f2f4ff; }
.first-steps .fs-found > span { font-size: 14px; font-weight: 800; }
.first-steps .fs-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid #c9cff7; border-radius: 999px; background: #fff; color: #2f36b8; font: 800 14px 'Burotec Sans', sans-serif; cursor: pointer; }
.first-steps .fs-chip:hover { border-color: #4a40e6; }
.first-steps .fs-chip .app-icon { width: 16px; height: 16px; }

/* Pasos 3 y 4: la semana dibujada con los días reales */
.first-steps .fs-week { display: grid; grid-template-columns: repeat(7, minmax(36px, 52px)); gap: 8px; }
.first-steps .fs-day { display: grid; place-items: center; gap: 2px; min-height: 54px; padding: 6px 2px; border: 2px dashed #ccd5ea; border-radius: 13px; background: #fafbff; color: #66728c; }
.first-steps .fs-day b { font-size: 16px; font-weight: 900; }
.first-steps .fs-day small { font-size: 12px; font-weight: 700; }
.first-steps .fs-day.is-on { border: 0; background: linear-gradient(160deg, #3c7ff1, #4a40e6); color: #fff; box-shadow: 0 6px 14px rgba(74, 64, 230, .22); }
.first-steps .fs-patient { display: inline-flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; padding: 8px 16px 8px 8px; border: 1px solid var(--fs-line); border-radius: 999px; background: #fff; box-shadow: 0 4px 12px rgba(47, 73, 113, .07); }
.first-steps .fs-patient > span { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border-radius: 50%; background: #e6e9ff; color: #2f36b8; font-size: 14px; font-weight: 900; }
.first-steps .fs-patient b { overflow-wrap: anywhere; font-size: 16px; font-weight: 800; }
.first-steps .fs-waiting { display: flex; align-items: flex-start; gap: 12px; max-width: 620px; padding: 12px 14px; border: 1px solid #cfdcf3; border-radius: 14px; background: #f3f7ff; color: #24406e; font-size: 15px; line-height: 1.45; }
.first-steps .fs-waiting .app-icon { margin-top: 1px; color: var(--fs-blue); }

/* ---------- Logro: el consultorio en marcha y el siguiente objetivo ---------- */
.first-steps.is-complete .fs-rail { background: linear-gradient(155deg, #0f9a63 0%, #1d8f8a 50%, #4036df 100%); }
.first-steps .fs-trophy { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 18px; background: var(--fs-green-soft); color: var(--fs-green); animation: fs-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.first-steps .fs-trophy .app-icon { width: 30px; height: 30px; }
.first-steps .fs-trophy.is-still { animation: none; }
.first-steps .fs-error { margin: 0; color: #b42318; font-size: 14px; font-weight: 700; }
.first-steps .fs-wins {display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.first-steps .fs-wins li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--fs-green-soft); color: #0d6b3a; font-size: 14px; font-weight: 800; }
.first-steps .fs-wins .app-icon { width: 16px; height: 16px; stroke-width: 3; }
.first-steps .fs-next { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; max-width: 640px; padding: 16px 18px; border: 1px solid #d3daf3; border-radius: 16px; background: #f8f9ff; }
.first-steps .fs-next > span { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; background: #eceeff; color: var(--fs-blue); grid-row: span 2; }
.first-steps .fs-next small { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--fs-blue); }
.first-steps .fs-next b { font-size: 17px; font-weight: 900; }
.first-steps .fs-next p { grid-column: 2; margin: 0; color: var(--fs-soft); font-size: 15px; line-height: 1.45; }
.first-steps .fs-next .fs-actions { grid-column: 2; margin-top: 6px; }

/* ---------- Modo enfoque: mientras el recorrido está en curso, Fichas muestra sólo la barra superior y el recorrido ---------- */
#dashboardView.first-steps-focus > :not(.dashboard-body):not(dialog),
#dashboardView.first-steps-focus > .dashboard-body > :not(#firstStepsHost) { display: none !important; }
#dashboardView.first-steps-focus > .dashboard-body { display: grid; align-content: start; width: min(100% - 32px, 1120px); min-height: calc(100vh - 64px); padding: clamp(20px, 5vh, 56px) 0 clamp(28px, 6vh, 64px); }
#dashboardView.first-steps-focus .first-steps { width: 100%; margin: 0; }
#dashboardView.first-steps-focus .first-steps .fs-card { min-height: clamp(380px, 56vh, 600px); box-shadow: 0 18px 44px rgba(40, 48, 120, .14); }
#dashboardView.first-steps-focus .first-steps .fs-rail { padding: 28px 26px 22px; }
#dashboardView.first-steps-focus .first-steps .fs-goal { align-content: center; gap: 18px; padding: clamp(24px, 4cqw, 44px); }

/* ---------- Tablet angosta y teléfono: el carril pasa arriba y las estaciones quedan en fila ---------- */
@container (max-width: 760px) {
  .first-steps .fs-card { grid-template-columns: minmax(0, 1fr); }
  .first-steps .fs-rail { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px 12px; padding: 18px 18px 16px; }
  .first-steps .fs-rail h2 { font-size: 20px; }
  .first-steps .fs-meter { grid-column: 1 / -1; }
  .first-steps .fs-hide { grid-row: 1; grid-column: 2; align-self: start; min-height: 36px; padding-top: 0; }
  .first-steps .fs-track { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .first-steps .fs-stop { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 6px; min-height: 0; text-align: center; }
  .first-steps .fs-stop:not(:last-child)::after { left: calc(50% + 24px); right: calc(-50% + 24px); top: 18px; bottom: auto; width: auto; height: 2px; }
  .first-steps .fs-stop-text small { display: none; }
  .first-steps .fs-stop-text b { font-size: 13px; }
  .first-steps .fs-goal { padding: 20px 18px 22px; }
}
@container (max-width: 560px) {
  .first-steps .fs-choices { grid-template-columns: minmax(0, 1fr); }
  .first-steps .fs-actions > .fs-btn { flex: 1 1 100%; }
  .first-steps .fs-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
  .first-steps .fs-day { min-height: 50px; border-radius: 11px; }
  .first-steps .fs-slot-count { display: none; }
}

@keyframes fs-pulse { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes fs-pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .first-steps .fs-stop.is-current .fs-dot::before, .first-steps .fs-ribbon span, .first-steps .fs-trophy { animation: none; }
  .first-steps .fs-btn, .first-steps .fs-choice { transition: none; }
}
