* {
  box-sizing: border-box;
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1f3b63 0%, #0a0f1a 50%, #050608 100%);
  color: #f8fafc;
  display: flex;
  justify-content: center;
  padding: 40px 16px 64px;
}

main.page {
  width: min(1200px, 100%);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  position: relative;
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.35), rgba(15, 23, 42, 0.85));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero__content {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero__glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.4);
  filter: blur(120px);
  right: -80px;
  top: -100px;
}

.badge {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: #93c5fd;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  margin: 0;
}

.subtitle {
  margin: 0;
  color: #cbd5f5;
  line-height: 1.4;
}

.hero__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tag {
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #cbd5f5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: rgba(13, 16, 26, 0.85);
  border-radius: 24px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.card h2 {
  margin: 4px 0 0;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #9ca3af;
  margin: 0;
}

.pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.upload form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dropzone {
  border: 1px dashed rgba(148, 163, 184, 0.7);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  gap: 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: border 0.2s ease, background 0.2s ease;
}

.dropzone:hover {
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(59, 130, 246, 0.06);
}

.dropzone input[type="file"] {
  display: none;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #cbd5f5;
}

input[type="month"],
input[type="number"],
input[type="date"],
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
}

button {
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.primary {
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  color: #fff;
}

button.secondary {
  background: rgba(37, 99, 235, 0.15);
  color: #e0f2ff;
  border: 1px solid rgba(59, 130, 246, 0.4);
  justify-content: space-between;
}

button.ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  justify-content: space-between;
}

button.ghost.small {
  padding: 10px 14px;
  font-size: 14px;
  justify-content: center;
}

/* Loading state spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

button.loading {
  position: relative;
}

button.loading::after {
  content: '';
  position: absolute;
  right: 14px;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* Adjust spinner color for non-primary variants */
button.secondary.loading::after,
button.ghost.loading::after {
  border: 3px solid rgba(148,163,184,0.5);
  border-top-color: #93c5fd;
}

.actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.action-block {
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.action-header p {
  margin: 4px 0 0;
  color: #94a3b8;
}

.action-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.status {
  margin-top: 20px;
  min-height: 32px;
  color: #a5b4fc;
  font-size: 14px;
}

.status[data-tone="success"] {
  color: #6ee7b7;
}

.status[data-tone="error"] {
  color: #fca5a5;
}

.console {
  width: 100%;
}

#console-output {
  margin: 24px 0 0;
  min-height: 200px;
  background: rgba(5, 7, 12, 0.85);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  overflow-x: auto;
  color: #e5e7eb;
  font-size: 14px;
}

@media (max-width: 640px) {
  .card {
    padding: 22px;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

.login-shell {
  width: min(420px, 100%);
}

.login-card {
  background: rgba(13, 16, 26, 0.9);
  border-radius: 28px;
  padding: 36px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card button {
  width: 100%;
}

.login-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #94a3b8;
}
