/* Shared stylesheet for all GC PKCE pages */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  padding: 24px;
}

/* ── Navigation bar ─────────────────────────────────────────── */
.nav {
  max-width: 900px;
  margin: 0 auto 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.nav a {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  color: #0066cc;
  border: 1.5px solid #0066cc;
  transition: background .15s;
}
.nav a:hover  { background: #e8f0fb; }
.nav a.active { background: #0066cc; color: #fff; }

/* ── Headings ───────────────────────────────────────────────── */
h1 { font-size: 24px; margin-bottom: 20px; color: #1a1a1a; }

/* ── Sections ───────────────────────────────────────────────── */
.section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}
.section:last-child { border-bottom: none; margin-bottom: 0; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #1a1a1a; }

/* ── Form elements ──────────────────────────────────────────── */
.form-group { margin-bottom: 12px; }
label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 14px; color: #333; }

input[type="text"], select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
input[type="text"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,.1);
}
textarea { resize: vertical; min-height: 100px; font-family: 'Monaco','Menlo','Ubuntu Mono',monospace; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Buttons ────────────────────────────────────────────────── */
.button-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
button { padding: 10px 16px; border: none; border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s; }
.btn-primary   { background: #0066cc; color: #fff; }
.btn-primary:hover   { background: #0052a3; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-secondary:hover { background: #5a6268; }
.btn-danger    { background: #dc3545; color: #fff; }
.btn-danger:hover    { background: #c82333; }
.copy-btn { padding: 4px 8px; font-size: 12px; background: #0066cc; color: #fff; border: none; border-radius: 3px; cursor: pointer; }
.copy-btn:hover { background: #0052a3; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; margin-right: 8px; margin-bottom: 8px; }
.badge-success { background: #d4edda; color: #155724; }
.badge-info    { background: #d1ecf1; color: #0c5460; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.http-2xx { color: #28a745; font-weight: 600; }
.http-4xx { color: #ffc107; font-weight: 600; }
.http-5xx { color: #dc3545; font-weight: 600; }
.http-other { color: #6c757d; font-weight: 600; }

/* ── Alerts ─────────────────────────────────────────────────── */
.error   { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; padding: 12px; border-radius: 4px; margin-bottom: 12px; }
.success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; padding: 12px; border-radius: 4px; margin-bottom: 12px; }

/* ── Info boxes ─────────────────────────────────────────────── */
.redirect-uri-box {
  background: #f8f9fa; border: 1px solid #dee2e6; padding: 12px; border-radius: 4px;
  font-size: 12px; font-family: 'Monaco','Menlo','Ubuntu Mono',monospace;
  word-break: break-all; margin-bottom: 8px;
}

/* ── Response panel ─────────────────────────────────────────── */
.status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.response-panel { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 4px; padding: 16px; margin-top: 12px; }
pre {
  background: #1e1e1e; color: #d4d4d4; padding: 12px; border-radius: 4px;
  overflow-x: auto; font-family: 'Monaco','Menlo','Ubuntu Mono',monospace;
  font-size: 12px; line-height: 1.5;
}

/* ── Collapsible ────────────────────────────────────────────── */
.collapsible-header {
  cursor: pointer; padding: 8px; background: #e9ecef; border-radius: 4px;
  margin-bottom: 8px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.collapsible-header::before { content: '▶'; display: inline-block; transition: transform .2s; }
.collapsible-header.open::before { transform: rotate(90deg); }
.collapsible-content { max-height: 0; overflow: hidden; transition: max-height .2s; margin-left: 16px; }
.collapsible-content.open { max-height: 500px; }

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }
