:root {
  --ink: #12211f;
  --muted: #60706d;
  --line: #dfe6e2;
  --paper: #fbfaf7;
  --card: #ffffff;
  --teal: #006a60;
  --teal-dark: #004d47;
  --teal-soft: #eaf4f1;
  --gold: #e1a427;
  --orange: #ef6b2d;
  --red: #ee2d45;
  --purple-soft: #f5e8fb;
  --shadow: 0 18px 50px rgba(27, 43, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(0, 106, 96, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(238, 45, 69, 0.06), transparent 30%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 106, 96, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 106, 96, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  animation: gridDrift 22s linear infinite;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 46px 22px 24px;
  display: grid;
  grid-template-rows: auto 455px auto 1fr auto;
  gap: 20px;
  background:
    radial-gradient(circle at 62% 28%, rgba(0, 135, 121, 0.24), transparent 32%),
    linear-gradient(180deg, #004941 0%, #004740 47%, #003b36 100%);
  color: #fff;
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -82px;
  bottom: 118px;
  border: 1px solid rgba(245, 198, 94, 0.36);
  transform: rotate(22deg);
  animation: slowSpin 18s linear infinite;
}

.brand h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
}

.brand h1 span {
  color: #f5c65e;
}

.brand p {
  margin: 13px 0 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.86);
}

.sidebar-art {
  width: min(286px, calc(100% + 16px));
  justify-self: center;
  align-self: center;
  margin-top: 8px;
  filter: drop-shadow(0 32px 52px rgba(0, 0, 0, 0.28));
  animation: floatArt 5.8s ease-in-out infinite;
}

.side-nav {
  display: grid;
  gap: 10px;
}

.side-nav a {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 16px;
  font-weight: 760;
}

.side-nav a.active {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 3px 0 0 #f5c65e;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(3px);
}

.side-nav span {
  width: 22px;
  text-align: center;
  color: #d5f3ed;
}

.learner-card {
  align-self: end;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.learner-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.learner-card strong {
  display: block;
  font-size: 14px;
}

.learner-card p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.learner-card span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e8fff9;
  font-size: 11px;
  font-weight: 800;
}

.main-stage {
  min-width: 0;
}

.topbar {
  min-height: 70px;
  padding: 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.crumb,
.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crumb span {
  font-size: 28px;
}

.crumb strong {
  font-size: 15px;
  font-weight: 780;
}

.top-actions span,
.top-actions b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #cfd8d5;
  font-size: 15px;
}

.top-actions b {
  background: var(--teal-dark);
  color: #fff;
  border-color: var(--teal-dark);
}

.workspace {
  min-width: 0;
  padding: 18px 26px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr);
  gap: 16px;
  align-items: start;
}

.creator-card,
.status-card,
.result-card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: panelIn 520ms ease both;
}

.creator-card {
  padding: 22px 26px 14px;
}

.status-card,
.result-card {
  padding: 18px 20px 16px;
}

.status-card {
  animation-delay: 80ms;
}

.result-card {
  animation-delay: 150ms;
}

.status-column {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.card-heading {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.title-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--teal);
  font-weight: 900;
  font-size: 22px;
}

h2,
h3 {
  letter-spacing: 0;
}

h2 {
  margin: 0;
  color: var(--teal-dark);
  font-size: 26px;
  line-height: 1.08;
}

.card-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.text-button {
  min-height: 34px;
  border: 1px solid #f0a33a;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--teal);
  font-size: 13px;
  font-weight: 780;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.text-button:hover,
.secondary:hover,
.link-button:hover,
.download-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(27, 43, 39, 0.1);
}

.job-form {
  display: grid;
  gap: 9px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #35423f;
  font-size: 13px;
  font-weight: 780;
}

.field small {
  color: #6d7a76;
  font-size: 12px;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d9e1de;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 39px;
  padding: 0 14px;
}

textarea {
  padding: 14px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 106, 96, 0.58);
  box-shadow: 0 0 0 3px rgba(0, 106, 96, 0.1);
}

.title-field {
  display: none;
}

.upload-zone {
  min-height: 172px;
  padding: 18px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed #b8cdca;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fcfb, #f3faf8);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.upload-zone:hover {
  border-color: rgba(0, 106, 96, 0.48);
  background: linear-gradient(180deg, #ffffff, #eaf7f4);
  transform: translateY(-2px);
}

.upload-zone input {
  display: none;
}

.upload-icon {
  width: 54px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #77a19a;
  font-size: 40px;
  line-height: 1;
}

.upload-zone strong {
  color: var(--teal-dark);
  font-size: 15px;
  font-weight: 820;
}

.upload-zone small,
.text-field small,
.submit-note {
  color: var(--muted);
  font-size: 13px;
}

.splitter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  color: #87918e;
  font-size: 14px;
}

.splitter::before,
.splitter::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.text-field {
  position: relative;
}

.text-field textarea {
  min-height: 104px;
  height: 104px;
}

.text-field small {
  position: absolute;
  right: 14px;
  bottom: 11px;
  background: rgba(255, 255, 255, 0.9);
}

.form-row,
.advanced-grid {
  display: grid;
  gap: 12px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.advanced-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.custom-time {
  display: none;
}

.job-form:has(#durationSelect option[value="custom"]:checked) .custom-time {
  display: grid;
}

.whatsapp-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(0, 106, 96, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(0, 106, 96, 0.08), rgba(245, 198, 94, 0.12)),
    #fff;
}

.phone-input {
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  border: 1px solid #d9e1de;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.phone-input b {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 14px;
}

.phone-input input {
  border: 0;
  border-radius: 0;
}

.phone-input:focus-within {
  border-color: rgba(0, 106, 96, 0.58);
  box-shadow: 0 0 0 3px rgba(0, 106, 96, 0.1);
}

.verify-row {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr minmax(86px, auto);
  gap: 8px;
}

.verify-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.verify-status[data-state="ok"] {
  color: var(--teal);
}

.verify-status[data-state="error"] {
  color: var(--red);
}

.verify-status[data-state="sent"] {
  color: #9a6508;
}

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

.toggles label {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #46514e;
  font-size: 13px;
  font-weight: 740;
}

.toggles input {
  width: 30px;
  height: 18px;
  margin-left: auto;
  accent-color: var(--teal);
}

.primary,
.secondary,
.link-button,
.download-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 820;
  cursor: pointer;
}

.primary {
  min-height: 52px;
  border: 0;
  background: linear-gradient(100deg, #006f62 0%, #2f7d65 42%, #f06c2f 72%, #ee2f43 100%);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 18px 38px rgba(0, 106, 96, 0.18);
  background-size: 180% 100%;
  transition: transform 180ms ease, box-shadow 180ms ease, background-position 240ms ease;
}

.primary:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 22px 42px rgba(239, 107, 45, 0.22);
}

.submit-note {
  margin: -5px 0 0;
  text-align: center;
}

button:disabled,
.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.badge {
  min-width: 70px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  text-align: center;
  font-size: 12px;
  font-weight: 860;
}

.timeline {
  display: grid;
  gap: 0;
  margin: 4px 0 17px;
}

.timeline div {
  position: relative;
  min-height: 48px;
  padding-left: 54px;
  display: grid;
  align-content: start;
  gap: 4px;
}

.timeline div:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 34px;
  bottom: 0;
  border-left: 1px dashed #b9c4c1;
}

.timeline span {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #c2cbc8;
  background: #fff;
}

.timeline strong {
  color: #172825;
  font-size: 15px;
  font-weight: 860;
}

.timeline em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.timeline .done span {
  border-color: var(--teal);
  background: var(--teal);
}

.timeline .done span::after {
  content: "✓";
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.timeline .active span {
  border-color: var(--gold);
  background: #fff7e8;
  box-shadow: inset 0 0 0 7px var(--gold);
  animation: pulseStep 1.1s ease-in-out infinite;
}

.timeline .failed span {
  border-color: var(--red);
  background: var(--red);
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #e9eeeb;
  overflow: hidden;
}

#progressFill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--orange), var(--red));
  transition: width 300ms ease;
  background-size: 160% 100%;
  animation: progressFlow 2.6s linear infinite;
}

#progressPercent {
  color: #33413e;
  font-size: 13px;
  font-weight: 780;
}

.error-text {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 760;
}

.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.72)),
    url("https://images.unsplash.com/photo-1536599018102-9f803c140fc1?auto=format&fit=crop&w=1200&q=80") center / cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 20px 44px rgba(18, 33, 31, 0.12);
}

.video-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.16), transparent 46%);
  transform: translateX(-100%);
  animation: previewSweep 4.8s ease-in-out infinite;
  z-index: 1;
}

.video-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  z-index: 2;
}

.video-shell iframe:not([src]),
.video-shell iframe[src=""] {
  display: none;
}

.preview-placeholder {
  position: absolute;
  inset: auto 22px 22px;
  color: #fff;
  display: grid;
  gap: 5px;
  text-align: center;
}

.preview-placeholder strong {
  font-size: 28px;
  line-height: 1.05;
}

.preview-placeholder span {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
}

.result-card h3 {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: 20px;
}

.file-result {
  min-height: 80px;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--purple-soft);
  color: #a455c5;
  font-size: 22px;
}

.file-result strong {
  display: block;
  color: #21312e;
  font-size: 14px;
}

.file-result span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.secondary,
.link-button,
.download-button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: #25413d;
  font-size: 13px;
}

.download-button {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 46px 46px, 46px 46px; }
}

@keyframes slowSpin {
  from { transform: rotate(22deg); }
  to { transform: rotate(382deg); }
}

@keyframes floatArt {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseStep {
  0%, 100% { box-shadow: inset 0 0 0 7px var(--gold), 0 0 0 0 rgba(225, 164, 39, 0.34); }
  50% { box-shadow: inset 0 0 0 7px var(--gold), 0 0 0 8px rgba(225, 164, 39, 0); }
}

@keyframes progressFlow {
  from { background-position: 0 0; }
  to { background-position: 160% 0; }
}

@keyframes previewSweep {
  0%, 55% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 306px minmax(940px, 1fr);
  }

  body {
    overflow-x: auto;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    min-height: auto;
    grid-template-rows: auto auto;
  }

  .sidebar-art,
  .learner-card {
    display: none;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .advanced-grid,
  .two-col,
  .toggles,
  .actions {
    grid-template-columns: 1fr;
  }
}
