/* =====================================================================
   IAM Auth Server — core stylesheet
   Design system matched to auth_server_management (Next.js portal)
   ===================================================================== */

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

:root {
  --bg-base:        #080e1a;
  --bg-card:        rgba(15, 23, 42, 0.80);
  --bg-card-strong: rgba(15, 23, 42, 0.92);
  --bg-elev:        #0f172a;
  --border-subtle:  #1e293b;
  --border-strong:  #334155;
  --border-glow:    rgba(99, 102, 241, 0.45);

  --accent-1:       #10b981;   /* emerald */
  --accent-2:       #14b8a6;   /* teal */
  --accent-3:       #6366f1;   /* indigo */
  --accent-4:       #8b5cf6;   /* purple */
  --amber:          #f59e0b;
  --rose:           #f43f5e;
  --sky:            #38bdf8;

  --text-primary:   #f1f5f9;
  --text-muted:     #94a3b8;
  --text-dim:       #64748b;
  --text-success:   #6ee7b7;
  --text-error:     #fb7185;
  --text-warn:      #fbbf24;

  --input-bg:       rgba(30, 41, 59, 0.6);
  --input-border:   #334155;
  --input-focus:    #10b981;

  --radius-card:    24px;
  --radius-input:   14px;
  --radius-btn:     14px;

  --font:           'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;
}

html, body { min-height: 100%; }

body.iam-body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(ellipse 70% 50% at 18% -8%, rgba(99, 102, 241, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 82% 108%, rgba(16, 185, 129, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(139, 92, 246, 0.10) 0%, transparent 60%),
    #080e1a;
  background-attachment: fixed;
}

.iam-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(99,102,241,0.06) 0 1px, transparent 1px),
    radial-gradient(circle at 85% 75%, rgba(16,185,129,0.05) 0 1px, transparent 1px),
    radial-gradient(circle at 55% 50%, rgba(139,92,246,0.04) 0 1px, transparent 1px);
  background-size: 60px 60px, 80px 80px, 100px 100px;
  pointer-events: none;
  z-index: 0;
}

.iam-wrapper {
  width: 100%;
  position: relative;
  z-index: 1;
}

main.iam-wrapper { display: block; }

/* --- Card --- */
.iam-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 2rem 2rem 1.75rem;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 32px 64px -16px rgba(0,0,0,0.6),
    0 0 80px -20px rgba(99,102,241,0.18);
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  max-width: 460px;
  margin: 0 auto;
}
.iam-card.is-wide { max-width: 540px; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Logo / brand --- */
.iam-logo-wrap {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  margin-bottom: 1.5rem;
}
.iam-logo-icon {
  width: 60px; height: 60px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem; letter-spacing: -0.5px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #10b981 100%);
  box-shadow:
    0 8px 32px rgba(99,102,241,0.4),
    0 2px 8px rgba(0,0,0,0.3);
  margin-bottom: 0.9rem;
  position: relative;
  overflow: hidden;
}
.iam-logo-icon::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255,255,255,0.12);
  border-radius: 18px 18px 50% 50%;
}
.iam-logo-icon.is-amber { background: linear-gradient(135deg,#f59e0b 0%, #ef4444 100%); box-shadow: 0 8px 32px rgba(245,158,11,0.4), 0 2px 8px rgba(0,0,0,0.3); }
.iam-logo-icon.is-emerald { background: linear-gradient(135deg,#10b981 0%, #14b8a6 100%); box-shadow: 0 8px 32px rgba(16,185,129,0.4), 0 2px 8px rgba(0,0,0,0.3); }
.iam-logo-icon.is-icon { font-size: 1.6rem; }

.iam-logo-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  background: linear-gradient(135deg, #a5b4fc 0%, #e0f2fe 50%, #6ee7b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
}
.iam-logo-title.is-amber { background: linear-gradient(135deg, #fcd34d 0%, #fb923c 50%, #fb7185 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.iam-logo-title.is-emerald { background: linear-gradient(135deg, #6ee7b7 0%, #99f6e4 50%, #a5b4fc 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.iam-logo-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

.iam-client-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.6rem;
  padding: 0.3rem 0.85rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #a5b4fc;
}
.iam-client-badge::before { content: '🔐'; font-size: 0.7rem; }

/* --- Form --- */
.iam-form { display: flex; flex-direction: column; gap: 1.05rem; }
.iam-field { display: flex; flex-direction: column; }
.iam-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
}
.iam-input {
  width: 100%;
  padding: 0.82rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.iam-input::placeholder { color: #475569; }
.iam-input:focus {
  border-color: var(--input-focus);
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15), 0 0 20px rgba(16, 185, 129, 0.08);
}
.iam-input.is-error { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(244,63,94,0.18), 0 0 18px rgba(244,63,94,0.15); }
.iam-input.is-error:focus { box-shadow: 0 0 0 3px rgba(244,63,94,0.25), 0 0 22px rgba(244,63,94,0.25); }
.iam-input.is-success { border-color: var(--accent-1); box-shadow: 0 0 0 3px rgba(16,185,129,0.15), 0 0 18px rgba(16,185,129,0.10); }
.iam-input.has-icon { padding-right: 3rem; }

/* Inline field error message (shown below an input) */
.iam-field-error {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-error);
  margin-top: 0.4rem;
  font-weight: 500;
  animation: fieldErrorIn 0.25s ease;
}
.iam-field-error::before { content: ''; }
.iam-field-error span { font-size: 0.85rem; line-height: 1; }
@keyframes fieldErrorIn {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Password strength meter */
.iam-pw-strength {
  display: flex; gap: 4px; margin-top: 0.5rem;
}
.iam-pw-strength span {
  flex: 1; height: 4px; border-radius: 4px;
  background: var(--bg-elev);
  transition: background 0.2s;
}
.iam-pw-strength.is-weak   span:nth-child(-n+1) { background: var(--rose); }
.iam-pw-strength.is-fair   span:nth-child(-n+2) { background: #f59e0b; }
.iam-pw-strength.is-good   span:nth-child(-n+3) { background: #facc15; }
.iam-pw-strength.is-strong span                    { background: var(--accent-1); }
.iam-pw-hint { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.35rem; }

.iam-input-wrap { position: relative; }
.iam-input-icon-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-dim);
  padding: 0.25rem;
  display: flex; align-items: center;
  line-height: 1;
  transition: color 0.15s;
}
.iam-input-icon-btn:hover { color: var(--text-primary); }

/* OTP */
.iam-otp-boxes {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin: 0.5rem 0 0.25rem;
}
.iam-otp-box {
  width: 2.8rem;
  height: 3.2rem;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 0.6rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  caret-color: var(--accent-1);
}
.iam-otp-box:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.2), 0 0 12px rgba(16,185,129,0.08);
}
.iam-otp-box.is-success {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.25), 0 0 12px rgba(16,185,129,0.12);
}
.iam-otp-box.is-error {
  border-color: var(--rose);
  box-shadow: 0 0 0 2px rgba(244,63,94,0.25), 0 0 12px rgba(244,63,94,0.12);
  animation: otp-shake 0.4s ease;
}
.iam-otp-hint { font-size: 0.7rem; color: var(--text-dim); text-align: center; margin-top: 0.4rem; height: 1rem; }

@keyframes otp-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@media (max-width: 480px) {
  .iam-otp-box { width: 2.4rem; height: 2.8rem; font-size: 1.2rem; }
  .iam-otp-boxes { gap: 0.35rem; }
}

/* Buttons */
.iam-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  text-decoration: none;
}
.iam-btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 40%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(99,102,241,0.35), 0 1px 3px rgba(0,0,0,0.3);
  position: relative; overflow: hidden;
}
.iam-btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: rgba(255,255,255,0.10);
  border-radius: var(--radius-btn) var(--radius-btn) 50% 50%;
  pointer-events: none;
}
.iam-btn-primary:hover { opacity: 0.93; transform: translateY(-1px); box-shadow: 0 6px 32px rgba(99,102,241,0.45); }
.iam-btn-primary:active { transform: translateY(0); }
.iam-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.iam-btn-gradient-emerald {
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 50%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(16,185,129,0.35), 0 1px 3px rgba(0,0,0,0.3);
  position: relative; overflow: hidden;
}
.iam-btn-gradient-emerald::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 40%;
  background: rgba(255,255,255,0.10);
  border-radius: var(--radius-btn) var(--radius-btn) 50% 50%;
  pointer-events: none;
}
.iam-btn-gradient-emerald:hover { opacity: 0.95; transform: translateY(-1px); box-shadow: 0 6px 32px rgba(16,185,129,0.45); }
.iam-btn-gradient-emerald:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.iam-btn-secondary {
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.iam-btn-secondary:hover { background: rgba(30, 41, 59, 0.95); }

.iam-btn-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 60%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(245,158,11,0.35), 0 1px 3px rgba(0,0,0,0.3);
  position: relative; overflow: hidden;
}
.iam-btn-amber::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 40%; background: rgba(255,255,255,0.10);
  border-radius: var(--radius-btn) var(--radius-btn) 50% 50%; pointer-events: none;
}
.iam-btn-amber:hover { opacity: 0.95; transform: translateY(-1px); box-shadow: 0 6px 32px rgba(245,158,11,0.45); }
.iam-btn-amber:disabled { opacity: 0.5; cursor: not-allowed; }

.iam-btn-google {
  background: #fff; color: #1e293b;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.iam-btn-google:hover { background: #f8fafc; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.25); }

.iam-btn-row { display: flex; gap: 0.75rem; }
.iam-btn-row > * { flex: 1; }

/* Banners */
.iam-banner {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  display: flex; align-items: center; gap: 0.5rem;
  animation: shake 0.35s ease;
  margin-bottom: 1rem;
}
.iam-banner-error {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: var(--text-error);
}
.iam-banner-info {
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.20);
  color: var(--text-success);
  animation: none;
}
.iam-banner-warn {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.30);
  color: var(--text-warn);
  animation: none;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-4px); }
  40%       { transform: translateX(4px); }
  60%       { transform: translateX(-3px); }
  80%       { transform: translateX(2px); }
}

/* Divider */
.iam-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1.1rem 0;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.iam-divider::before, .iam-divider::after {
  content: ''; flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

/* Footer links */
.iam-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(30, 41, 59, 0.8);
  font-size: 0.82rem;
}
.iam-link {
  color: var(--accent-1);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.iam-link:hover { color: #34d399; text-decoration: underline; }
.iam-link-muted { color: var(--text-dim); text-decoration: none; font-size: 0.78rem; transition: color 0.15s; }
.iam-link-muted:hover { color: var(--text-muted); }

.iam-text-center { text-align: center; }

/* Step indicators */
.iam-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; margin-bottom: 1.5rem;
}
.iam-step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  border: 1.5px solid var(--border-strong);
  color: #475569;
  background: rgba(30, 41, 59, 0.5);
  transition: all 0.3s;
}
.iam-step-dot.is-active { background: var(--accent-3); border-color: var(--accent-3); color: #fff; box-shadow: 0 0 12px rgba(99,102,241,0.4); }
.iam-step-dot.is-done   { background: var(--accent-1); border-color: var(--accent-1); color: #fff; }
.iam-step-line { height: 1.5px; width: 32px; background: var(--bg-elev); }

/* Step progress bars (signup wizard) */
.iam-progress {
  display: flex; align-items: center; justify-content: center;
  gap: 0.4rem; margin: 0.5rem 0 1.25rem;
}
.iam-progress-bar {
  height: 6px;
  border-radius: 100px;
  background: var(--bg-elev);
  transition: all 0.3s;
}
.iam-progress-bar.is-active { width: 36px; background: var(--accent-1); box-shadow: 0 0 8px rgba(16,185,129,0.45); }
.iam-progress-bar.is-done   { width: 18px; background: rgba(16,185,129,0.5); }
.iam-progress-bar.is-todo   { width: 18px; background: var(--bg-elev); }

/* QR code */
.iam-qr-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 1.25rem;
}
.iam-qr-box {
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  margin-bottom: 0.75rem;
}
.iam-qr-box img { display: block; width: 180px; height: 180px; }

.iam-secret-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%;
}
.iam-secret-key {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #6ee7b7;
  word-break: break-all;
  letter-spacing: 0.04em;
}
.iam-secret-copy {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
  font-family: var(--font);
}
.iam-secret-copy:hover { background: rgba(16, 185, 129, 0.22); }

/* Small helper info box (role badge, etc.) */
.iam-info-box {
  padding: 0.75rem 0.9rem;
  background: var(--bg-elev);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.iam-info-box strong { color: var(--text-primary); }
.iam-info-box code { color: var(--accent-1); font-family: var(--font-mono); }

/* Spinner */
.iam-spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Center loader (QR loading state) */
.iam-loader-screen {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: 1rem;
}
.iam-loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--accent-1);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* Security badge */
.iam-security-row {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; margin-top: 1.25rem;
  color: var(--text-dim); font-size: 0.72rem;
}
.iam-security-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-1); }

/* Help text under card */
.iam-help-text { text-align: center; font-size: 0.78rem; color: var(--text-dim); margin-top: 1rem; }
.iam-help-text a { color: var(--text-warn); text-decoration: none; }
.iam-help-text a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 480px) {
  .iam-card { padding: 1.5rem 1.25rem 1.5rem; border-radius: 20px; }
  .iam-logo-title { font-size: 1.3rem; }
}

/* =============================================================
   Public pages (Home / Privacy / Terms)
   Full-width marketing / legal pages that share the dark theme.
   ============================================================= */
.public-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* ── Top navbar ── */
.public-nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
}
.public-nav-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 1.25rem;
}
.public-brand {
  display: flex; align-items: center; gap: 0.65rem;
  text-decoration: none; color: #f8fafc;
}
.public-brand img { border-radius: 8px; }
.public-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.public-brand-text strong { font-size: 0.95rem; }
.public-brand-text small { font-size: 0.7rem; color: #94a3b8; }

.public-nav-links {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.public-nav-links a {
  color: #cbd5e1; text-decoration: none; font-size: 0.85rem; font-weight: 500;
  padding: 0.35rem 0.1rem; transition: color 0.15s;
}
.public-nav-links a:hover, .public-nav-links a.is-active { color: #34d399; }

.public-nav-cta {
  display: inline-flex; align-items: center;
  padding: 0.55rem 1.1rem; border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #6366f1);
  color: #0f172a; font-weight: 700; font-size: 0.85rem;
  text-decoration: none; transition: opacity 0.15s, transform 0.15s;
}
.public-nav-cta:hover { opacity: 0.95; transform: translateY(-1px); }

@media (max-width: 720px) {
  .public-nav-links { display: none; }
}

/* ── Hero ── */
.public-hero {
  text-align: center; padding: 3.5rem 0 2.5rem;
}
.public-eyebrow {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #34d399; padding: 0.3rem 0.7rem; border-radius: 999px;
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3);
}
.public-hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  font-weight: 800; line-height: 1.15; margin: 1.25rem 0 1rem;
  color: #f8fafc; letter-spacing: -0.01em;
}
.grad-text {
  background: linear-gradient(135deg, #34d399 0%, #a5b4fc 50%, #c4b5fd 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.public-lede {
  max-width: 720px; margin: 0 auto; color: #cbd5e1; font-size: 1.05rem; line-height: 1.6;
}
.public-hero-cta {
  display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.75rem;
}
.btn-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.85rem 1.6rem; border-radius: 12px;
  background: linear-gradient(135deg, #10b981, #14b8a6, #6366f1);
  color: #0f172a; font-weight: 700; font-size: 0.95rem; text-decoration: none;
  box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.6);
  transition: transform 0.15s, opacity 0.15s;
}
.btn-cta:hover { transform: translateY(-1px); opacity: 0.95; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.85rem 1.5rem; border-radius: 12px;
  background: rgba(30, 41, 59, 0.6); border: 1px solid #334155;
  color: #e2e8f0; font-weight: 600; font-size: 0.95rem; text-decoration: none;
  transition: background 0.15s;
}
.btn-ghost:hover { background: rgba(51, 65, 85, 0.6); }

/* ── Sections ── */
.public-section { padding: 3rem 0; }
.public-h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800;
  color: #f8fafc; text-align: center; margin: 0 0 0.5rem; letter-spacing: -0.01em;
}
.public-sub {
  max-width: 720px; margin: 0 auto 2rem; text-align: center;
  color: #94a3b8; font-size: 0.95rem; line-height: 1.6;
}
.public-sub code, .public-doc code {
  background: rgba(30, 41, 59, 0.8); padding: 0.1rem 0.4rem; border-radius: 4px;
  font-size: 0.85em; color: #a5b4fc; font-family: var(--font-mono);
}
.public-sub a { color: #34d399; }

.public-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.public-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.7));
  border: 1px solid #334155; border-radius: 16px; padding: 1.5rem;
  transition: transform 0.15s, border-color 0.15s;
}
.public-card:hover { transform: translateY(-2px); border-color: #475569; }
.public-card-icon { font-size: 1.6rem; margin-bottom: 0.5rem; }
.public-card h3 { font-size: 1.05rem; font-weight: 700; color: #f8fafc; margin: 0 0 0.4rem; }
.public-card p { font-size: 0.88rem; color: #cbd5e1; line-height: 1.55; margin: 0; }
.public-card code { background: rgba(15, 23, 42, 0.6); padding: 0.05rem 0.3rem; border-radius: 4px; font-size: 0.85em; color: #a5b4fc; }

/* ── Architecture diagram ── */
.public-diagram {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.55));
  border: 1px solid #334155; border-radius: 18px; padding: 1.5rem;
  margin: 0;
}
.public-diagram svg { width: 100%; height: auto; display: block; }
.public-diagram figcaption {
  text-align: center; color: #94a3b8; font-size: 0.85rem; margin-top: 1rem;
}

/* ── Connected apps list ── */
.public-app-list {
  list-style: none; padding: 0; margin: 0 auto; max-width: 760px;
  display: grid; gap: 0.6rem;
}
.public-app-list li {
  display: grid; grid-template-columns: 140px 1fr;
  align-items: baseline; gap: 0.75rem; padding: 0.9rem 1.1rem;
  background: rgba(30, 41, 59, 0.55); border: 1px solid #334155; border-radius: 12px;
}
.public-app-list strong { color: #f8fafc; }
.public-app-list code { color: #a5b4fc; font-size: 0.85rem; }
.public-app-list span { grid-column: 2; color: #94a3b8; font-size: 0.88rem; }
.public-app-list a.public-app-link {
  text-decoration: none; color: inherit;
  transition: opacity 0.15s;
}
.public-app-list a.public-app-link:hover {
  opacity: 0.85; text-decoration: underline;
}
@media (max-width: 540px) {
  .public-app-list li { grid-template-columns: 1fr; }
  .public-app-list span { grid-column: 1; }
}

/* ── CTA band ── */
.public-cta-band {
  text-align: center; margin: 2rem auto 3rem; padding: 2.5rem 1.5rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 20px;
}
.public-cta-band h2 { font-size: 1.6rem; font-weight: 800; color: #f8fafc; margin: 0 0 0.5rem; }
.public-cta-band p { color: #cbd5e1; max-width: 560px; margin: 0 auto 1.5rem; }

/* ── Legal / doc pages ── */
.public-doc { max-width: 860px; }
.public-doc-head { margin-bottom: 2rem; }
.public-doc-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800;
  color: #f8fafc; margin: 0.5rem 0 0.75rem; letter-spacing: -0.01em;
}
.public-toc {
  background: rgba(30, 41, 59, 0.5); border: 1px solid #334155;
  border-radius: 14px; padding: 1.1rem 1.4rem; margin: 1.5rem 0 2rem;
  display: grid; grid-template-columns: 140px 1fr; gap: 0.5rem 1.25rem;
}
.public-toc strong {
  grid-row: 1 / span 12; color: #a5b4fc; font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase; align-self: start;
}
.public-toc a {
  color: #cbd5e1; text-decoration: none; font-size: 0.9rem;
  padding: 0.2rem 0; border-bottom: 1px solid transparent;
}
.public-toc a:hover { color: #34d399; }
@media (max-width: 540px) {
  .public-toc { grid-template-columns: 1fr; }
  .public-toc strong { grid-row: auto; }
}

.public-doc section { padding: 1.5rem 0; border-top: 1px solid rgba(51, 65, 85, 0.4); }
.public-doc section:first-of-type { border-top: 0; }
.public-doc h2 {
  font-size: 1.25rem; font-weight: 700; color: #f8fafc; margin: 0 0 0.75rem;
}
.public-doc p, .public-doc li { color: #cbd5e1; line-height: 1.7; font-size: 0.95rem; }
.public-doc ul { padding-left: 1.3rem; }
.public-doc li { margin-bottom: 0.4rem; }
.public-doc strong { color: #f8fafc; }
.public-doc a { color: #34d399; }
.public-doc code { color: #a5b4fc; }

/* ── Footer ── */
.public-footer {
  margin-top: 3rem; border-top: 1px solid #334155;
  background: rgba(15, 23, 42, 0.5);
}
.public-footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 2.5rem 1.25rem 1.5rem;
  display: grid; grid-template-columns: 1.2fr 2fr; gap: 2rem;
}
.public-footer-brand { display: flex; gap: 0.85rem; align-items: flex-start; }
.public-footer-brand strong { color: #f8fafc; }
.public-footer-brand p { color: #94a3b8; font-size: 0.85rem; margin: 0.3rem 0 0; line-height: 1.5; }
.public-footer-brand code { color: #a5b4fc; font-size: 0.8rem; }

.public-footer-links {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.public-footer-links h4 {
  font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #a5b4fc; margin: 0 0 0.6rem;
}
.public-footer-links a, .public-footer-links span {
  display: block; color: #cbd5e1; text-decoration: none; font-size: 0.88rem;
  padding: 0.2rem 0;
}
.public-footer-links a:hover { color: #34d399; }
.public-footer-links span { color: #94a3b8; }

.public-footer-base {
  max-width: 1120px; margin: 0 auto; padding: 1rem 1.25rem;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  color: #64748b; font-size: 0.78rem;
}
.public-footer-base p { margin: 0; }

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