/* ====================================
   RESET & VARIABILI
   ==================================== */

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

:root {
  /* Colori principali */
  --primary-color: #fb4b39;
  --secondary-color: #181e2b;
  --background: #f2f4f8;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Navbar */
  /*--nav-bg: #0d1117; colore per la navbar più scuro */
  --nav-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --nav-bg-start: #1e293b;
  --nav-bg-end: #0f172a;
  /*--nav-accent: #f2460d; colore per la navbar più arancione */
  --nav-accent: var(--primary-color, #e74c3c);
  --nav-link-color: rgba(255, 255, 255, 0.55);
  ;
  --nav-link-hover-color: #e2e8f0;
  --nav-active-bg: rgba(242, 70, 13, 0.12);

  /* Spaziature */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Bordi */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Ombre */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

/* ====================================
   LAYOUT BASE
   ==================================== */

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

.container-sm {
  max-width: 600px;
}

.container-lg {
  max-width: 1400px;
}

/* ====================================
   HEADER & NAVIGATION
   ==================================== */

header {
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

.nav-links a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

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

/* ====================================
   BUTTONS
   ==================================== */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #e63d2b;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #64748b;
  color: white;
}

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

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

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

/* ====================================
   FORMS
   ==================================== */

.form-group {
  margin-bottom: var(--spacing-sm);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  color: var(--text-dark);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
  background-color: #ffffff;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
}

.form-file {
  padding: var(--spacing-sm);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.3s;
}

.form-file:hover {
  border-color: var(--primary-color);
}

/* ====================================
   CARDS
   ==================================== */

.card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--border);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
}

.card-body {
  margin-bottom: var(--spacing-md);
}

.card-footer {
  display: flex;
  gap: var(--spacing-sm);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border);
}

/* ====================================
   GRID SYSTEM
   ==================================== */

.grid {
  display: grid;
  gap: var(--spacing-md);
}

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

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ====================================
   ALERTS & MESSAGES
   ==================================== */

.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
  font-weight: 500;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ====================================
   MODAL
   ==================================== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-md);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  border-bottom: 2px solid var(--border);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.3s;
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: var(--spacing-md);
}

.modal-footer {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* ====================================
   LOADING SPINNER
   ==================================== */

.loading {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.loading-overlay.active {
  display: flex;
}

.loading-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

/* ====================================
   UTILITY CLASSES
   ==================================== */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

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

.mt-1 {
  margin-top: var(--spacing-sm);
}

.mt-2 {
  margin-top: var(--spacing-md);
}

.mt-3 {
  margin-top: var(--spacing-lg);
}

.mb-1 {
  margin-bottom: var(--spacing-sm);
}

.mb-2 {
  margin-bottom: var(--spacing-md);
}

.mb-3 {
  margin-bottom: var(--spacing-lg);
}

.p-1 {
  padding: var(--spacing-sm);
}

.p-2 {
  padding: var(--spacing-md);
}

.p-3 {
  padding: var(--spacing-lg);
}

.hidden {
  display: none;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

/* ====================================
   RESPONSIVE: TABLET
   ==================================== */

@media (min-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .navbar {
    padding: var(--spacing-md) 0;
  }
}

/* ====================================
   RESPONSIVE: DESKTOP
   ==================================== */

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--spacing-lg);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ====================================
   HOMEPAGE STYLES (index.html)
   ==================================== */

/* Hero Section */
.hero-section {
  padding-top: 2rem;
  padding-bottom: 4rem;
  background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #d4edda;
  color: #155724;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-title .highlight {
  color: var(--primary-color);
}

.hero-text {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
  }
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  background: var(--primary-color);
  color: white;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.btn-hero-primary:hover {
  background: #dc2626;
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  background: white;
  color: var(--text-dark);
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  border: 2px solid #e2e8f0;
  transition: all 0.3s;
}

.btn-hero-secondary:hover {
  background: #f8fafc;
}

/* Phone Mockup */
.phone-mockup {
  position: relative;
  width: 300px;
  margin: 0 auto;
}

.phone-frame {
  position: relative;
  background: #1a1a1a;
  border-radius: 3rem;
  padding: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8rem;
  height: 1.5rem;
  background: #1a1a1a;
  border-bottom-left-radius: 1.5rem;
  border-bottom-right-radius: 1.5rem;
  z-index: 10;
}

.phone-screen {
  position: relative;
  background: white;
  border-radius: 2.5rem;
  overflow: hidden;
  height: 600px;
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-decoration-1 {
  position: absolute;
  top: -2.5rem;
  left: -2.5rem;
  width: 10rem;
  height: 10rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 50%;
  filter: blur(60px);
}

.phone-decoration-2 {
  position: absolute;
  bottom: -2.5rem;
  right: -2.5rem;
  width: 10rem;
  height: 10rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  filter: blur(60px);
}

/* Features Section */
.features-section {
  padding: 5rem 0;
  background: white;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
}

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

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  text-align: center;
  padding: 1.5rem;
  border-radius: 1rem;
  transition: background 0.3s;
}

.feature-card:hover {
  background: #f8fafc;
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.feature-icon i {
  font-size: 1.875rem;
}

.feature-icon.red {
  background: #fee2e2;
  color: var(--primary-color);
}

.feature-icon.blue {
  background: #dbeafe;
  color: #2563eb;
}

.feature-icon.purple {
  background: #e9d5ff;
  color: #9333ea;
}

.feature-icon.green {
  background: #d1fae5;
  color: #10b981;
}

.feature-icon.yellow {
  background: #fef3c7;
  color: #f59e0b;
}

.feature-icon.teal {
  background: #ccfbf1;
  color: #14b8a6;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.feature-text {
  color: var(--text-light);
  line-height: 1.6;
}

/* How it Works Section */
.how-it-works-section {
  padding: 5rem 0;
  background: #f8fafc;
}

.steps-container {
  max-width: 800px;
  margin: 0 auto;
}

.step-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.step-number {
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  background: var(--primary-color);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.step-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.step-content p {
  color: var(--text-light);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* CTA Section */
.cta-section {
  padding: 5rem 0;
  background: linear-gradient(to bottom right, var(--primary-color), #dc2626);
  color: white;
  text-align: center;
}

.cta-container {
  max-width: 56rem;
  margin: 0 auto;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.cta-text {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
}

.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: white;
  color: var(--primary-color);
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.cta-button:hover {
  background: #f8fafc;
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  background: var(--secondary-color);
  color: white;
  padding: 3rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-brand span:first-child {
  font-size: 1.5rem;
}

.footer-text {
  color: #94a3b8;
}

.footer-column h3 {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #334155;
  text-align: center;
  color: #94a3b8;
}

