/* Palette: #3D3B40 #525CEB #BFCFE7 #F8EDFF */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #3D3B40;
  --accent:   #525CEB;
  --light:    #BFCFE7;
  --pale:     #F8EDFF;
  --surface:  #2e2c31;
  --surface2: #252328;
  --text:     #e8e4f0;
  --muted:    #9490a0;
  --border:   #4a4750;
  --error:    #e07070;
  --radius:   8px;
  --font-ui:  'Inter', system-ui, sans-serif;
  --font-brand: 'Share Tech', monospace;
}

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

/* ---- Utilities ---- */
.hidden { display: none !important; }
.page { min-height: 100vh; }

/* ---- Split layout ---- */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.split-left {
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  border-right: 1px solid var(--border);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 2.8rem;
  color: var(--pale);
  letter-spacing: 0.05em;
}

.brand-tagline {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 300px;
  line-height: 1.7;
}

.brand-footer a {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.15s;
}
.brand-footer a:hover { color: var(--light); }

.split-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ---- Form card ---- */
.form-card {
  width: 100%;
  max-width: 440px;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.6rem 1.2rem;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab.active { color: var(--pale); border-bottom-color: var(--accent); }
.tab:hover:not(.active) { color: var(--light); }

.form { display: none; flex-direction: column; gap: 1.1rem; }
.form.active { display: flex; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--light);
  letter-spacing: 0.03em;
}

.optional { color: var(--muted); font-weight: 400; }

.input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: 0.8rem 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.input::placeholder { color: var(--muted); }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(82, 92, 235, 0.15);
}

.error {
  color: var(--error);
  font-size: 0.8rem;
  min-height: 1rem;
}

.btn-primary {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.85rem;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
  margin-top: 0.3rem;
}
.btn-primary:hover { background: #3f4ad4; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-email {
  color: var(--muted);
  font-size: 0.85rem;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--light);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: var(--surface); border-color: var(--accent); }

/* ---- Dashboard ---- */
.dashboard {
  max-width: 640px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pale);
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-brand);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-name {
  font-weight: 500;
  color: var(--pale);
  font-size: 0.95rem;
}

.dash-email {
  color: var(--muted);
  font-size: 0.82rem;
}

.token-section { display: flex; flex-direction: column; gap: 0.5rem; }

.token-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.token-pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--light);
  font-size: 0.72rem;
  overflow-x: auto;
  padding: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- Result box ---- */
.result-box {
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--light);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.result-box strong { color: var(--pale); }
.result-box .secret { color: var(--error); font-family: monospace; word-break: break-all; }
.result-box .note { color: var(--muted); font-size: 0.75rem; margin-top: 0.4rem; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  /* Split layout — show only form on mobile */
  .split-layout { grid-template-columns: 1fr; min-height: 100svh; }
  .split-left { display: none; }
  .split-right { padding: 2rem 1.25rem; align-items: flex-start; padding-top: 3rem; }
  .form-card { max-width: 100%; }

  /* Topbar */
  .topbar { padding: 0.85rem 1.25rem; }
  .brand-name { font-size: 1.4rem; }
  .topbar-right { gap: 0.6rem; }
  .topbar-link { font-size: 0.8rem; }
  .btn-ghost { font-size: 0.8rem; padding: 0.35rem 0.7rem; }

  /* Dashboard */
  .dashboard { margin: 1.5rem auto; padding: 0 1rem; gap: 1rem; }
  .dash-card { padding: 1.2rem; gap: 1rem; }

  /* Info rows — long IDs wrap */
  .info-row { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .info-val { word-break: break-all; font-size: 0.82rem; }

  /* Docs layout */
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  .docs-content { padding: 1.5rem 1.25rem; }
  .doc-h1 { font-size: 1.4rem; }
  .doc-h2 { font-size: 1rem; }

  /* Endpoint table — stack on mobile */
  .ep-row { grid-template-columns: 50px 1fr; }
  .ep-row span:last-child { display: none; }
  .ep-row.header span:last-child { display: none; }

  /* Callout wrap */
  .callout { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}

/* ---- Brand footer links ---- */
.brand-footer { display: flex; gap: 1.5rem; }

/* ---- Docs ---- */
.docs { max-width: 760px; }
.doc-text { color: var(--muted); font-size: 0.88rem; line-height: 1.7; }
.doc-text a { color: var(--light); }
.doc-text code { background: var(--surface2); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.82rem; }
.sub-title { font-size: 0.9rem; font-weight: 600; color: var(--light); margin-bottom: 0.8rem; }
.code-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--light);
  font-size: 0.78rem;
  line-height: 1.6;
  overflow-x: auto;
  padding: 1rem;
  white-space: pre;
}
.endpoint-list { display: flex; flex-direction: column; gap: 0.6rem; }
.endpoint { display: flex; align-items: center; gap: 0.7rem; font-size: 0.82rem; }
.endpoint code { color: var(--light); }
.ep-desc { color: var(--muted); }
.method { border-radius: 3px; font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.4rem; font-family: var(--font-brand); }
.method.get  { background: rgba(82,92,235,0.2); color: #8b96f5; }
.method.post { background: rgba(80,200,120,0.15); color: #6dcc8a; }

/* ---- Success message ---- */
.success-msg { color: #6dcc8a; font-size: 0.9rem; line-height: 1.6; }

/* ---- Pending requests ---- */
.request-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.request-item:last-child { border-bottom: none; }
.req-info { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; }
.req-info strong { color: var(--pale); }
.req-info code { font-size: 0.75rem; color: var(--light); }
.req-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.btn-approve {
  background: rgba(80,200,120,0.15);
  border: 1px solid rgba(80,200,120,0.3);
  border-radius: var(--radius);
  color: #6dcc8a;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  transition: background 0.15s;
}
.btn-approve:hover { background: rgba(80,200,120,0.25); }
.btn-reject {
  background: rgba(220,80,80,0.1);
  border: 1px solid rgba(220,80,80,0.25);
  border-radius: var(--radius);
  color: var(--error);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  transition: background 0.15s;
}
.btn-reject:hover { background: rgba(220,80,80,0.2); }
.muted { color: var(--muted); font-size: 0.82rem; }

/* ---- Split left redesign ---- */
.split-left-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.brand-tagline { margin-top: 0.5rem; }

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.feature-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--pale);
  margin-bottom: 0.2rem;
}

.feature-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.feature-desc code {
  background: rgba(255,255,255,0.06);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

/* ---- Docs layout ---- */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 57px);
}

.docs-sidebar {
  background: var(--surface2);
  border-right: 1px solid var(--border);
  padding: 2rem 1.2rem;
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-section {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.2rem 0 0.4rem 0.5rem;
}
.sidebar-section:first-child { margin-top: 0; }

.sidebar-link {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}
.sidebar-link:hover { color: var(--light); background: rgba(255,255,255,0.04); }
.sidebar-link.active { color: var(--pale); background: rgba(82,92,235,0.12); }

.docs-content {
  padding: 3rem 3.5rem;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.doc-section {
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.doc-section:last-child { border-bottom: none; }

.doc-h1 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--pale);
  line-height: 1.3;
}

.doc-h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--pale);
}

.doc-p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.75;
}
.doc-p strong { color: var(--light); font-weight: 500; }
.doc-p a { color: var(--light); }
.doc-p code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--light);
}

.doc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-left: 0.5rem;
}
.doc-list li {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
}
.doc-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--border);
}
.doc-list li code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--light);
}

.callout {
  background: rgba(82,92,235,0.08);
  border: 1px solid rgba(82,92,235,0.25);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
}
.callout code { color: var(--light); font-size: 0.85rem; }
.callout-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b96f5;
  white-space: nowrap;
}
.callout-warn {
  background: rgba(220,160,60,0.08);
  border-color: rgba(220,160,60,0.25);
  color: var(--muted);
}
.callout-warn .callout-label { color: #d4a843; }

.step-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.endpoint-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ep-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 1rem;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.ep-row:last-child { border-bottom: none; }
.ep-row.header {
  background: var(--surface2);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.ep-row code { color: var(--light); font-size: 0.78rem; }
.ep-row span:last-child { color: var(--muted); }

.topbar-link {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.15s;
}
.topbar-link:hover { color: var(--light); }

@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  .docs-content { padding: 2rem 1.5rem; }
}

/* ---- Darker docs background ---- */
#pageDocs { background: var(--surface2); }
.docs-content { background: var(--surface2); }
.docs-sidebar { background: #1a1820; border-right-color: #333; }

/* ---- Copy button ---- */
.code-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-ui);
}
.copy-btn:hover { background: rgba(255,255,255,0.1); color: var(--light); }
.copy-btn.copied { color: #6dcc8a; border-color: rgba(80,200,120,0.3); }

/* ---- Info rows ---- */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--muted); }
.info-val { color: var(--light); font-family: var(--font-ui); }
.info-val code { font-family: monospace; font-size: 0.82rem; color: var(--muted); }

/* ---- Mobile footer (visible only on small screens) ---- */
.mobile-footer {
  display: none;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.mobile-footer a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.15s;
}
.mobile-footer a:hover { color: var(--light); }

/* ---- Mobile brand (hidden on desktop) ---- */
.mobile-brand {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 2rem;
}
.mobile-brand .brand-name { font-size: 2rem; }
.mobile-brand .brand-tagline { font-size: 0.9rem; max-width: 100%; }

@media (max-width: 640px) {
  .mobile-footer { display: flex; }
  .mobile-brand { display: flex; }
}
