/* ==========================================================================
   BiosSystem Unified Dark Design System
   Matches the dark purple/cyan aesthetic of the main landing page.
   ========================================================================== */

:root {
  /* ── Core Dark Palette ── */
  --bg:              #07080d;
  --bg-card:         #0d0f18;
  --bg-card-hover:   #111425;
  --bg-surface:      rgba(13, 15, 24, 0.85);

  --border:          rgba(255,255,255,0.07);
  --border-strong:   rgba(255,255,255,0.13);

  /* Brand Colors */
  --accent:          #7c5cfc;
  --accent-2:        #00d4ff;
  --accent-glow:     rgba(124, 92, 252, 0.18);
  --brand-primary:   #7c5cfc;
  --brand-hover:     #6a4edf;
  --brand-cyan:      #00d4ff;
  --brand-success:   #34C759;
  --brand-error:     #FF3B30;

  /* Typography */
  --text:            #f0f2ff;
  --text-main:       #f0f2ff;
  --text-muted:      rgba(240,242,255,0.55);
  --text-faint:      rgba(240,242,255,0.3);
  --text-secondary:  rgba(240,242,255,0.45);

  --font-head: 'Space Grotesk', 'Inter', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: 'Share Tech Mono', 'SF Mono', 'Roboto Mono', Menlo, monospace;

  --radius: 12px;

  /* Shadows */
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:    0 8px 24px rgba(0,0,0,0.6);
  --shadow-lg:    0 16px 40px rgba(0,0,0,0.8);
  --shadow-glass: 0 20px 60px rgba(0,0,0,0.5);

  /* Legacy aliases for backward-compat */
  --bg-primary:    var(--bg);
  --bg-secondary:  var(--bg-card);
  --border-light:  var(--border);
  --glass-border:  var(--border-strong);
  --neon-cyan:     var(--accent-2);
  --neon-red:      var(--brand-error);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Subtle noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Glassmorphism Utility ── */
.glass-effect, .glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-glass);
  border-radius: var(--radius);
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.font-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7,8,13,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.logo-text { color: var(--text); }

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
}

.btn-primary {
  background: var(--accent);
  color: #fff !important;
  border-color: rgba(255,255,255,0.15);
}
.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124,92,252,0.35);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted) !important;
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  color: var(--text) !important;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
}

.btn-nav {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  background: var(--accent);
  color: #fff !important;
  border-radius: 8px;
}
.btn-nav:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.btn-large {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.875rem;
  font-size: 1rem;
  border-radius: 8px;
}

/* ── Hero Section (for simple pages like shortener) ── */
.hero {
  padding: 10rem 2rem 5rem;
  text-align: center;
}

.hero-container {
  max-width: 1000px;
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  color: #fff;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input:focus {
  border-color: var(--accent);
  background: rgba(124,92,252,0.05);
  box-shadow: 0 0 0 3px rgba(124,92,252,0.15);
}

.form-group input::placeholder { color: var(--text-faint); }

/* ── SSO Divider ── */
.sso-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-faint);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}
.sso-divider::before,
.sso-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-strong);
}
.sso-divider:not(:empty)::before { margin-right: .5em; }
.sso-divider:not(:empty)::after { margin-left: .5em; }

/* ── OAuth Login Buttons ── */
.btn-oauth-google {
  background: #FFFFFF !important;
  color: #1F1F1F !important;
  border: 1px solid #DADCE0 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  font-weight: 500;
  border-radius: 8px;
}
.btn-oauth-google:hover {
  background: #F8F9FA !important;
  border-color: #C0C2C6 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.btn-oauth-apple {
  background: #000000 !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  font-weight: 500;
  border-radius: 8px;
}
.btn-oauth-apple:hover {
  background: #1C1C1E !important;
  border-color: rgba(255,255,255,0.3) !important;
  box-shadow: 0 2px 8px rgba(255,255,255,0.06);
}

/* ── Login Card / Gateway ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 460px;
  padding: 2.5rem;
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 1;
}

.login-header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Alerts ── */
.alert-msg {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
}
.alert-msg.error {
  background: rgba(255, 59, 48, 0.1);
  color: var(--brand-error);
  border: 1px solid rgba(255, 59, 48, 0.2);
}
.alert-msg.success {
  background: rgba(52, 199, 89, 0.1);
  color: var(--brand-success);
  border: 1px solid rgba(52, 199, 89, 0.2);
}

/* ── Partner Apps Tiles ── */
.partner-apps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.app-tile {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  text-decoration: none;
  transition: all 0.2s ease;
  color: var(--text);
}
.app-tile:hover {
  background: rgba(124,92,252,0.06);
  border-color: rgba(124,92,252,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.app-icon {
  width: 40px; height: 40px;
  background: rgba(124,92,252,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid rgba(124,92,252,0.2);
  flex-shrink: 0;
}

.app-info h4 { font-size: 0.9rem; color: var(--text); margin: 0; font-weight: 500; }
.app-info p { font-size: 0.75rem; color: var(--text-muted); margin: 2px 0 0 0; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }

th {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1rem;
  border-bottom: 1px solid var(--border-strong);
  letter-spacing: 1px;
  text-align: left;
}

td {
  padding: 1rem;
  color: var(--text);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }

/* ── Admin Panel ── */
.admin-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

/* ── Glow Orbs ── */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* ── Feature/Bento Grid ── */
.bento-grid-section {
  padding: 6rem 2rem;
}
.section-container {
  max-width: 1100px;
  margin: 0 auto;
}
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5px;
  margin-top: 3rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.bento-card {
  background: var(--bg-card);
  padding: 2.2rem;
  transition: background 0.2s;
  position: relative;
}
.bento-card:hover { background: var(--bg-card-hover); }

.bento-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(124,92,252,0.12);
  border: 1px solid rgba(124,92,252,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  color: var(--accent);
}
.bento-icon svg { width: 22px; height: 22px; }

.bento-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.bento-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.bento-wide {
  grid-column: span 3;
  display: flex;
  align-items: center;
  gap: 3rem;
}

/* ── Section Headers ── */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 1rem;
}
.section-header p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
  background: rgba(0,0,0,0.4);
}
.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-links a {
  color: var(--text-faint);
  text-decoration: none;
  margin-left: 1.5rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-muted); }

/* ── Animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.7s ease forwards;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.35s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Status Indicators ── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-success);
  box-shadow: 0 0 8px var(--brand-success);
  display: inline-block;
}
.status-dot.pulsing {
  animation: pulse 2s infinite;
}
.status-dot.error {
  background: var(--brand-error);
  box-shadow: 0 0 8px var(--brand-error);
}
@keyframes pulse {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Role/Status Badges (admin table) ── */
.role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.role-badge.admin  { background: rgba(124,92,252,0.15); color: var(--accent); border: 1px solid rgba(124,92,252,0.3); }
.role-badge.friend { background: rgba(0,212,255,0.1); color: var(--accent-2); border: 1px solid rgba(0,212,255,0.25); }
.role-badge.pending { background: rgba(255,189,0,0.1); color: #FFBD2E; border: 1px solid rgba(255,189,0,0.2); }

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.status-badge.approved { background: rgba(52,199,89,0.1); color: var(--brand-success); border: 1px solid rgba(52,199,89,0.25); }
.status-badge.pending  { background: rgba(255,189,0,0.1); color: #FFBD2E; border: 1px solid rgba(255,189,0,0.2); }
.status-badge.rejected { background: rgba(255,59,48,0.1); color: var(--brand-error); border: 1px solid rgba(255,59,48,0.25); }

.card-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(124,92,252,0.1);
  border: 1px solid rgba(124,92,252,0.2);
}
.card-badge.media { color: var(--accent-2); background: rgba(0,212,255,0.08); border-color: rgba(0,212,255,0.2); }
.card-badge.utilities { color: #FFBD2E; background: rgba(255,189,0,0.08); border-color: rgba(255,189,0,0.2); }
.card-badge.admin { color: var(--brand-error); background: rgba(255,59,48,0.08); border-color: rgba(255,59,48,0.2); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-wide { grid-column: span 2; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-links { display: none; }
  .hero-title { font-size: 2.2rem; }
  .hero-desc  { font-size: 1rem; }
  .hero-buttons { flex-direction: column; }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-wide { grid-column: span 1; }
  .footer-content { flex-direction: column; gap: 1rem; }
  .footer-links a { margin: 0 0.75rem; }
}
