:root {
  --bg-page: #f3f4f6;
  --bg-surface: #ffffff;
  --bg-soft: #f9fafb;
  --primary: #16a34a;
  --primary-soft: #bbf7d0;
  --primary-dark: #15803d;
  --accent: #0ea5e9;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-subtle: #e5e7eb;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
}

/* RESET BASE */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #e5f3ff, #f9fafb 55%);
  color: var(--text-main);
}

/* TOPBAR */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(209, 213, 219, 0.6);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.7rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-main {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  background: linear-gradient(to right, #16a34a, #22c55e);
  -webkit-background-clip: text;
  color: transparent;
}

.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  gap: 0.4rem;
  flex: 1;
  justify-content: center;
}

.nav-link {
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.86rem;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}

.nav-link-active {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #15803d;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.45rem 0.95rem;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 16px 36px rgba(22, 163, 74, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* LAYOUT PAGINA */

.page-root {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.6rem 1.4rem 3rem;
}

.grid-main {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 1.4rem;
}

@media (max-width: 960px) {
  .grid-main {
    grid-template-columns: 1fr;
  }
  .main-nav {
    display: none;
  }
}

/* HERO */

.hero {
  background: radial-gradient(circle at top left, #dbeafe, #eff6ff);
  border-radius: 24px;
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, #a5b4fc, transparent 60%);
  opacity: 0.9;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.hero-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #16a34a;
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: 2.1rem;
}

.hero p {
  margin: 0;
  max-width: 420px;
  color: var(--text-muted);
  font-size: 0.96rem;
}

/* FILTRI HOME */

.home-filters {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.input {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  background: #ffffff;
  min-width: 0;
}

.select {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  background: #ffffff;
}

/* CARD OFFERTE */

.section-header {
  margin-top: 1.8rem;
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.section-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.deal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out,
    border-color 0.12s ease-out;
}

.deal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.18);
  border-color: rgba(59, 130, 246, 0.5);
}

.deal-img {
  height: 150px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.deal-discount-badge {
  position: absolute;
  bottom: 0.7rem;
  left: 0.7rem;
  background: rgba(15, 23, 42, 0.9);
  color: white;
  font-size: 0.8rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
}

.deal-body {
  padding: 0.8rem 0.9rem 0.9rem;
}

.deal-title {
  font-size: 0.98rem;
  margin: 0 0 0.25rem;
}

.deal-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}

.deal-prices {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.deal-price-current {
  font-weight: 700;
}

.deal-price-old {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* PANNELLO LATERALE HOME */

.panel {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.panel p {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* FORM GENERICHE / DASHBOARD */

.page-section {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 1.2rem;
}

.page-section h1,
.page-section h2 {
  margin-top: 0;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

@media (max-width: 720px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

textarea.input {
  border-radius: var(--radius-md);
}

/* TABELLINA ADMIN */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.table th,
.table td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.table th {
  font-weight: 600;
  color: var(--text-muted);
}

/* ALERT */

.alert {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  border: 1px solid var(--border-subtle);
  background: #f9fafb;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.alert-success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* FOOTER */

.footer {
  border-top: 1px solid rgba(209, 213, 219, 0.7);
  background: #ffffff;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.9rem 1.4rem 1.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-note {
  margin-top: 0.2rem;
}

/* MODALE */

.modal-root {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}

.modal-body {
  position: relative;
  max-width: 640px;
  width: 100%;
  margin: 0 1rem;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.4);
  padding: 1.1rem 1.3rem 1.2rem;
}

.modal-close {
  position: absolute;
  right: 0.8rem;
  top: 0.6rem;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
}

/* UTILITY */

.text-muted {
  color: var(--text-muted);
}

.mb-1 {
  margin-bottom: 0.3rem;
}

.mb-2 {
  margin-bottom: 0.7rem;
}
