/* ========================================
   HEADER – Stile Minimalista Mobile
   Ispirato a Sylva / Dryàs
   ======================================== */

:root {
  /* Colors */
  --bg-white: #ffffff;
  --bg-mobile: #f5f5f0;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-active: rgba(0, 0, 0, 0.08);
  --border: #e5e5e5;
  --text-primary: #0d0d0d;
  --text-secondary: #676767;
  --qlik-green: #0d0d0d;
  --qlik-green-dark: #000000;

  --header-height: 80px;
  --header-height-mobile: 70px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-top: var(--header-height);
}

body.menu-open {
  overflow: hidden;
}

/* ========================================
   HEADER
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

/* ========================================
   LEFT: Logo
   ======================================== */
.header-left {
  display: flex;
  align-items: center;
  gap: 8px; /* più vicino */
  flex-shrink: 0;
}

.header-logo {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 2px; /* quasi attaccati */
  text-decoration: none;
}

.logo-img {
  height: 50px; /* più grande ma elegante */
  width: auto;
  display: block;
}

.logo-endria {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: #111827; /* NERO */
  line-height: 1;
}


/* ========================================
   CENTER: Desktop Navigation
   ======================================== */
.header-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.nav-link:hover {
  background: var(--bg-hover);
}

.nav-link.active {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px 2px 0 0;
}

/* ========================================
   RIGHT: Auth Buttons
   ======================================== */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* ========================================
   DESKTOP AUTH BUTTONS 
  
   ======================================== */

.btn-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 26px;
  border-radius: 0; /* stile squadrato */
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.25s ease;
  border: 2px solid var(--text-primary);
}

/* Accedi */
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: var(--text-primary);
  color: #ffffff;
}

/* Registrati */
.btn-primary {
  background: var(--text-primary);
  color: #ffffff;
}

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


/* ========================================
   MOBILE MENU BUTTON
   ======================================== */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.hamburger {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger:not(:last-child) {
  margin-bottom: 6px;
}

.mobile-menu-btn.active .hamburger:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ========================================
   MOBILE MENU FULL SCREEN  ✅ FIX
   ======================================== */
.mobile-menu {
  position: fixed;
  top: var(--header-height-mobile);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-height-mobile));
  background: var(--bg-mobile);
  z-index: 999;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 24px 32px;

  opacity: 0;
  transform: translateY(-20px);
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease;
}

.mobile-menu.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

/* ========================================
   MOBILE NAV
   ======================================== */
.mobile-nav {
  display: flex;
  flex-direction: column;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 20px 0;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-nav-link.active {
  font-weight: 600;
}

/* ========================================
   MOBILE AUTH
   ======================================== */
.mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
}

.btn-mobile {
  width: 100%;
  height: 56px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  border: 2px solid var(--text-primary);
  background: transparent;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* ========================================
   HEADER LEGAL – Back link
======================================== */

/* ===============================
   LEGAL BACK LINK – Lucide refined
================================ */

.legal-back-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 18px;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .2s ease;
}

.legal-back-link:hover{
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
}

.legal-back-link .back-icon{
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  body {
    padding-top: var(--header-height-mobile);
  }

  .header {
    height: var(--header-height-mobile);
    padding: 0 20px;
  }

  .header-nav,
  .header-auth {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .logo-img {
    height: 50px;
  }

  .logo-text {
    font-size: 22px;
  }

  .logo-product {
    font-size: 14px;
  }
}
