/* ── DESIGN TOKENS ── */
:root {
  --void:    #f7f5f2;
  --surface: #ffffff;
  --panel:   #eeebe6;
  --rim:     #dedad3;
  --accent:  #7b5ea7;
  --soft:    #9b8ac4;
  --success: #2a9d74;
  --text:    #1c1917;
  --muted:   #78716c;
  --ff-mono: ui-monospace, 'SF Mono', 'Fira Code', monospace;
  --ff-sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.05);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── BODY ── */
body {
  background: var(--void);
  color: var(--text);
  font-family: var(--ff-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HEADER ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 1px solid var(--rim);
  background: var(--surface);
  position: relative;
}
.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  user-select: none;
}
.logo-icon { width: 36px; height: 36px; position: relative; flex-shrink: 0; }
.logo-icon svg { width: 36px; height: 36px; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text .brand {
  font-size: 1.4rem;
  font-family: var(--ff-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.header-badge {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(123,94,167,0.3);
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(123,94,167,0.06);
}
.center-logo { display: block; }
.mobile-center-logo {
  display: none;
  justify-content: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--rim);
  background: var(--surface);
}

/* ── NAV LINKS ── */
.account-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid var(--rim);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.account-link:hover { border-color: var(--soft); background: var(--panel); }
.account-link.active-page { border-color: rgba(123,94,167,0.45); color: var(--accent); }
.account-link .acct-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.auth-links { display: flex; align-items: center; gap: 6px; }
.auth-link {
  padding: 7px 16px;
  border: 1px solid var(--rim);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.auth-link:hover { border-color: var(--soft); background: var(--panel); }
.auth-link.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.auth-link.primary:hover { background: #6a4f92; border-color: #6a4f92; }
.logout-btn {
  padding: 7px 16px;
  border: 1px solid var(--rim);
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-family: var(--ff-sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.logout-btn:hover { border-color: #e05555; color: #e05555; background: rgba(224,85,85,0.05); }

/* ── HELP BUTTON & MODAL ── */
.help-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--rim);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.help-btn:hover { border-color: var(--soft); color: var(--accent); }
.help-overlay {
  position: fixed; inset: 0;
  background: rgba(28,25,23,0.55);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.help-overlay.open { opacity: 1; pointer-events: all; }
.help-modal {
  background: var(--surface);
  border: 1px solid var(--rim);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  max-width: 640px; width: 100%;
  max-height: 80vh; overflow-y: auto;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.2s;
}
.help-overlay.open .help-modal { transform: translateY(0); }
.help-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--rim);
  position: sticky; top: 0;
  background: var(--surface); z-index: 1;
  border-radius: 16px 16px 0 0;
}
.help-modal-header h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.help-close {
  width: 28px; height: 28px;
  border: none; background: transparent;
  color: var(--muted); font-size: 1.3rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s; line-height: 1;
}
.help-close:hover { color: var(--text); background: var(--panel); }
.help-modal-body { padding: 28px; }
.help-section { margin-bottom: 32px; }
.help-section:last-child { margin-bottom: 0; }
.help-section h3 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.help-section h3::after { content: ''; flex: 1; height: 1px; background: var(--rim); }
.help-section p { font-size: 0.875rem; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.help-section p:last-child { margin-bottom: 0; }
.help-section a { color: var(--accent); text-decoration: none; }
.help-section a:hover { text-decoration: underline; }

/* ── CORNER DECORATIONS ── */
.corner-deco { position: fixed; width: 60px; height: 60px; pointer-events: none; opacity: 0.06; z-index: 0; }
.corner-deco.tl { top: 0; left: 0; }
.corner-deco.br { bottom: 0; right: 0; transform: rotate(180deg); }
.corner-deco svg { width: 60px; height: 60px; }

.header-right { display: flex; align-items: center; gap: 10px; }

/* ── HAMBURGER ── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  border: 1px solid var(--rim);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  padding: 7px 8px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.hamburger-btn span {
  display: block;
  height: 1.5px;
  background: var(--muted);
  border-radius: 2px;
  transition: background 0.2s;
}
.hamburger-btn:hover span { background: var(--text); }

/* ── SIDEBAR ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(28,25,23,0.45);
  z-index: 2000;
}
.sidebar-overlay.open { display: block; }
.sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 280px;
  background: var(--surface);
  border-left: 1px solid var(--rim);
  box-shadow: -4px 0 24px rgba(0,0,0,0.08);
  z-index: 2001;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.sidebar.open { transform: translateX(0); }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--rim);
}
.sidebar-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.sidebar-close {
  width: 28px; height: 28px;
  border: none; background: transparent;
  color: var(--muted); font-size: 1.3rem;
  cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s; line-height: 1;
}
.sidebar-close:hover { color: var(--text); background: var(--panel); }
.sidebar-body { display: flex; flex-direction: column; padding: 16px 0; flex: 1; }
.sidebar-user {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 20px 16px;
  border-bottom: 1px solid var(--rim);
  margin-bottom: 8px;
}
.sidebar-user-name { font-size: 0.92rem; color: var(--text); font-weight: 600; }
.sidebar-user-email { font-size: 0.75rem; color: var(--muted); }
.sidebar-link {
  display: block;
  padding: 12px 20px;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: color 0.15s, background 0.15s;
}
.sidebar-link:hover { color: var(--text); background: var(--panel); }
.sidebar-link-primary { color: var(--accent); font-weight: 500; }
.sidebar-logout { color: #e05555; }
.sidebar-logout:hover { background: rgba(224,85,85,0.06); }
.sidebar-help { border-top: 1px solid var(--rim); margin-top: auto; color: var(--muted); }

/* ── LANG SWITCHER ── */
.lang-switcher {
  display: flex;
  align-items: center;
  border: 1px solid var(--rim);
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.lang-btn {
  padding: 5px 11px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.lang-btn:hover { color: var(--text); background: var(--panel); }
.lang-btn.active { color: var(--accent); background: rgba(123,94,167,0.08); font-weight: 600; }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--rim);
  background: var(--surface);
  padding: 48px 24px 24px;
  margin-top: 64px;
}
.site-footer-grid {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 40px 48px;
  align-items: start;
}
@media (max-width: 700px) {
  .site-footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .site-footer { padding: 36px 18px 20px; margin-top: 40px; }
  .site-footer-gdpr { text-align: left; }
}
.site-footer-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 10px;
}
.site-footer-desc, .site-footer-feedback-text {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}
.site-footer-feedback-text { margin-bottom: 10px; }
.site-footer-email {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.site-footer-email:hover { text-decoration: underline; }
.site-footer-bar {
  max-width: 960px;
  margin: 32px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--rim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer-copy, .site-footer-devby {
  font-size: 0.72rem;
  color: var(--muted);
}
.site-footer-devby a { color: var(--accent); text-decoration: none; }
.site-footer-devby a:hover { text-decoration: underline; }
.site-footer-privacy {
  font-size: 0.72rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer-privacy:hover { color: var(--text); }

/* ── RESPONSIVE HEADER ── */
@media (max-width: 600px) {
  .site-header { padding: 14px 18px; }
  .header-badge { display: none; }
  .center-logo { display: none; }
  .logo-text .brand { font-size: 1.2rem; }
  .mobile-center-logo { display: flex; }
  .account-link { display: none; }
  .logout-btn { display: none; }
  .auth-links { display: none; }
  .help-btn { display: none; }
  .hamburger-btn { display: flex; }
}
