:root {
  color-scheme: dark;

  --background: #07111f;
  --panel: #0d1b2a;
  --panel-soft: #12243a;
  --border: #20364f;

  --text: #f4f7fb;
  --muted: #91a4ba;

  --accent: #39d98a;
  --accent-text: #04130c;

  --warning: #f7c948;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background:
    radial-gradient(
      circle at top,
      #102640 0,
      var(--background) 48%
    );

  color: var(--text);
}

.lab-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 24px;
}

.brand {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-badge {
  padding: 8px 13px;
  border-radius: 999px;

  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-checking {
  background: rgba(247, 201, 72, 0.15);
  color: var(--warning);
}

.status-running {
  background: rgba(57, 217, 138, 0.14);
  color: var(--accent);
}

.status-ended {
  background: rgba(255, 107, 107, 0.14);
  color: var(--danger);
}

.lab-card {
  padding: 34px;

  background: rgba(13, 27, 42, 0.94);

  border: 1px solid var(--border);
  border-radius: 18px;

  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.28);
}

.lab-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.eyebrow {
  margin-bottom: 10px;

  color: var(--accent);

  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

h1 {
  margin: 0;

  font-size:
    clamp(1.8rem, 4vw, 2.8rem);
}

#labMessage {
  max-width: 650px;

  margin: 14px 0 0;

  color: var(--muted);
  line-height: 1.6;
}

.timer-panel {
  min-width: 190px;

  padding: 18px;

  background: var(--panel-soft);

  border: 1px solid var(--border);
  border-radius: 14px;

  text-align: center;
}

.timer-label {
  display: block;

  margin-bottom: 7px;

  color: var(--muted);

  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

#timer {
  font-size: 1.55rem;
}

.lab-details {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 14px;

  margin-top: 32px;
}

.detail {
  padding: 17px;

  background: var(--panel-soft);

  border: 1px solid var(--border);
  border-radius: 12px;
}

.detail span {
  display: block;

  margin-bottom: 7px;

  color: var(--muted);
  font-size: 0.75rem;
}

.detail strong {
  word-break: break-word;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;

  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 46px;

  padding: 0 22px;

  border-radius: 10px;

  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.button-primary:hover {
  filter: brightness(1.08);
}

.ended-note {
  margin: 0;
  color: var(--muted);
}

.lab-footer {
  margin-top: 20px;

  color: var(--muted);

  font-size: 0.78rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {

  .lab-shell {
    width: min(100% - 20px, 1100px);
    padding: 20px 0;
  }

  .lab-card {
    padding: 22px;
  }

  .lab-card-heading {
    flex-direction: column;
  }

  .timer-panel {
    width: 100%;
  }

  .lab-details {
    grid-template-columns: 1fr;
  }
}


/* --------------------------------------------------
   Lab provisioning
-------------------------------------------------- */

.provisioning-steps {
  display: grid;
  gap: 12px;

  margin-top: 32px;
}

.provision-step {
  display: flex;
  align-items: center;
  gap: 16px;

  padding: 17px 18px;

  background: var(--panel-soft);

  border: 1px solid var(--border);
  border-radius: 12px;

  opacity: 0.55;
}

.provision-step.complete,
.provision-step.active {
  opacity: 1;
}

.provision-step.complete {
  border-color:
    rgba(57, 217, 138, 0.35);
}

.provision-step.active {
  border-color:
    rgba(247, 201, 72, 0.45);
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 34px;

  width: 34px;
  height: 34px;

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.05);

  font-weight: 900;
}

.provision-step.complete
.step-indicator {
  color: var(--accent);

  background:
    rgba(57, 217, 138, 0.12);
}

.provision-step.active
.step-indicator {
  color: var(--warning);

  background:
    rgba(247, 201, 72, 0.12);
}

.provision-step strong {
  display: block;
}

.provision-step div span {
  display: block;

  margin-top: 4px;

  color: var(--muted);

  font-size: 0.85rem;
}

.preparing-footer {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-top: 26px;

  color: var(--muted);
  font-size: 0.9rem;
}

.loading-spinner {
  width: 18px;
  height: 18px;

  border:
    2px solid
    rgba(255, 255, 255, 0.18);

  border-top-color:
    var(--accent);

  border-radius: 50%;

  animation:
    ghc-spin 0.8s linear infinite;
}

@keyframes ghc-spin {

  to {
    transform:
      rotate(360deg);
  }
}

/* --------------------------------------------------
   Expired Lab State
-------------------------------------------------- */

.ended-state {
  margin-top: 2rem;
  padding: 2rem;

  display: flex;
  align-items: center;
  gap: 1.5rem;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.03);
}


.ended-icon {
  width: 56px;
  height: 56px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 50%;

  font-size: 1.5rem;
  font-weight: 700;

  background: rgba(255, 255, 255, 0.08);
}


.ended-content h2 {
  margin: 0 0 0.5rem;

  font-size: 1.25rem;
}


.ended-content p {
  margin: 0 0 1.25rem;

  line-height: 1.6;

  opacity: 0.8;
}


@media (
  max-width: 700px
) {

  .ended-state {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* --------------------------------------------------
   Secondary Lab Action
-------------------------------------------------- */

.button-secondary {
  background:
    transparent;

  border:
    1px solid rgba(255, 255, 255, 0.18);

  color:
    inherit;

  cursor:
    pointer;
}


.button-secondary:hover {
  background:
    rgba(255, 255, 255, 0.06);
}


.button-secondary:disabled {
  opacity:
    0.55;

  cursor:
    not-allowed;
}


/* --------------------------------------------------
   Friendly Provisioning Failure
-------------------------------------------------- */

.failure-panel {
  margin-top: 2rem;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.failure-content h2 {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}

.failure-content p {
  margin: 0 0 1.5rem;
  max-width: 760px;
  line-height: 1.6;
  opacity: 0.82;
}

.failure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

@media (max-width: 700px) {
  .failure-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
