/* ============================================================
   FLAMINGSERVICES HUB — shared chrome for login/projects pages
   Tokens + components per /flamingservices.com/DESIGN-SYSTEM.md
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Poppins', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --bg-base: #0d0d0d;
  --bg-surface: rgba(255, 255, 255, 0.03);
  --bg-elevated: rgba(255, 255, 255, 0.06);
  --bg-menu: #1a1a1a;

  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --text-muted: #4b5563;

  --border: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.03);
  --border-hover: rgba(255, 255, 255, 0.12);

  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-muted: rgba(249, 115, 22, 0.10);
  --ember: #ef4444;
  --accent-gradient: linear-gradient(135deg, #f97316 0%, #ef4444 100%);

  --success: #22c55e;
  --success-muted: rgba(34, 197, 94, 0.12);
  --warning: #eab308;
  --warning-muted: rgba(234, 179, 8, 0.12);
  --danger: #ef4444;

  --shadow-flame: 0 0 20px rgba(249, 115, 22, 0.3);
  --shadow-flame-lg: 0 0 40px rgba(249, 115, 22, 0.4);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-base);
  color: #f3f4f6;
  font-family: var(--font-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
::selection { background: rgba(249, 115, 22, 0.3); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: white; }
.brand-text { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: #fff; }
.brand-highlight { color: var(--accent); }

/* ---------- buttons ---------- */
/* §7: base = secondary button (white/5, gray-100 text); .btn-accent = primary
   gradient (glow + scale on hover ONLY, no resting shadow — matches panel). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-family: inherit;
  font-size: 0.875rem; font-weight: 500; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05); color: #f3f4f6; cursor: pointer; transition: all 0.2s;
}
.btn:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.15); color: #f3f4f6; }
.btn-accent { background: var(--accent-gradient); color: #fff; border: none; }
.btn-accent:hover { box-shadow: var(--shadow-flame); transform: scale(1.05); }
.btn-ghost { background: transparent; border: none; color: var(--text-secondary); }
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,0.05); }
.btn-small { padding: 0.35rem 0.85rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- app nav (logged-in chrome, 58px sticky) ---------- */
.app-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.app-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; height: 58px;
  display: flex; align-items: center; gap: 1.5rem;
}
.app-nav .nav-links { display: flex; align-items: center; gap: 0.125rem; flex: 1; }
.nav-link {
  padding: 0.375rem 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text-tertiary);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: #d1d5db; background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--accent); background: rgba(249, 115, 22, 0.10); }
.app-nav .nav-right { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }

/* user menu */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm); background: transparent; border: none;
  cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.user-menu-btn:hover { background: rgba(255,255,255,0.05); }
.avatar {
  width: 28px; height: 28px; border-radius: 999px; background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.75rem; font-weight: 500;
}
.user-menu-btn .uname { font-size: 0.875rem; font-weight: 500; color: #d1d5db; }
.user-menu-btn .chev { color: var(--text-tertiary); display: flex; }
.dropdown {
  position: absolute; top: calc(100% + 0.5rem); right: 0; width: 208px;
  background: var(--bg-menu); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
  overflow: hidden; z-index: 60; display: none;
}
.dropdown.open { display: block; }
.dropdown .dd-head { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.dropdown .dd-head .n { font-size: 0.875rem; font-weight: 600; color: #fff; }
.dropdown .dd-head .e { font-size: 0.75rem; color: var(--text-tertiary); word-break: break-all; }
.dropdown a, .dropdown button.dd-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
  padding: 0.6rem 1rem; font-size: 0.85rem; font-family: inherit;
  color: var(--text-secondary); background: none; border: none; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.dropdown a:hover, .dropdown button.dd-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.dropdown .danger { color: var(--danger); }
.dropdown .danger:hover { color: #f87171; }

@media (max-width: 640px) {
  .user-menu-btn .uname { display: none; }
  .app-nav .nav-links { gap: 0; }
}

/* ---------- mobile hamburger + dropdown nav (app-nav) ---------- */
.nav-hamburger {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; border-radius: var(--radius-sm);
}
.nav-hamburger:hover { color: #fff; background: rgba(255,255,255,0.05); }
.mobile-nav-menu {
  display: none; flex-direction: column; gap: 0.25rem;
  padding: 0.5rem 1.5rem 0.85rem; background: var(--bg-menu);
  border-bottom: 1px solid var(--border);
}
.mobile-nav-menu.open { display: flex; }
.mobile-nav-link {
  display: block; padding: 0.7rem 0.75rem; min-height: 44px;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 500;
}
.mobile-nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.mobile-nav-link.active { color: var(--accent); background: rgba(249,115,22,0.10); }

@media (max-width: 768px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .app-nav .nav-links { display: none; }
  .nav-hamburger { display: inline-flex; }
  /* Project/service cards stack cleanly on phones */
  .cards-grid { grid-template-columns: 1fr; gap: 1rem; }
  /* Comfortable auth padding on small screens */
  .auth-card { padding: 1.5rem; }
}
@media (max-width: 360px) {
  .input-code { letter-spacing: 0.35em; font-size: 1.1rem; }
}

/* ---------- auth card (login / 2FA) ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; position: relative; overflow: hidden;
}
.auth-glow {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: rgba(249, 115, 22, 0.05); border-radius: 9999px; filter: blur(64px);
  pointer-events: none;
}
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 28rem;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  border-radius: var(--radius-lg); padding: 2rem;
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 2rem; }
.auth-logo .brand-text { font-weight: 700; font-size: 1.5rem; }
/* Panel login uses gradient text for the suffix — match it 1:1 on the auth card. */
.auth-logo .brand-highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.auth-card h1 {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  color: #fff; text-align: center; margin-bottom: 0.5rem;
}
.auth-sub { font-size: 0.95rem; color: var(--text-secondary); text-align: center; margin-bottom: 2rem; }

.field { margin-bottom: 1.1rem; }
.label { display: block; font-size: 0.875rem; font-weight: 500; color: #d1d5db; margin-bottom: 0.375rem; }
.input {
  width: 100%; padding: 0.625rem 1rem; font-size: 1rem; font-family: inherit;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm); color: #f3f4f6; transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--text-tertiary); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.input-code {
  font-family: var(--font-mono); font-size: 1.25rem; letter-spacing: 0.5em;
  text-align: center; padding-left: 0.5em; /* offset letter-spacing trailing gap */
}

.auth-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-secondary); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.auth-row a { font-size: 0.82rem; color: var(--text-secondary); transition: color 0.15s; }
.auth-row a:hover { color: var(--accent); }

.auth-alt { text-align: center; font-size: 0.85rem; color: var(--text-secondary); margin-top: 1.5rem; }
.auth-alt a { color: var(--accent); font-weight: 600; }
.auth-alt a:hover { color: var(--accent-hover); }

.form-error {
  display: none; padding: 0.65rem 1rem; margin-bottom: 1.1rem;
  background: rgba(239, 68, 68, 0.10); border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm); color: #f87171; font-size: 0.82rem;
}
.form-error.show { display: block; }

/* ---------- page shell + cards (projects) ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.page-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: #fff; }
.page-sub { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.25rem; }
.section-label {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary); margin: 2.25rem 0 1rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.section-label .line { flex: 1; height: 1px; background: var(--border); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.proj-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; transition: all 0.3s;
  backdrop-filter: blur(24px); position: relative; overflow: hidden;
}
.proj-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-gradient); opacity: 0; transition: opacity 0.3s;
}
.proj-card:hover {
  background: var(--bg-elevated); border-color: var(--border-hover);
  transform: translateY(-2px); box-shadow: var(--shadow-card-hover);
}
.proj-card:hover::before { opacity: 1; }
.proj-icon {
  width: 48px; height: 48px; background: var(--accent-muted);
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1rem;
}
.proj-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; color: #fff; }
.proj-card p { color: rgba(255,255,255,0.5); font-size: 0.85rem; line-height: 1.6; margin-bottom: 1.1rem; }
.proj-badge {
  display: inline-flex; font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.55rem;
  border-radius: 5px; margin-bottom: 0.65rem;
}
.badge-live { background: var(--success-muted); color: var(--success); }
.badge-beta { background: var(--warning-muted); color: var(--warning); }
.badge-new { background: var(--accent-muted); color: var(--accent); }
.badge-private { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--border); }
.proj-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; font-weight: 600; color: var(--accent); transition: all 0.2s;
}
.proj-link:hover { color: var(--accent-hover); gap: 0.5rem; }

.empty-card {
  border: 1px dashed var(--border-hover); border-radius: var(--radius-lg);
  padding: 3rem 1.5rem; text-align: center; color: var(--text-tertiary);
  background: var(--bg-surface);
}
.empty-card .big { font-size: 2rem; margin-bottom: 0.75rem; }
.empty-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }
.empty-card p { font-size: 0.85rem; }

/* ---------- footer ---------- */
.site-footer {
  padding: 2rem 1.5rem; text-align: center; color: rgba(255,255,255,0.25);
  font-size: 0.82rem; border-top: 1px solid var(--border);
}
.site-footer a { color: rgba(255,255,255,0.4); transition: color 0.2s; }
.site-footer a:hover { color: var(--accent); }

/* ---------- misc ---------- */
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff; border-radius: 999px; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeUp 0.6s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
