/* ============================================================
   FACEMESH — Global Stylesheet
   Shared across all pages. Page-specific styles live in
   each HTML file's <style> block.
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --bg:           #080808;
  --bg-2:         #111111;
  --bg-3:         #1a1a1a;
  --border:       rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);

  --text:         #f0f0f0;
  --text-muted:   #888888;
  --text-faint:   #444444;

  --accent:       #ffffff;
  --accent-dim:   rgba(255, 255, 255, 0.12);

  --danger:       #e05c5c;
  --success:      #4caf7d;

  --nav-height:   64px;
  --max-width:    1160px;
  --radius:       10px;
  --radius-sm:    6px;

  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease:         cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition:   180ms var(--ease);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  display: block;
  max-width: 100%;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p {
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  background: #d4d4d4;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--accent-dim);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
}

.btn-outline:hover {
  background: var(--accent-dim);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(224, 92, 92, 0.3);
}

.btn-danger:hover {
  background: rgba(224, 92, 92, 0.08);
}

.btn-lg {
  padding: 14px 30px;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 32px;
  transition: background var(--transition), border-bottom var(--transition);
}

.navbar.scrolled {
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.nav-logo img {
  height: 28px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--accent-dim);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-login {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.nav-login:hover {
  color: var(--text);
}

.nav-profile {
  font-size: 0.875rem;
  font-weight: 600;
  color: #080808;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transition: background var(--transition);
}

.nav-profile:hover { background: #e8e8e8; }

.nav-logout {
  width: 30px;
  height: 30px;
  background-color: #b91c1c;
  border: none;
  border-radius: 4px;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background-color var(--transition);
}

.nav-logout:hover { background-color: #dc2626; }

/* ── Section Layout ───────────────────────────────────────── */
.section {
  padding: 96px 32px;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.section-title {
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 48px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Form Elements ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
  font-family: var(--font);
  font-size: 0.95rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

/* ── Error / Alert ────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: none;
}

.alert.show {
  display: block;
}

.alert-error {
  background: rgba(224, 92, 92, 0.08);
  border: 1px solid rgba(224, 92, 92, 0.25);
  color: #e87070;
}

.alert-success {
  background: rgba(76, 175, 125, 0.08);
  border: 1px solid rgba(76, 175, 125, 0.25);
  color: #5abf8a;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 32px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.footer-logo img {
  height: 22px;
  width: auto;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ── Utility ──────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-faint   { color: var(--text-faint); }
.text-center  { text-align: center; }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-8        { gap: 8px; }
.gap-16       { gap: 16px; }

.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mt-32        { margin-top: 32px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }

.w-full       { width: 100%; }

/* ── Legal modal ──────────────────────────────────────────── */
.legal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 24px;
}

.legal-overlay.hidden { display: none; }

.legal-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.legal-card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.legal-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.legal-card-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.legal-card-close:hover { color: var(--text); background: var(--accent-dim); }

.legal-card-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.legal-card-body pre {
  font-family: var(--font);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--bg-3); border-radius: 3px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --nav-height: 100px; }

  .navbar {
    height: auto;
    padding: 0 20px;
    align-items: stretch;
  }

  .nav-inner {
    flex-wrap: wrap;
    padding: 10px 0 8px;
    row-gap: 0;
  }

  .nav-logo   { order: 1; align-self: center; }
  .nav-actions { order: 2; align-self: center; }

  .nav-links {
    order: 3;
    display: flex;
    width: 100%;
    padding: 6px 0 4px;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-top: 1px solid var(--border);
    justify-content: center;
  }

  .nav-links::-webkit-scrollbar { display: none; }

  .nav-links a {
    text-align: center;
    white-space: nowrap;
  }

  .nav-logo .nav-logo-img  { height: 40px !important; }
  .nav-logo .nav-logo-text { height: 30px !important; }

  .section { padding: 64px 20px; }
  .footer  { padding: 32px 20px; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}
