/* ==========================
   TOKENS
   ========================== */
:root {
  --bg: #ffffff;
  --fg: #000000;
  --border: #000000;
  --radius: 9999px;
  --padY: 12px;
  --padX: 22px;
  --font:
    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --accent: #111111;
  --success: #12b981;
  --error: #b91c1c;

  /* Surface (glass cards) */
  --surface-radius: 20px;
  --surface-bg: rgba(255, 255, 255, 0.9);
  --surface-border: 0px solid rgb(255, 255, 255);
  --surface-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  --surface-blur: 12px;
}

.surface {
  border-radius: var(--surface-radius);
  background: var(--surface-bg);
  border: var(--surface-border);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(var(--surface-blur));
  -webkit-backdrop-filter: blur(var(--surface-blur));
}

/* ==========================
   BASE / RESET
   ========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: var(--font);
  background: transparent;
  color: #0f172a;
}

/* Kun inde i metric-iframe: centrer indhold, ingen ekstra baggrund */
body.metric-body {
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

input[type="file"] {
  display: none;
}

/* ==========================
   OVERLAY: PLASMA
   ========================== */
#plasma {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  filter: blur(10px) saturate(115%);
}

/* Alt andet indhold ovenpå */
body > *:not(#plasma):not(.back-button) {
  position: relative;
  z-index: 1;
}

/* ==========================
   LAYOUT WRAPPERS
   ========================== */
#wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 1rem;
}

.page {
  max-width: 100%;
  margin: 0;
  padding: 2rem 5rem 3rem;
}

/* Ydre wrapper – kun spacing, ingen visuel kasse */
.card {
  position: relative;
  background: transparent;
  border-radius: 0;
  padding: 1.5rem 0;
  border: none;
  box-shadow: none;
  overflow: visible;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  margin-bottom: 1.5rem;
}

/* ==========================
   COMPONENT: UPLOAD
   ========================== */
button.upload {
  all: unset;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: var(--padY) var(--padX);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 14px;
  line-height: 1;
}

button.upload:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.plus {
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
  display: inline-block;
  transition: transform 0.25s ease;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  display: none;
}

.progress {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -2px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  display: none;
}

.progress::before {
  content: "";
  position: absolute;
  left: -40%;
  width: 40%;
  height: 100%;
  background: currentColor;
  opacity: 0.35;
  animation: slide 1.2s infinite ease-in-out;
}

/* Upload states */
.upload.is-loading {
  pointer-events: none;
}

.upload.is-loading .spinner {
  display: inline-block;
  animation: spin 0.9s linear infinite;
}

.upload.is-loading .plus {
  transform: translateY(-1px) rotate(90deg);
  opacity: 0.6;
}

.upload.is-loading .progress {
  display: block;
  color: var(--fg);
}

.upload.is-success {
  border-color: var(--success);
  color: var(--success);
  animation: pop 0.28s ease-out;
}

/* Error box */
.error {
  max-width: 400px;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f6f6f6;
  border: 1px solid #eeeeee;
  border-radius: 12px;
  padding: 10px;
  color: var(--error);
  display: none;
  font-size: 13px;
}

/* ==========================
   ANIMATIONS
   ========================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slide {
  0% {
    left: -40%;
  }

  50% {
    left: 60%;
  }

  100% {
    left: 140%;
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

/* ==========================
   WIDGETS (IFRAMES)
   ========================== */
.widget-iframe {
  width: 100%;
  border: var(--surface-border);
  height: 50vh;

  border-radius: var(--surface-radius);
  background: var(--surface-bg);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: var(--surface-shadow);
  overflow: hidden;
}

.widget-iframe--score {
  height: 25vh;
}

.widget-iframe--metric {
  height: 120px;
}

/* ==========================
   METRICS / CHART LAYOUT
   ========================== */
.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

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

.metrics {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

@media (min-width: 900px) {
  .metrics-grid:has(.card:nth-child(3)) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.metric-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  height: 100%;
  width: 100%;
  margin: 0;
}

.metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.metrics-row {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

/* ==========================
   COMPONENT: BACK BUTTON
   ========================== */
.back-button {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 9999;

  display: block;
  width: 48px;
  height: 48px;

  background-image: url("../img/arrow-left-circle.svg");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;

  cursor: pointer;

  padding: 0;
  border: 0;
  line-height: 0;
  font-size: 0;
}

.back-button:hover {
  background-image: url("../img/arrow-left-circle-filled.svg");
}

/* ==========================
   COMPONENT: CTA SECTION
   ========================== */
.cta-section {
  background: transparent;
  text-align: center;
  padding: 4rem 2rem 6rem;
  margin-top: 4rem;
  position: relative;
}

.cta-bg {
  background: linear-gradient(135deg, #fd297b, #ff655b);
  color: #fff;
  border-radius: 20px;
  padding: 4rem 2rem 0.1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

.cta-content h2 {
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 1rem;
}

.cta-content p {
  font-size: 18px;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.cta-card.floating {
  margin: 0 auto;
  transform: translateY(25%);
  background: #fff;
  border-radius: 18px;
  padding: 2rem;
  max-width: 700px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 5;
}

.cta-card-text h3 {
  font-size: 22px;
  font-weight: 800;
  color: #1a102b;
  margin-bottom: 0.5rem;
}

.cta-card-text p {
  font-size: 16px;
  color: #372c4a;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.cta-link {
  color: #fd297b;
  font-weight: 700;
  text-decoration: none;
}

.cta-link:hover {
  text-decoration: underline;
}

/* ==========================
   INDEX
   ========================== */
/* Homepage layout */
.hero {
  /* layout */
  max-width: 1200px;
  margin: 4rem auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;

  /* surface tweaks (since .hero also has .surface) */
  --surface-radius: 28px;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
  color: #1a102b;
}

.hero-text {
  font-size: 18px;
  margin-top: 1rem;
  line-height: 1.6;
  color: #372c4a;
}

/* Demo preview box */
.demo-frame {
  width: 100%;
  height: 350px;
  background: #1a1a22;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 22px;
  text-align: center;
  padding: 1.5rem;
}

.upload-section {
  text-align: center;
  margin-top: 3rem;
  padding: 3rem 2rem;
  margin: 4rem auto;
  max-width: 1100px;

  /* surface tweaks (since .upload-section also has .surface) */
  --surface-bg: rgba(255, 255, 255, 0.85);
  --surface-blur: 6px;
  --surface-radius: 28px;
}

.upload-title {
  font-size: 22px;
  margin-bottom: 1rem;
  color: #1a102b;
}

.center {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

#wrap {
  min-height: unset;
  display: block;
  text-align: center;
  margin-top: 1rem;
}

/* Info section */
.info-section {
  margin: 4rem auto;
  max-width: 800px;
  text-align: center;
  padding: 2.5rem;

  /* surface tweaks (since .info-section also has .surface) */
  --surface-bg: rgba(255, 240, 246, 0.85);
  --surface-blur: 10px;
  --surface-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.info-section h2 {
  font-size: 28px;
  font-weight: 800;
  color: #1a102b;
  margin-bottom: 1rem;
}

.info-section p {
  font-size: 17px;
  color: #372c4a;
  line-height: 1.7;
}

.info-section strong {
  color: #fd297b;
}

/* ==========================
   DEMO BOKS
   ========================== */

/* Demo preview box */
.demo-frame {
  width: 100%;
  height: 350px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 16px;

  /* fit to edges */
  padding: 0;

  /* lock content inside */
  overflow: hidden;

  display: flex;
}

.demo-preview-img {
  width: 100%;
  height: auto;
  display: block;
}

.demo-scroll-y {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}
/* ---------- Header ---------- */

.yts-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.yts-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yts-logo {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  font-family:
    "Bespoke Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.yts-logo-main {
  font-weight: 700;
  font-size: 2.5rem;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #ec4899, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.yts-logo-dot {
  font-weight: 600;
  font-size: 1.5rem;
  color: #4b5563;
  margin-left: 1px;
}

@media (max-width: 640px) {
  .yts-header-inner {
    padding-inline: 1rem;
  }

  .yts-logo-main {
    font-size: 1.15rem;
  }

  .yts-logo-dot {
    font-size: 0.9rem;
  }
}

/* ==========================
   DELETION KEY
   ========================== */

#deletionKey {
  display: block;
  width: fit-content;
  max-width: 90%;
  margin: 40px auto 10px;

  text-align: center;
  font-size: 12px;
  color: #444;
  /* mørkere tekst for bedre synlighed */

  padding: 8px 14px;

  border: var(--surface-border);
  border-radius: var(--surface-radius);
  background: var(--surface-bg);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: var(--surface-shadow);

  opacity: 1;
  /* fjern fade */
}