:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-border: rgba(148, 163, 184, 0.16);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #22c55e;
  --accent-2: #38bdf8;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.34);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Aptos", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.20), transparent 35%),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.16), transparent 28%),
    linear-gradient(180deg, #020617 0%, #0f172a 54%, #111827 100%);
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 24px 28px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(17, 24, 39, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  font-size: 0.72rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.hero-copy {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.16);
  color: #d1fae5;
  font-weight: 600;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 22px;
  margin-top: 22px;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel-form,
.panel-status {
  padding: 24px;
}

.panel-head h2,
.log-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.banner {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 600;
}

.banner-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.34);
  color: #fecaca;
}

.banner-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.34);
  color: #bbf7d0;
}

.hidden {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label span {
  font-size: 0.88rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  padding: 14px 16px;
  font-size: 1rem;
  outline: none;
}

input:focus {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.span-2 {
  grid-column: span 2;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn,
.link-btn {
  border: 0;
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  font-weight: 700;
  min-width: 132px;
}

.btn:hover,
.link-btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-tertiary {
  background: rgba(56, 189, 248, 0.14);
  color: #dbeafe;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.btn-outline {
  background: rgba(249, 115, 22, 0.12);
  color: #ffedd5;
  border: 1px solid rgba(249, 115, 22, 0.24);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.status-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.status-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-card strong {
  font-size: 1.05rem;
  word-break: break-word;
}

.progress-wrap {
  margin-top: 18px;
}

.progress-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.3s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.log-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.64);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.link-btn {
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--muted);
}

.log-output {
  margin: 0;
  min-height: 320px;
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #dbeafe;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1200px);
    margin: 10px auto 20px;
  }

  .panel-form,
  .panel-status,
  .hero {
    padding: 18px;
  }

  .form-grid,
  .cards {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .button-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .progress-meta {
    flex-direction: column;
  }
}
