/*
 * Rad Adaptive Client Portal — Shared Stylesheet
 *
 * Provides: CSS reset, design tokens (custom properties),
 * shared base styles, and reusable UI components.
 *
 * Consumed by: index.html, clients/admin/index.html, clients/purplelab/plan.html
 */

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --green:          #39c739;
  --green-dark:     #2fb32f;
  --green-10:       rgba(57, 199, 57, 0.10);
  --green-15:       rgba(57, 199, 57, 0.15);
  --green-20:       rgba(57, 199, 57, 0.20);
  --green-25:       rgba(57, 199, 57, 0.25);
  --green-glow-sm:  rgba(57, 199, 57, 0.25);
  --green-glow-md:  rgba(57, 199, 57, 0.30);
  --green-glow-lg:  rgba(57, 199, 57, 0.40);

  /* Semantic */
  --error:          #e05252;
  --error-bg:       rgba(224, 82, 82, 0.08);
  --error-border:   rgba(224, 82, 82, 0.25);

  /* Text */
  --text:           #ffffff;
  --text-muted:     rgba(255, 255, 255, 0.45);
  --text-dim:       rgba(255, 255, 255, 0.30);
  --text-faint:     rgba(255, 255, 255, 0.20);

  /* Surfaces */
  --surface:        rgba(255, 255, 255, 0.05);
  --surface-hover:  rgba(255, 255, 255, 0.09);
  --border:         rgba(255, 255, 255, 0.10);
  --border-subtle:  rgba(255, 255, 255, 0.08);

  /* Background */
  --bg: linear-gradient(145deg, #1a2a1a 0%, #2d3a2d 40%, #1e2e1e 100%);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
  min-height: 100vh;
  background: var(--bg);
}

/* Top accent bar */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--green);
  z-index: 100;
}

/* ── Logo Containers ───────────────────────────────────────────────────── */
.logo-wrap,
.logo-box {
  background: white;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.logo-wrap img,
.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Section Label ─────────────────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--green);
  color: #0d0d0d;
  border: none;
  border-radius: 10px;
  padding: 15px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.1px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  font-family: inherit;
  box-shadow: 0 4px 20px var(--green-glow-md);
  text-align: center;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--green-glow-lg);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  width: 100%;
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.30);
  color: rgba(255, 255, 255, 0.80);
}

.btn-ghost:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* ── Loading Screen ────────────────────────────────────────────────────── */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 16px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: ra-spin 0.8s linear infinite;
}

.loading-text {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font);
}

.loading-error {
  font-size: 13px;
  color: var(--error);
  font-family: var(--font);
  text-align: center;
  max-width: 320px;
  line-height: 1.5;
  display: none;
}

@keyframes ra-spin { to { transform: rotate(360deg); } }

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  margin-top: 28px;
  text-align: center;
}

.footer-confidential {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.7;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.footer-confidential a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-confidential a:hover { color: var(--green); }

/* ── Utility ───────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
