* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #0f172a;
  color: #0f172a;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 40%, #e2e8f0 40%, #f8fafc 100%);
}

.app__header {
  padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
  color: #f8fafc;
}

.app__header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.app__header p {
  margin: 0 0 1rem;
  max-width: 480px;
  line-height: 1.5;
  opacity: 0.9;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  font-size: 0.9rem;
}

.status--ready {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.status--degraded {
  background: rgba(255, 159, 28, 0.16);
  color: #fef3c7;
}

.app__content {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2rem;
  padding: 2.5rem clamp(1.5rem, 4vw, 3rem) 3rem;
  margin-top: -2.5rem;
}

.app__content--confirmation {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

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

  .app__content--confirmation {
    grid-template-columns: 1fr;
  }
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.panel {
  background: #ffffff;
  padding: 1.75rem;
  border-radius: 16px;
  box-shadow: 0 24px 40px rgba(15, 23, 42, 0.12);
}

.panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.field label {
  font-weight: 600;
  color: #334155;
}

.field input,
.field textarea {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  font-size: 1rem;
  background: #f8fafc;
}

.field--half {
  flex-direction: row;
  gap: 1rem;
}

.field--half > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}

textarea {
  resize: vertical;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

button.submit {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

button.submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.25);
}

.app__aside {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.75rem;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
  min-height: 200px;
}

.app__aside h3 {
  margin-top: 0;
}

.context {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #e0f2fe;
  color: #0f172a;
}

.context strong {
  font-weight: 600;
}

.success-notice {
  background: rgba(34, 197, 94, 0.15);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  color: #14532d;
}

.error-notice {
  background: rgba(248, 113, 113, 0.15);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  color: #7f1d1d;
}

.confirmation-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.confirmation-summary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.confirmation-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0;
}

.confirmation-grid dt {
  font-weight: 600;
  color: #334155;
}

.confirmation-grid dd {
  margin: 0.25rem 0 0;
  color: #0f172a;
}

.confirmation-details {
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.15);
  padding: 0.75rem 1rem;
}

.confirmation-details pre {
  max-height: 220px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.25);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.cta-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(99, 102, 241, 0.3);
}

.return-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #4338ca;
  text-decoration: none;
}

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

.token-preview {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  word-break: break-all;
}

.token-preview--missing {
  background: rgba(248, 113, 113, 0.18);
  color: #fee2e2;
}

.aside-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.8);
}
