@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Sora:wght@400;500;600&display=swap');

:root {
  --bg: #050910;
  --panel: rgba(12, 16, 26, 0.85);
  --card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.07);
  --text: #e9edf5;
  --muted: #9aabc5;
  --accent: #f6c343;
  --accent-2: #31d2f2;
  --error: #ff6b6b;
  --warn: #f0a500;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, rgba(49, 210, 242, 0.15), transparent 35%),
              radial-gradient(circle at 80% 0%, rgba(246, 195, 67, 0.18), transparent 40%),
              radial-gradient(circle at 70% 70%, rgba(255, 107, 107, 0.12), transparent 35%),
              #050910;
  font-family: 'Sora', 'Space Grotesk', sans-serif;
  line-height: 1.5;
}

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: absolute;
  width: 320px;
  height: 320px;
  filter: blur(140px);
  opacity: 0.6;
  animation: float 18s ease-in-out infinite;
}

.glow-1 {
  top: 8%;
  left: 12%;
  background: #31d2f2;
}

.glow-2 {
  bottom: 6%;
  right: 8%;
  background: #f6c343;
  animation-delay: 6s;
}

.grid {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
              linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 120px 120px;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.hero {
  margin-bottom: 32px;
}

.hero h1 {
  margin: 8px 0 10px;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: 'Space Grotesk', 'Sora', sans-serif;
}

.hero .lede {
  max-width: 720px;
  color: var(--muted);
  margin: 0 0 16px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.grid-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

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

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

.panel h2 {
  margin: 4px 0 0;
  font-size: 1.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(49, 210, 242, 0.12);
  color: var(--accent-2);
  font-weight: 600;
  border: 1px solid rgba(49, 210, 242, 0.35);
}

.pill-soft {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border);
}

.form {
  display: grid;
  gap: 18px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(49, 210, 242, 0.15);
}

.field small {
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

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

.button {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease;
  text-decoration: none;
  color: var(--text);
}

.button.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0c0f17;
  box-shadow: 0 12px 30px rgba(49, 210, 242, 0.3);
}

.button.ghost {
  background: var(--card);
  border: 1px solid var(--border);
}

.button:hover {
  transform: translateY(-1px);
}

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

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

.status-panel .status-card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.status-line {
  font-weight: 600;
  margin-bottom: 10px;
}

.progress {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

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

.chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.chip-ok {
  color: #0fcb81;
  border-color: rgba(15, 203, 129, 0.4);
}

.chip-ok-soft {
  color: var(--muted);
}

.chip-warn {
  color: var(--warn);
  border-color: rgba(240, 165, 0, 0.5);
}

.log {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  min-height: 140px;
  padding: 12px;
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: 260px;
}

.log-entry {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.log-entry.info {
  color: var(--text);
}

.log-entry.warn {
  color: var(--warn);
}

.log-entry.error {
  color: var(--error);
  border-color: rgba(255, 107, 107, 0.4);
}

.log-entry.muted {
  color: var(--muted);
}

#badge[data-tone="running"] {
  background: rgba(246, 195, 67, 0.12);
  color: var(--accent);
  border-color: rgba(246, 195, 67, 0.4);
}

#badge[data-tone="error"] {
  background: rgba(255, 107, 107, 0.12);
  color: var(--error);
  border-color: rgba(255, 107, 107, 0.35);
}#badge[data-tone="ready"] {
  background: rgba(49, 210, 242, 0.12);
  color: var(--accent-2);
  border-color: rgba(49, 210, 242, 0.4);
}

/* Card Designer Styles */
.card-designer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

.card-designer summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
  user-select: none;
  list-style: none;
  padding: 8px;
  margin: -8px;
}

.card-designer summary::-webkit-details-marker {
  display: none;
}

.card-designer[open] summary {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.button-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.button-row input {
  flex: 1;
}

.remove-btn {
  background: var(--error);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.button.small {
  padding: 6px 12px;
  font-size: 0.875rem;
  margin-top: 4px;
}

/* Card Preview Styles */
.card-preview {
  background: #f5f5f5;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.teams-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-width: 400px;
  margin: 0 auto;
}

#preview-image {
  display: none;
  margin: -16px -16px 12px -16px;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

#preview-image img {
  width: 100%;
  height: auto;
  display: block;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #242424;
  margin-bottom: 8px;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 12px;
}

.card-body {
  font-size: 0.9375rem;
  color: #333;
  margin-bottom: 12px;
  display: none;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
  margin-top: 8px;
}

.teams-btn {
  background: transparent;
  border: 1px solid #0078d4;
  color: #0078d4;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: inherit;
}

.teams-btn:hover {
  background: #0078d4;
  color: white;
}

@keyframes float {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(8px, -10px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@media (max-width: 720px) {
  .page {
    padding: 32px 18px 60px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .panel {
    padding: 18px;
  }

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