/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f8fafc;
  min-height: 100vh;
  color: #1e293b;
}

/* ===== Header / Nav ===== */
.site-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
}

.site-logo-img {
  height: 44px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  color: #64748b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-links a:hover {
  background: #f1f5f9;
  color: #1a1a2e;
}

.nav-links a.active {
  background: #fef3c7;
  color: #92400e;
}

/* ===== Hamburger Menu (Mobile) ===== */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 200;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: #64748b;
  border-radius: 2px;
  transition: all 0.3s;
  margin: 5px 0;
}

.hamburger-btn.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5.5px);
}

.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5.5px);
}

@media (max-width: 768px) {
  .hamburger-btn { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 8px 16px 16px;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
  }
  .nav-links a:hover { background: #f1f5f9; }
  .site-header { padding: 0 16px; }
}

/* ===== Footer ===== */
.site-footer {
  background: #1e293b;
  padding: 48px 32px 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 40px;
  border-bottom: 1px solid #334155;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-logo {
  margin-bottom: 12px;
}

.footer-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
}

.footer-col h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 0;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #f59e0b;
}

.footer-bottom {
  padding: 20px 0;
  text-align: center;
}

.footer-bottom p {
  color: #64748b;
  font-size: 12px;
}

/* ===== Footer Responsive ===== */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .footer-inner { padding: 32px 16px; }
}

/* ===== User Menu / Auth ===== */
.user-menu {
  position: relative;
  margin-left: 8px;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.user-menu-btn:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.user-menu-btn.logged-in {
  border-color: #f59e0b;
  background: #fef3c7;
}

.user-avatar {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
  line-height: 1;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  padding: 16px;
  z-index: 1000;
}

.user-menu-dropdown.open {
  display: block;
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.auth-tab.active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Auth forms */
.user-menu-dropdown input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.user-menu-dropdown input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.auth-btn {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  background: #f59e0b;
  color: #fff;
  margin-top: 4px;
}

.auth-btn:hover { background: #d97706; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-btn-secondary {
  background: #f1f5f9;
  color: #64748b;
  margin-top: 12px;
}

.auth-btn-secondary:hover { background: #e2e8f0; color: #475569; }

.auth-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.auth-message {
  background: #f0fdf4;
  color: #16a34a;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.auth-link {
  display: block;
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 0 0;
  font-family: inherit;
  text-align: center;
  width: 100%;
}

.auth-link:hover { text-decoration: underline; }

/* Auth profile */
.auth-profile {
  text-align: center;
}

.auth-profile-name {
  font-weight: 700;
  font-size: 16px;
  color: #1e293b;
  margin-bottom: 2px;
}

.auth-profile-email {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.auth-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-badge-free { background: #f1f5f9; color: #64748b; }
.auth-badge-premium { background: #fef3c7; color: #92400e; }
.auth-badge-admin { background: #fee2e2; color: #dc2626; }

/* Responsive */
@media (max-width: 768px) {
  .user-menu-dropdown {
    width: calc(100vw - 32px);
    right: -8px;
  }
}

/* ===== Print ===== */
@media print {
  .site-header, .site-footer, .hamburger-btn, .user-menu { display: none !important; }
}
