:root {
  --background: #f0f4ff;
  --card: #ffffff;
  --primary: #1f3fff;
  --accent: #4fd1c5;
  --text: #0f172a;
  --muted: #6b7aa7;
  --border: #e0e7ff;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header.hero {
  background: radial-gradient(circle at top right, #2e5cff, #141d61);
  color: #fff;
  padding: 3.5rem clamp(1rem, 5vw, 5rem);
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  position: relative;
}

.lang-switcher {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.lang-toggle {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 0.35rem 1.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.hero__content {
  flex: 1 1 320px;
}

.hero__content h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.hero__content p {
  font-size: 1.1rem;
  max-width: 540px;
  line-height: 1.6;
}

.hero__cta {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__badge {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.hero__badge .badge {
  background: rgba(79, 209, 197, 0.2);
  border-radius: 999px;
  padding: 0.35rem 1.2rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.hero__badge .subtext {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

main {
  padding: clamp(1.25rem, 4vw, 3rem);
  flex: 1 0 auto;
}

.panel {
  background: var(--card);
  border-radius: 1.5rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 60px rgba(23, 33, 114, 0.12);
}

.panel__header {
  margin-bottom: 1.5rem;
}

.panel__header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.panel__header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.card h3 {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

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

.card__summary {
  font-size: 0.95rem;
  line-height: 1.6;
}

.tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: rgba(31, 63, 255, 0.08);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  background-image: linear-gradient(120deg, #304ffe, #0ea5e9, #34d399);
  background-size: 220% 220%;
  color: #fff;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  box-shadow: 0 12px 30px rgba(31, 63, 255, 0.25);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease,
    background-position 600ms ease;
  overflow: hidden;
  animation: gradientShift 12s ease-in-out infinite;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  transition: opacity 200ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(31, 63, 255, 0.28);
  background-position: 100% 50%;
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: translateY(0);
}

.btn[data-loading="true"] {
  cursor: progress;
  animation: gradientShift 12s ease-in-out infinite,
    buttonPulse 1.4s ease-in-out infinite;
}

.btn[data-loading="true"]::after {
  opacity: 0.6;
}

.btn.btn--secondary {
  background-color: rgba(31, 63, 255, 0.1) !important;
  background-image: none !important;
  color: var(--primary) !important;
  border: 1px solid rgba(31, 63, 255, 0.5) !important;
  box-shadow: none;
  animation: none;
}

.btn--secondary:link,
.btn--secondary:visited,
.btn--secondary span,
.btn--secondary strong,
.btn--secondary svg {
  color: var(--primary) !important;
  fill: var(--primary) !important;
  stroke: var(--primary) !important;
}

.btn--secondary:hover {
  background-color: rgba(31, 63, 255, 0.16) !important;
  color: var(--primary) !important;
}

.hero .btn--secondary {
  color: #ffffff !important;
  background-color: transparent;
  background-image: none !important;
  border-color: rgba(255, 255, 255, 0.35);
}

.hero .btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero .btn--secondary svg {
  color: currentColor;
  fill: currentColor;
  stroke: currentColor;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn--ghost::after,
.btn--secondary::after {
  display: none;
}

.btn--ghost:hover {
  background: rgba(31, 63, 255, 0.05);
}

.btn--inline {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

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

.action-note {
  flex-basis: 100%;
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.article-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

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

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 1.25rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(31, 63, 255, 0.06), rgba(255, 255, 255, 0.9));
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.search-field--full {
  grid-column: 1 / -1;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(17, 24, 39, 0.15);
  border-radius: 1rem;
  padding: 0.35rem 0.75rem;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.search-input input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 1rem;
  padding: 0.4rem 0;
}

.search-input input:focus {
  outline: none;
}

.search-form select {
  border: 1px solid rgba(17, 24, 39, 0.15);
  border-radius: 1rem;
  padding: 0.55rem 2.25rem 0.55rem 0.95rem;
  font-size: 1rem;
  background: #fff url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231f3fff' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 0.85rem center/10px 6px;
  min-width: 140px;
  color: #111827;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.migration-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.selection-block {
  flex: 2 1 340px;
}

.action-block {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

.helper-text {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
}

.selection-list {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.selection-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.5rem;
  border-radius: 0.75rem;
  transition: background 0.2s ease;
}

.selection-item:hover {
  background: rgba(31, 63, 255, 0.05);
}

.selection-item input {
  margin-top: 0.4rem;
}

.selection-item span {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.selection-item small {
  color: var(--muted);
  font-size: 0.85rem;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.link-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.result-row {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  margin-top: 1rem;
}

.result-row.status-success {
  background: rgba(79, 209, 197, 0.08);
}

.result-row.status-error {
  background: rgba(255, 99, 132, 0.08);
}

.result-row__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.status-pill {
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pill.success {
  background: rgba(79, 209, 197, 0.2);
  color: #0f766e;
}

.status-pill.error {
  background: rgba(255, 99, 132, 0.2);
  color: #991b1b;
}

.status-pill.info {
  background: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.status-pill.pending {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.chip {
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  background: rgba(15, 23, 42, 0.08);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.metrics-grid div {
  background: #f8f9ff;
  border-radius: 0.75rem;
  padding: 0.6rem;
  text-align: center;
}

.metrics-grid span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.metrics-grid strong {
  font-size: 1.1rem;
  display: block;
  margin-top: 0.25rem;
}

.result-row pre {
  background: rgba(15, 23, 42, 0.08);
  padding: 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  max-height: 160px;
  overflow: auto;
}

.result-row__error {
  margin: 0.5rem 0;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.9rem;
}

.log-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.log-links a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.log-links a:hover {
  text-decoration: underline;
}

.result-group {
  border-top: 1px dashed var(--border);
  padding-top: 1rem;
  margin-top: 1.25rem;
}

.result-group:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0.5rem;
}

.result-group__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.job-card .job-status {
  align-self: flex-start;
  margin-bottom: 0.5rem;
}

.job-last-output {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
  background: var(--surface-alt, #f3f4f6);
  border-left: 3px solid var(--accent, #3b82f6);
  padding: 0.35rem 0.6rem;
  border-radius: 0 4px 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-last-output__icon {
  flex-shrink: 0;
  opacity: 0.5;
}

.job-times {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
}

@keyframes buttonPulse {
  0% {
    box-shadow: 0 0 0 rgba(79, 209, 197, 0.3);
  }
  50% {
    box-shadow: 0 0 18px rgba(79, 209, 197, 0.5);
  }
  100% {
    box-shadow: 0 0 0 rgba(79, 209, 197, 0.3);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 50% 100%;
  }
  100% {
    background-position: 100% 50%;
  }
}

footer {
  padding: 1rem clamp(1rem, 4vw, 3rem);
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #f8f9ff;
}
