/* Skimmenthal -- design system condiviso tra tutte le pagine pubbliche.
   Palette/tipografia concordate: dark, accento giallo/oro, verde semaforo
   riusato come colore di stato reale (vedi badge-semaforo). */

:root {
  --bg: #0A0A0A;
  --surface: #1A1A1A;
  --surface-border: #2A2A2A;
  --accent: #F5C518;
  --accent-ink: #1A1500; /* testo scuro leggibile sopra lo sfondo giallo */
  --text: #FFFFFF;
  --text-muted: #A3A3A3;

  --semaforo-verde: #22C55E;
  --semaforo-giallo: #F5C518;
  --semaforo-rosso: #EF4444;
  --semaforo-nero: #6B7280;

  --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --container-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

p {
  margin: 0;
}

/* Focus visibile da tastiera, mai per click col mouse */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 720px) {
  .nav-links-static {
    display: none;
  }
}

@media (max-width: 480px) {
  .site-header .container {
    height: auto;
    flex-wrap: wrap;
    row-gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .header-actions {
    gap: 8px;
  }

  .logo {
    font-size: 18px;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-solid:hover {
  opacity: 0.9;
}

.btn-outline {
  background: transparent;
  border-color: var(--surface-border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

/* ---------- Pills / badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--semaforo-verde);
  flex-shrink: 0;
}

.badge-semaforo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-semaforo::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-semaforo.verde {
  background: rgba(34, 197, 94, 0.12);
  color: var(--semaforo-verde);
  border-color: rgba(34, 197, 94, 0.35);
}
.badge-semaforo.verde::before { background: var(--semaforo-verde); }

.badge-semaforo.giallo {
  background: rgba(245, 197, 24, 0.12);
  color: var(--semaforo-giallo);
  border-color: rgba(245, 197, 24, 0.35);
}
.badge-semaforo.giallo::before { background: var(--semaforo-giallo); }

.badge-semaforo.rosso {
  background: rgba(239, 68, 68, 0.12);
  color: var(--semaforo-rosso);
  border-color: rgba(239, 68, 68, 0.35);
}
.badge-semaforo.rosso::before { background: var(--semaforo-rosso); }

.badge-semaforo.nero {
  background: rgba(107, 114, 128, 0.12);
  color: var(--semaforo-nero);
  border-color: rgba(107, 114, 128, 0.35);
}
.badge-semaforo.nero::before { background: var(--semaforo-nero); }

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 80px;
  text-align: center;
}

.hero-headline {
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: -0.02em;
  max-width: 880px;
  margin: 24px auto 0;
}

.hero-headline .accent {
  color: var(--accent);
}

.hero-subtitle {
  margin: 24px auto 0;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 18px;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ---------- Sezioni / card ---------- */

.section {
  padding: 64px 0;
}

.section-heading {
  text-align: center;
  margin-bottom: 48px;
}

.section-heading h1,
.section-heading h2 {
  font-size: clamp(28px, 4vw, 38px);
}

.section-heading p {
  color: var(--text-muted);
  font-size: 16px;
  margin-top: 12px;
}

.servizi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 28px;
}

.card-servizio {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-servizio-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(245, 197, 24, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.card-servizio h3 {
  font-size: 20px;
}

.card-servizio p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.card-servizio-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.card-servizio-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.card-servizio-placeholder {
  opacity: 0.55;
}

.card-servizio-placeholder .card-servizio-icon {
  background: rgba(255, 255, 255, 0.06);
}

.tag-prossimamente {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- Home "chi sono" ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text h2 {
  font-size: clamp(24px, 3vw, 32px);
}

.about-text p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-top: 16px;
}

.about-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-list li {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.5;
}

.about-list-secondary {
  color: var(--text-muted);
  font-size: 14px;
  background: transparent;
  border-style: dashed;
}

.about-list-secondary a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 800px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Contatti ---------- */

.contact-card {
  max-width: 560px;
  margin: 0 auto;
}

.contact-success {
  color: var(--semaforo-verde);
  font-size: 15px;
  text-align: center;
  padding: 8px 0;
}

.contact-privacy {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 16px;
  text-align: center;
}

/* ---------- Blog ---------- */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
}

.card-post {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.card-post h2 {
  font-size: 22px;
}

.card-post h2 a {
  color: var(--text);
  text-decoration: none;
}

.card-post h2 a:hover {
  color: var(--accent);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-date {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lang-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 13px;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.04);
}

.post-excerpt {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.post {
  max-width: 680px;
  margin: 0 auto;
}

.post-heading {
  text-align: left;
}

.post-heading h1 {
  font-size: clamp(28px, 4vw, 40px);
}

.post-heading .post-meta {
  margin-top: 10px;
}

.post-body {
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
}

.post-body p {
  margin-top: 20px;
}

.post-body p:first-child {
  margin-top: 0;
}

.post-body h2 {
  font-size: 26px;
  margin-top: 40px;
}

.post-body h3 {
  font-size: 21px;
  margin-top: 32px;
}

.post-body ul,
.post-body ol {
  color: var(--text);
  margin-top: 20px;
  padding-left: 24px;
  line-height: 1.75;
}

.post-body li + li {
  margin-top: 8px;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(245, 197, 24, 0.4);
}

.post-body a:hover {
  text-decoration-color: var(--accent);
}

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 32px auto;
  border-radius: var(--radius);
}

.post-body blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

.post-body code {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.9em;
}

.post-body pre {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 20px;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-back {
  margin-top: 48px;
}

.post-back a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
}

.post-back a:hover {
  color: var(--accent);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--surface-border);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* ---------- Form (login/register) ---------- */

.auth-shell {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.auth-card .auth-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.15s ease;
}

.field input:focus-visible {
  border-color: var(--accent);
}

.field textarea {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.15s ease;
}

.field textarea:focus-visible {
  border-color: var(--accent);
}

.auth-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-border);
}

.auth-footer-link {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ---------- App shell (dashboard / servizio) ---------- */

.app-main {
  padding: 48px 0 80px;
}

.page-heading {
  margin-bottom: 32px;
}

.page-heading h1 {
  font-size: clamp(26px, 4vw, 34px);
}

.page-heading p {
  color: var(--text-muted);
  margin-top: 8px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.field select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
}

.field select:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.field select:focus-visible,
.field input:focus-visible {
  border-color: var(--accent);
}

/* ---------- Servizio Trova Medico ---------- */

.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  align-items: end;
}

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.autocomplete-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-body);
}

.autocomplete-item:hover,
.autocomplete-item:focus-visible {
  background: rgba(245, 197, 24, 0.1);
}

.autocomplete-empty {
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.search-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.search-feedback {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.results-empty {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 16px;
}

.medico-result {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
}

.medico-result-info {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.medico-result-address {
  color: var(--text-muted);
  font-size: 14px;
}

.subscriptions-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subscription-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.subscription-zone {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.subscription-highlight {
  border-color: var(--accent);
  background: rgba(245, 197, 24, 0.08);
}

.empty-state {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 16px;
}

/* ---------- Dashboard ---------- */

.servizio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
}

.servizio-row-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.servizio-row-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(245, 197, 24, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.servizio-row h3 {
  font-size: 17px;
}

.servizio-row p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}
