:root {
  --bg-a: #f7f1de;
  --bg-b: #d6e7f2;
  --surface: #ffffffee;
  --text: #1b1f2a;
  --muted: #5f6b7a;
  --accent: #0a7f8a;
  --accent-2: #f28705;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 16px 30px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, #fff7d6 0, transparent 40%),
    linear-gradient(135deg, var(--bg-a), var(--bg-b));
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(760px, 100%);
  background: var(--surface);
  border: 1px solid #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

p {
  margin: 0 0 20px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
  margin-bottom: 14px;
  justify-content: start;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group.shared-field {
  margin-bottom: 16px;
}

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

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

.tabs {
  margin-top: 6px;
}

.tab-list {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #d9e2ef;
  margin-bottom: 14px;
  overflow-x: auto;
}

.tab-button {
  background: transparent;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  padding: 8px 12px;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  white-space: nowrap;
}

.tab-button[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-panel.hidden {
  display: none;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid #c7d0dd;
  border-radius: 10px;
  font: inherit;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

input[type="text"]:focus,
textarea:focus {
  outline: 2px solid #8ecad0;
  border-color: #8ecad0;
}

button,
.file-label {
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.file-label {
  background: #e9eff7;
  color: #243049;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#submitBtn {
  background: linear-gradient(135deg, var(--accent), #0e98a4);
  color: #fff;
}

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

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

#fileInput {
  display: none;
}

.status {
  margin: 4px 0 14px;
  min-height: 22px;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.response-wrap {
  margin-top: 8px;
}

.tab-placeholder {
  min-height: 160px;
}

textarea {
  min-height: 260px;
  resize: vertical;
}

.hint {
  font-size: 0.92rem;
  margin-top: 10px;
}

.hint code {
  background: #eef2f8;
  border-radius: 6px;
  padding: 2px 6px;
}

/* Okta auth styles */
#loginOverlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, #fff7d6 0, transparent 40%),
    linear-gradient(135deg, var(--bg-a), var(--bg-b));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 100;
}

#loginOverlay .login-card {
  background: var(--surface);
  border: 1px solid #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
  text-align: center;
  max-width: 380px;
  width: 90%;
}

#loginOverlay h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

#loginOverlay p {
  margin: 0 0 24px;
  color: var(--muted);
}

#loginBtn {
  background: linear-gradient(135deg, var(--accent), #0e98a4);
  color: #fff;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 120ms ease;
}

#loginBtn:hover {
  opacity: 0.88;
}

#userBar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid #e0e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 20px;
  font-size: 0.875rem;
  z-index: 50;
}

#userBar span {
  color: var(--muted);
}

#logoutBtn {
  background: #e9eff7;
  color: #243049;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 6px 12px;
  cursor: pointer;
}

#userBar.hidden,
#loginOverlay.hidden,
#appContent.hidden {
  display: none;
}

#appContent {
  padding-top: 48px;
}
