@import url("fonts.css");

/* ════════════════════════════════════════════════════════════
   HEADER + GLOBALE — Tema "Emerald Noir"
   Allineato ai token di strain.css ()
════════════════════════════════════════════════════════════ */

/* ── Token condivisi (identici a strain.css) ── */
:root {
  --en-bg:        #070b09;
  --en-bg-2:      #0b120e;
  --en-glass:     rgba(255, 255, 255, 0.035);
  --en-line:      rgba(52, 211, 153, 0.18);
  --en-line-soft: rgba(255, 255, 255, 0.06);
  --en-em:        #34d399;
  --en-em-bright: #6ee7b7;
  --en-em-deep:   #059669;
  --en-em-glow:   rgba(52, 211, 153, 0.35);
  --en-text:      #e8f5ee;
  --en-text-dim:  rgba(232, 245, 238, 0.68);
  --en-radius:    14px;
  --en-shadow:    0 8px 32px rgba(0, 0, 0, 0.45);

  /* Header */
  --header-h: 72px;
  --header-bg: rgba(10, 16, 13, 0.88);
  --text-bright: var(--en-text);
  --text-muted:  var(--en-text-dim);
  --border-dim:  var(--en-line-soft);
}

/* ════════════════════════════════════════════════════════════
   ANIMAZIONI / SCROLLBAR
════════════════════════════════════════════════════════════ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

::-webkit-scrollbar { width: 11px; background: var(--en-bg-2); }
::-webkit-scrollbar-thumb {
  background: rgba(52, 211, 153, 0.25);
  border-radius: 10px;
  border: 2px solid var(--en-bg-2);
}
::-webkit-scrollbar-thumb:hover { background: rgba(52, 211, 153, 0.45); }
::-webkit-scrollbar-track { background: transparent; }

/* ════════════════════════════════════════════════════════════
   BASE GLOBALE
════════════════════════════════════════════════════════════ */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(52, 211, 153, 0.05), transparent 60%),
    var(--en-bg);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--en-text);
  padding-top: var(--header-h, 72px);
}

a { color: var(--en-em-bright); text-decoration: none; }
a:hover { color: var(--en-em); text-decoration: none; }

.hidden   { display: none !important; }
.pointer  { cursor: pointer; }
.noselect {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

.loader {
  border: 16px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  border-top-color: var(--en-em);
  border-right-color: var(--en-em-bright);
  border-bottom-color: var(--en-em);
  border-left-color: var(--en-em-bright);
  animation: spin 1s linear infinite;
}

/* ════════════════════════════════════════════════════════════
   HEADER / NAV
════════════════════════════════════════════════════════════ */
.home        { display: flex; flex-direction: column; }
.home_content{ height: 300px; display: flex; width: 100%; cursor: pointer; }
.home_form   { width: inherit; background-size: cover; background-position: right; }

/* ── Shell ── */
.HEADER {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background:
    radial-gradient(600px 120px at 30% -60px, rgba(52, 211, 153, 0.14), transparent 70%),
    var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--en-line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(110, 231, 183, 0.08);
}

/* ── Inner row ── */
.H_contents {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 28px;
  gap: 0;
}

/* ── Logo ── */
.H_logo {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 10px 0;
  flex-shrink: 0;
  margin-right: 8px;
}
.H_logo a { display: flex; align-items: center; height: 100%; }
.H_logo img {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.2));
}

/* ── Nav links — centrati in assoluto ── */
.H_links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 2px;
  pointer-events: auto;
}

/* ── Account wrapper — sempre a destra ── */
.H_account_wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.H_account_mobile { display: none; }

.H_menulinks { display: flex; align-items: center; gap: 2px; }

/* ── Menu links ── */
.menulink {
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  position: relative;
}

.menulink:hover {
  color: var(--text-bright);
  background: var(--en-glass);
}

.seedactive,
.recactive,
.reportsactive,
.guidesactive {
  color: var(--en-em-bright) !important;
  background: rgba(52, 211, 153, 0.10) !important;
}

.seedactive::after,
.recactive::after,
.reportsactive::after,
.guidesactive::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--en-em);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--en-em-glow);
}

.medicallink { color: var(--text-muted); }
.medactive,
.medicallink:hover {
  color: var(--en-em-bright);
  background: rgba(52, 211, 153, 0.10);
}

/* ════════════════════════════════════════════════════════════
   LANGUAGE DROPDOWN
════════════════════════════════════════════════════════════ */
.lang-dropdown-wrap { position: relative; flex-shrink: 0; margin-left: 10px; }

.lang-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-dim);
  background: var(--en-glass);
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.lang-dropdown-btn:hover,
.lang-dropdown-btn.lang-btn-open {
  background: rgba(52, 211, 153, 0.08);
  border-color: var(--en-line);
  color: var(--text-bright);
}

.lang-caret {
  color: currentColor;
  opacity: 0.6;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.lang-btn-open .lang-caret { transform: rotate(180deg); }

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 110px;
  background: rgba(11, 18, 14, 0.98);
  border: 1px solid var(--en-line);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--en-shadow);
  z-index: 2000;
  backdrop-filter: blur(12px);
}
.lang-dropdown-menu.lang-menu-open { display: block; }
.lang-dropdown-menu form { margin: 0; padding: 0; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 7px;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.lang-option:hover { background: var(--en-glass); color: var(--text-bright); }
a.lang-option { text-decoration: none; box-sizing: border-box; } /* il selettore lingua ora è un link (<a hreflang>) */
.lang-option-active { color: var(--en-em-bright) !important; }
.lang-check { margin-left: auto; color: var(--en-em); flex-shrink: 0; }
.lang-flag  { font-size: 1rem; line-height: 1; }
.lang-label { font-size: 0.8rem; }



/* ════════════════════════════════════════════════════════════
   HAMBURGER MENU (MOBILE)
════════════════════════════════════════════════════════════ */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: var(--en-glass);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  cursor: pointer;
  padding: 9px 10px;
  margin-left: auto;
  z-index: 1001;
  transition: background 0.15s ease;
}
.nav-hamburger:hover { background: rgba(52, 211, 153, 0.08); }
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
.nav-hamburger.open span { background: var(--en-em); }
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (<=768px)
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .H_links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    transform: none;
    width: 100%;
    height: auto;
    display: none;
    visibility: visible;
    pointer-events: none;
    background: rgba(7, 11, 9, 0.99);
    border-bottom: 1px solid var(--en-line);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 10px 14px 20px;
    gap: 4px;
    z-index: 999;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  }
  .H_links.nav-open { display: flex; pointer-events: auto; }

  .H_account_wrap {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  .H_account_mobile {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--border-dim);
  }
  .H_account_mobile .account-widget {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
  .H_account_mobile .account-link,
  .H_account_mobile .account-toggle {
    width: 100%;
    justify-content: center;
    padding: 11px 14px;
    font-size: 0.9rem;
    border-radius: 10px;
    box-sizing: border-box;
  }
  .H_account_mobile .account-name { max-width: none; }
  .H_account_mobile .account-menu {
    position: static;
    transform: translateY(-6px) scale(0.98);
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .H_account_mobile .account-menu::before { display: none; }
  .H_account_mobile .account-menu-open { transform: translateY(0) scale(1); }

  .H_menulinks {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
  }
  .menulink {
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 0.93rem;
    width: 100%;
    box-sizing: border-box;
  }
  .seedactive::after,
  .recactive::after,
  .reportsactive::after,
  .guidesactive::after { display: none; }

  .main { margin-top: 16px; }
}

/* ── Header compatto su schermi medi ── */
@media (max-width: 1050px) {
  .menulink { padding: 7px 11px; font-size: 0.84rem; }
  .account-link,
  .account-toggle { padding: 7px 13px; font-size: 0.78rem; }
  .account-widget { gap: 6px; }
}

@media (max-width: 900px) {
  .menulink { padding: 7px 9px; font-size: 0.8rem; }
  .account-link,
  .account-toggle { padding: 6px 11px; font-size: 0.75rem; }
  .H_account_wrap { gap: 8px; }
}