/* The photo check (plan 0039): the tips dialog, the scan card, the result badges, the notes and the suggestion
   panel. Colours come from the page tokens with fallbacks. Shared by clinic.html and index.html. */

.mira-pc-btn {
  font: inherit;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--blue, #3a8ef6);
  background: #fff;
  color: var(--blue, #3a8ef6);
  cursor: pointer;
}
.mira-pc-btn:hover {
  background: var(--blueS, #e8f1fe);
}
.mira-pc-btn:focus-visible {
  outline: 3px solid var(--blueS, #e8f1fe);
  outline-offset: 2px;
}
.mira-pc-primary {
  background: var(--blue, #3a8ef6);
  color: #fff;
}
.mira-pc-primary:hover {
  background: var(--blueD, #2b6ed9);
}

/* Tips dialog */
.mira-pc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 24, 33, 0.55);
}
.mira-pc-dialog {
  width: min(420px, 100%);
  padding: 22px 22px 18px;
  border-radius: 16px;
  background: #fff;
  color: #1c2230;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.mira-pc-dialog-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
}
.mira-pc-tips {
  margin: 0 0 18px;
  padding-inline-start: 20px;
  line-height: 1.7;
}
.mira-pc-dialog .mira-pc-btn {
  width: 100%;
}

/* Result: badge, message, notes, buttons */
.mira-pc-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #d9dee8;
  background: #fff;
  text-align: start;
}
.mira-pc-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}
.mira-pc-red .mira-pc-badge {
  background: var(--red, #c44536);
}
.mira-pc-amber .mira-pc-badge {
  background: var(--orange, #f0883e);
}
.mira-pc-green .mira-pc-badge {
  background: #2e9e5b;
}
.mira-pc-red {
  border-color: var(--red, #c44536);
}
.mira-pc-amber {
  border-color: var(--orange, #f0883e);
}
.mira-pc-green {
  border-color: #2e9e5b;
}
.mira-pc-msg {
  margin: 10px 0 0;
  line-height: 1.55;
}
.mira-pc-notes {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.mira-pc-note {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--orangeS, #fef3e8);
  font-size: 0.9rem;
  line-height: 1.5;
}
.mira-pc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Angle note (inside a treatment card) */
.mira-pc-angle {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--orangeS, #fef3e8);
  color: #7a3f0b;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Suggestion panel */
.mira-pc-suggest {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--blue, #3a8ef6);
  background: var(--blueS, #e8f1fe);
}
.mira-pc-suggest-title {
  margin: 0;
  font-weight: 700;
}
.mira-pc-suggest-sub {
  margin: 4px 0 10px;
  font-size: 0.9rem;
}
.mira-pc-suggest-error {
  margin: 8px 0 0;
  color: var(--red, #c44536);
  font-size: 0.9rem;
}

/* Scan card */
.mira-scan {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}
.mira-scan-halo {
  position: absolute;
  inset: -14px;
  border-radius: 28px;
  background: radial-gradient(closest-side, var(--blue, #3a8ef6), transparent);
  opacity: 0.18;
  animation: mira-scan-halo 3.8s ease-in-out infinite;
  pointer-events: none;
}
.mira-scan-card {
  position: relative;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(30, 40, 70, 0.14);
}
.mira-scan-photo {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  line-height: 0;
}
.mira-scan-img {
  display: block;
  width: 100%;
  height: auto;
}
.mira-scan-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mira-scan-band {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 18%;
  background: linear-gradient(
    to bottom,
    transparent,
    color-mix(in srgb, var(--blue, #3a8ef6) 18%, transparent),
    transparent
  );
  animation: mira-scan-band 2.8s ease-in-out infinite;
  pointer-events: none;
}
.mira-scan-bar {
  height: 6px;
  margin: 14px 0 10px;
  border-radius: 3px;
  background: #e6eaf2;
  overflow: hidden;
}
.mira-scan-fill {
  width: 0;
  height: 100%;
  background: var(--blue, #3a8ef6);
  transition: width 0.3s ease;
}
.mira-scan-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.mira-scan-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: #7b8497;
}
.mira-scan-step[hidden] {
  display: none;
}
.mira-scan-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #c9cfdc;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.mira-scan-s-active {
  color: #1c2230;
}
.mira-scan-s-active .mira-scan-icon {
  border-color: var(--blue, #3a8ef6);
  border-top-color: transparent;
  animation: mira-scan-spin 0.9s linear infinite;
}
.mira-scan-s-done {
  color: #1c2230;
}
.mira-scan-step.mira-scan-s-done .mira-scan-icon {
  border-color: #2e9e5b;
  background: #2e9e5b;
  color: #fff;
}
.mira-scan-s-failed {
  color: var(--red, #c44536);
}
.mira-scan-step.mira-scan-s-failed .mira-scan-icon {
  border-color: var(--red, #c44536);
  background: var(--red, #c44536);
  color: #fff;
}
.mira-scan-fail {
  flex-basis: 100%;
  font-size: 0.9rem;
}
.mira-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.mira-scan-actions:empty {
  display: none;
}
.mira-scan-footer {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: #7b8497;
}
/* Finished or failed: the band and the halo stop */
div.mira-scan.mira-scan-done .mira-scan-band,
div.mira-scan.mira-scan-done .mira-scan-halo,
div.mira-scan.mira-scan-failed .mira-scan-band,
div.mira-scan.mira-scan-failed .mira-scan-halo {
  animation: none;
  opacity: 0;
}
div.mira-scan.mira-scan-done .mira-scan-footer,
div.mira-scan.mira-scan-failed .mira-scan-footer {
  display: none;
}

/* Part outlines on the marking step */
.mira-parts-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes mira-scan-band {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(560%);
  }
}
@keyframes mira-scan-halo {
  0%,
  100% {
    opacity: 0.12;
  }
  50% {
    opacity: 0.3;
  }
}
@keyframes mira-scan-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mira-scan-band,
  .mira-scan-halo,
  .mira-scan-s-active .mira-scan-icon {
    animation: none;
  }
  .mira-scan-band {
    display: none;
  }
}
.mira-scan-still .mira-scan-band,
.mira-scan-still .mira-scan-halo,
.mira-scan-still .mira-scan-s-active .mira-scan-icon {
  animation: none;
}
.mira-scan-still .mira-scan-band {
  display: none;
}

/* MiraProportions (plan 0047) */
.mira-px {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #e6eaf2;
  border-radius: 14px;
  background: #fff;
  color: #1c2230;
}
.mira-px-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.mira-px-sub {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: #6b7280;
}
.mira-px-status {
  margin: 6px 0;
  color: #1c2230;
}
.mira-px-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.mira-px-table th,
.mira-px-table td {
  padding: 8px 6px;
  border-top: 1px solid #e6eaf2;
  text-align: start;
  vertical-align: top;
}
.mira-px-table thead th {
  border-top: 0;
  font-size: 0.8rem;
  color: #6b7280;
}
.mira-px-measure {
  font-weight: 600;
}
.mira-px-name {
  font: inherit;
  font-weight: 600;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue, #3a8ef6);
  text-align: start;
  cursor: pointer;
  text-decoration: underline;
}
.mira-px-name:focus-visible {
  outline: 3px solid var(--blueS, #e8f1fe);
  outline-offset: 2px;
}
span.mira-px-name {
  cursor: default;
  text-decoration: none;
}
.mira-px-norm {
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 400;
  color: #6b7280;
}
.mira-px-grey {
  color: #6b7280;
}
.mira-px-detail {
  margin-top: 2px;
  font-size: 0.76rem;
}

.mira-px-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 24, 33, 0.55);
}
.mira-px-dialog {
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
  padding: 18px 20px;
  border-radius: 16px;
  background: #fff;
  color: #1c2230;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.mira-px-dialog-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
}
.mira-px-dialog-def {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: #6b7280;
}
.mira-px-canvas {
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  background: #e6eaf2;
}
.mira-px-values {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  font-size: 0.9rem;
}
.mira-px-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.mira-px-toggle-btn {
  flex: 1;
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #d9dee8;
  background: #fff;
  color: #1c2230;
  cursor: pointer;
}
.mira-px-toggle-btn[aria-pressed="true"] {
  border-color: var(--blue, #3a8ef6);
  background: var(--blueS, #e8f1fe);
  color: var(--blue, #3a8ef6);
}
.mira-px-toggle-btn:disabled {
  color: #6b7280;
  background: #e6eaf2;
  cursor: not-allowed;
}
.mira-px-toggle-btn:focus-visible {
  outline: 3px solid var(--blueS, #e8f1fe);
  outline-offset: 2px;
}
.mira-px-close {
  width: 100%;
}
