/*
  Wireframe-styling for oejemaals-oevelsen.
  Bevidst uden brandfarver og uden font-valg: layout, struktur og
  komponentadfaerd. Farver og typografi arves fra Umbraco/SDCC-ressourcer.
  Alt er scopet under .vfd-content med vfd-prefiks.
*/

.vfd-content {
  box-sizing: border-box;
  --vfd-radius-sm: 3px;
  --vfd-radius-md: 3px;
  --vfd-radius-lg: 3px;
  --vfd-control-radius: 3px;
  --vfd-surface: #ffffff;
  --vfd-surface-strong: #f3f3f3;
  --vfd-border: rgb(0 0 0 / 22%);
  --vfd-border-strong: rgb(0 0 0 / 32%);
  --vfd-accent: rgb(0 0 0 / 6%);
  --vfd-accent-hover: rgb(0 0 0 / 10%);
  --vfd-accent-text: inherit;
}

.vfd-content *,
.vfd-content *::before,
.vfd-content *::after {
  box-sizing: inherit;
}

.vfd-content .vfd-exercise {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 3px;
}

/* Medieblok med billede + badge */
.vfd-content .vfd-media {
  position: relative;
  width: 100%;
  overflow: visible;
  border-radius: var(--vfd-radius-lg);
  display: flex;
  justify-content: center;
}

.vfd-content .img {
  isolation: isolate;
}

.vfd-content .vfd-media-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.vfd-content .vfd-media-title {
  position: absolute;
  top: 12px;
  left: 12px;
  margin: 0;
  padding: 8px 12px;
  max-width: calc(100% - 72px);
  border-radius: var(--vfd-radius-md);
  background: rgb(255 255 255 / 90%);
  box-shadow: 0 2px 8px rgb(0 0 0 / 14%);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  line-height: 1.2;
}

.vfd-content .vfd-media-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed currentColor;
  border-radius: var(--vfd-radius-lg);
  opacity: 0.65;
}

.vfd-content .vfd-media-action {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(0 0 0 / 20%);
  border-radius: 3px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.vfd-content .vfd-media-action:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

/* Kort med spoergsmaal og glidere */
.vfd-content .vfd-card {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin-top: -34px;
  padding: 22px 20px;
  border: 1px solid var(--vfd-border);
  border-radius: var(--vfd-radius-lg);
  background: var(--vfd-surface);
  box-shadow: 0 4px 14px rgb(0 0 0 / 8%);
}

.vfd-content .vfd-question {
  margin: 0;
  text-align: center;
}

.vfd-content .vfd-question-meta {
  margin: -14px 0 2px;
  text-align: center;
  opacity: 0.8;
}

.vfd-content .vfd-v2-action-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -8px 0 2px;
}

.vfd-content .vfd-calculator-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  padding: 10px 14px;
  margin: 0;
  border: 1px solid var(--vfd-border);
  border-radius: var(--vfd-control-radius);
  background: var(--vfd-surface-strong);
  cursor: pointer;
}

.vfd-content .vfd-formula-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 10px 14px;
  margin: 0;
  border: 1px solid var(--vfd-border);
  border-radius: var(--vfd-control-radius);
  background: var(--vfd-surface-strong);
  cursor: pointer;
}

.vfd-content .vfd-calculator-trigger:hover,
.vfd-content .vfd-formula-trigger:hover {
  border-color: var(--vfd-border-strong);
  background: #ececec;
}

.vfd-content .vfd-calculator-trigger:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.vfd-content .vfd-formula-trigger:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.vfd-content .vfd-calculator-trigger-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
}

.vfd-content .vfd-calculator-trigger-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

/* Glidergrupper */
.vfd-content .vfd-slider-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vfd-content .vfd-slider-group.is-inactive {
  display: none;
}

.vfd-content .vfd-slider-wrap {
  position: relative;
  padding-top: 46px;
}

.vfd-content .vfd-slider-bubble {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(calc(-50% + var(--vfd-float-shift, 0px)));
  padding: 6px 14px;
  border-radius: 3px;
  background: rgb(0 0 0 / 5%);
  box-shadow: 0 2px 6px rgb(0 0 0 / 12%);
  white-space: nowrap;
  pointer-events: none;
}

/* Full-width slider */
.vfd-content .vfd-slider {
  --vfd-slider-thumb-size: 28px;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  margin: 0;
  border-radius: 3px;
  background: rgb(0 0 0 / 12%);
  cursor: pointer;
}

.vfd-content .vfd-slider:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.vfd-content .vfd-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--vfd-slider-thumb-size);
  height: var(--vfd-slider-thumb-size);
  border: 2px solid rgb(0 0 0 / 15%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
  cursor: pointer;
}

.vfd-content .vfd-slider::-moz-range-thumb {
  width: var(--vfd-slider-thumb-size);
  height: var(--vfd-slider-thumb-size);
  border: 2px solid rgb(0 0 0 / 15%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
  cursor: pointer;
}

.vfd-content .vfd-slider::-moz-range-track {
  height: 10px;
  border-radius: 3px;
  background: rgb(0 0 0 / 12%);
}

.vfd-content .vfd-slider:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

.vfd-content .vfd-slider-markers {
  position: absolute;
  left: 0;
  right: 0;
  top: 54px;
  height: 0;
  pointer-events: none;
}

.vfd-content .vfd-slider-marker {
  position: absolute;
  transform: translateX(calc(-50% + var(--vfd-float-shift, 0px)));
  white-space: nowrap;
  padding: 4px 10px;
  border: 2px solid transparent;
  border-radius: 3px;
  font-size: clamp(14px, 1.6vw, 18px);
  text-decoration: none;
  font-weight: 700;
  line-height: 1;
  z-index: 2;
}

.vfd-content .vfd-slider-marker::before {
  content: "";
  position: absolute;
  left: calc(50% - var(--vfd-float-shift, 0px));
  transform: translateX(-50%);
  width: 0;
  height: 0;
}

.vfd-content .vfd-slider-marker-correct {
  top: 18px;
  background: rgb(47 121 74 / 16%);
  border-color: rgb(47 121 74 / 42%);
}

.vfd-content .vfd-slider-marker-correct::before {
  top: -12px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 12px solid rgb(47 121 74 / 42%);
}

/* Skala under slideren */
.vfd-content .vfd-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.vfd-content .vfd-scale-tick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 36px;
  text-align: center;
  line-height: 1.25;
  opacity: 0.7;
}

.vfd-content .vfd-scale-mark {
  width: 1px;
  height: 8px;
  background: currentColor;
  opacity: 0.5;
}

.vfd-content .vfd-error-text {
  margin: 0;
  text-align: center;
  opacity: 0.75;
}

/* Handlingsknap */
.vfd-content .vfd-cta {
  width: 100%;
  padding: 18px 24px;
  border: 1px solid var(--vfd-border-strong);
  border-radius: var(--vfd-control-radius);
  background: var(--vfd-accent);
  color: var(--vfd-accent-text);
  cursor: pointer;
}

.vfd-content .vfd-cta:hover {
  background: var(--vfd-accent-hover);
}

.vfd-content .vfd-cta:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.vfd-content .vfd-cta:disabled {
  cursor: default;
  opacity: 0.55;
}

.vfd-content .vfd-cta-secondary {
  margin-top: 8px;
  border: 1px solid var(--vfd-border-strong);
  background: var(--vfd-surface);
  color: inherit;
}

/* Progress */
.vfd-content .vfd-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.vfd-content .vfd-progress-dots {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vfd-content .vfd-progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgb(0 0 0 / 18%);
}

.vfd-content .vfd-progress-dot.is-done {
  background: rgb(0 0 0 / 45%);
}

.vfd-content .vfd-progress-dot.is-active {
  box-shadow: 0 0 0 4px rgb(0 0 0 / 10%);
  background: rgb(0 0 0 / 65%);
}

.vfd-content .vfd-progress-label {
  margin: 0;
  text-align: center;
  opacity: 0.75;
}

/* Varedeklaration modal */
.vfd-content .vfd-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgb(0 0 0 / 45%);
  z-index: 999;
}

.vfd-content .vfd-modal[hidden] {
  display: none;
}

.vfd-content .vfd-modal-dialog {
  width: min(100%, 460px);
  max-height: min(86vh, 640px);
  overflow: auto;
  border-radius: 3px;
  background: #fff;
  border: 1px solid rgb(0 0 0 / 12%);
  box-shadow: 0 16px 40px rgb(0 0 0 / 25%);
  padding: 14px;
}

.vfd-content .vfd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vfd-content .vfd-modal-title,
.vfd-content .vfd-modal-subtitle {
  margin: 0;
}

.vfd-content .vfd-modal-subtitle {
  margin-top: 6px;
  opacity: 0.8;
}

.vfd-content .vfd-modal-close {
  border: 1px solid var(--vfd-border);
  border-radius: var(--vfd-control-radius);
  background: var(--vfd-surface);
  padding: 7px 12px;
  cursor: pointer;
}

.vfd-content .vfd-modal-close:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

.vfd-content .vfd-modal-table-wrap {
  margin-top: 12px;
}

.vfd-content .vfd-modal-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgb(0 0 0 / 12%);
  border-radius: 3px;
  overflow: hidden;
}

.vfd-content .vfd-modal-table th,
.vfd-content .vfd-modal-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgb(0 0 0 / 9%);
}

.vfd-content .vfd-modal-table tbody tr:last-child th,
.vfd-content .vfd-modal-table tbody tr:last-child td {
  border-bottom: 0;
}

.vfd-content .vfd-modal-table th {
  width: 60%;
  font-weight: 600;
  background: rgb(0 0 0 / 2%);
}

.vfd-content .vfd-modal-table td {
  white-space: nowrap;
}

/* Mobil-first er standard ovenfor. Fra tablet gives lidt mere luft. */
@media (min-width: 768px) {
  .vfd-content .vfd-exercise {
    padding: 20px;
  }

  .vfd-content .vfd-card {
    padding: 28px 26px;
  }

  .vfd-content .vfd-modal-dialog {
    padding: 18px;
  }
}

.vfd-content .vfd-exercise-funnel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vfd-content .vfd-funnel-media {
  margin-bottom: 0;
}

.vfd-content .vfd-funnel-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--vfd-border);
  background: var(--vfd-surface);
}

.vfd-content .vfd-funnel-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vfd-content .vfd-funnel-caption {
  margin: 0;
}

.vfd-content .vfd-funnel-ingredient-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.vfd-content .vfd-funnel-ingredient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: 1px solid var(--vfd-border);
  background: var(--vfd-surface);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.vfd-content .vfd-funnel-ingredient-row.is-active {
  border-color: var(--vfd-border-strong);
  background: var(--vfd-accent);
}

.vfd-content .vfd-funnel-ingredient-row.is-confirmed {
  background: var(--vfd-surface-strong);
}

.vfd-content .vfd-funnel-ingredient-name {
  font-weight: 600;
}

.vfd-content .vfd-funnel-ingredient-status {
  font-size: 0.95rem;
}

.vfd-content .vfd-funnel-work {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--vfd-border);
  padding: 14px;
  background: #fff;
}

.vfd-content .vfd-funnel-work.is-showing-correct {
  border-color: #1f7a46;
  background: #f4fbf6;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 70, 0.18);
}

.vfd-content .vfd-funnel-correct-flag {
  align-self: flex-start;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid #1f7a46;
  background: #e8f6ec;
  color: #195f37;
  font-weight: 600;
  font-size: 0.9rem;
}

.vfd-content .vfd-funnel-active-title {
  margin: 0;
}

.vfd-content .vfd-funnel-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vfd-content .vfd-funnel-step-title {
  margin: 0;
  font-weight: 600;
}

.vfd-content .vfd-funnel-choice-row {
  display: flex;
  gap: 12px;
}

.vfd-content .vfd-funnel-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vfd-content .vfd-funnel-slider {
  width: 100%;
}

.vfd-content .vfd-funnel-step-value,
.vfd-content .vfd-funnel-formula,
.vfd-content .vfd-funnel-total {
  margin: 0;
}

.vfd-content .vfd-funnel-v2-action-row {
  display: flex;
  justify-content: flex-start;
}

.vfd-content .vfd-funnel-input-label {
  font-weight: 600;
}

.vfd-content .vfd-funnel-number-input {
  width: 100%;
  max-width: 220px;
  border: 1px solid var(--vfd-border);
  padding: 8px 10px;
  background: var(--vfd-surface);
}

.vfd-content .vfd-funnel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vfd-content .vfd-funnel-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--vfd-border);
  padding-top: 12px;
}

.vfd-content .vfd-funnel-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vfd-content .vfd-funnel-summary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--vfd-border);
  padding: 8px 10px;
}

.vfd-content .vfd-funnel-summary-edit {
  border: 1px solid var(--vfd-border);
  background: var(--vfd-surface);
  padding: 4px 8px;
  cursor: pointer;
}

@media (min-width: 768px) {
  .vfd-content .vfd-funnel-panel {
    padding: 20px;
  }

  .vfd-content .vfd-funnel-ingredient-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .vfd-content .vfd-funnel-actions {
    flex-direction: row;
  }

  .vfd-content .vfd-funnel-actions .vfd-cta {
    width: auto;
  }
}

.vfd-calculator-popup {
  --vfd-border: rgb(0 0 0 / 22%);
  --vfd-control-radius: 3px;
  --vfd-surface: #fff;
  position: fixed;
  top: 96px;
  right: 12px;
  width: min(92vw, 374px);
  height: min(84vh, 440px);
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  border: 1px solid rgb(0 0 0 / 16%);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 18px 40px rgb(0 0 0 / 24%);
  z-index: 1100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.vfd-calculator-popup[hidden] {
  display: none;
}

.vfd-calculator-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgb(0 0 0 / 10%);
  background: rgb(245 245 245 / 96%);
  cursor: move;
  touch-action: none;
}

.vfd-calculator-popup-title {
  margin: 0;
}

.vfd-calculator-popup-close {
  border: 1px solid var(--vfd-border);
  border-radius: var(--vfd-control-radius);
  background: var(--vfd-surface);
  padding: 6px 10px;
  cursor: pointer;
}

.vfd-calculator-popup-close:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

.vfd-calculator-popup-body {
  width: 100%;
  flex: 1;
  min-height: 0;
}

.vfd-calculator-popup-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.vfd-formula-popup {
  --vfd-border: rgb(0 0 0 / 22%);
  --vfd-control-radius: 3px;
  --vfd-surface: #fff;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgb(0 0 0 / 45%);
  z-index: 1150;
}

.vfd-formula-popup[hidden] {
  display: none;
}

.vfd-formula-popup-dialog {
  width: min(100%, 760px);
  border-radius: 3px;
  border: 1px solid rgb(0 0 0 / 12%);
  background: #fff;
  box-shadow: 0 16px 40px rgb(0 0 0 / 25%);
  padding: 12px;
}

.vfd-formula-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vfd-formula-popup-title {
  margin: 0;
}

.vfd-formula-popup-close {
  border: 1px solid var(--vfd-border);
  border-radius: var(--vfd-control-radius);
  background: var(--vfd-surface);
  padding: 6px 10px;
  cursor: pointer;
}

.vfd-formula-popup-close:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

.vfd-formula-popup-image {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
}
