/* ========================================
   MatteMatica - Main Stylesheet
   Colors: #101930 (blue), #00D1B2 (teal), #FFFFFF (white)
   ======================================== */

:root {
  --primary-blue: #101930;
  --primary-teal: #00D1B2;
  --white: #FFFFFF;
  --light-gray: #F5F5F5;
  --text-dark: #2C3E50;
  --text-light: #7F8C8D;
  --border-color: #E0E0E0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 20px rgba(0, 209, 178, 0.2);
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-teal);
}

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

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 600;
  color: var(--primary-blue);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

/* ========================================
   LAYOUT CONTAINERS
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 60px 0;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
header {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span {
  color: var(--primary-teal);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
}

nav a {
  color: var(--white);
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
  color: var(--primary-teal);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: auto;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #1a2a4a 100%);
  color: var(--white);
  text-align: center;
  padding: 100px 20px;
}

.hero h1 {
  color: var(--white);
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero p {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 40px;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 1rem;
}

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

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

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

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

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

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

/* ========================================
   CARDS
   ======================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.cards-grid > p.text-center {
  grid-column: 1 / -1;
}

.card {
  background-color: var(--white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card h3 {
  color: var(--primary-blue);
  margin-bottom: 15px;
}

.card p {
  color: var(--text-light);
  margin-bottom: 20px;
}

.card-badge {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.badge-elementari {
  background-color: #e3f2fd;
  color: #1565c0;
}

.badge-medie {
  background-color: #f3e5f5;
  color: #6a1b9a;
}

.badge-superiori {
  background-color: #fff8e1;
  color: #f57f17;
}

.badge-universita {
  background-color: #ffebee;
  color: #c62828;
}

/* ========================================
   FORMS
   ======================================== */
.form-container {
  max-width: 600px;
  margin: 40px auto;
  background-color: var(--white);
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

label {
  font-weight: 600;
  color: var(--primary-blue);
  margin-bottom: 5px;
  display: block;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

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

textarea {
  min-height: 150px;
  resize: vertical;
}

.form-note {
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: italic;
}

.required {
  color: #c62828;
}

/* ========================================
   PRICING CARD
   ======================================== */
.pricing-card {
  background: linear-gradient(135deg, var(--primary-teal) 0%, #00b89f 100%);
  color: var(--white);
  padding: 40px;
  border-radius: 12px;
  margin: 40px 0;
  box-shadow: var(--shadow-hover);
}

.pricing-card h3 {
  color: var(--white);
  font-size: 1.8rem;
  margin-bottom: 25px;
}

.pricing-list {
  list-style: none;
  margin: 20px 0;
}

.pricing-list li {
  padding: 10px 0;
  padding-left: 30px;
  position: relative;
  font-size: 1.1rem;
}

.pricing-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: bold;
  color: var(--white);
}

.pricing-subtitle {
  font-size: 1.2rem;
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
  opacity: 0.95;
}

/* ========================================
   VIDEO CONTAINER
   ======================================== */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  margin-top: 20px;
  background-color: var(--light-gray);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light-gray);
  color: var(--text-light);
  font-size: 1.2rem;
  font-weight: 500;
}

/* ========================================
   REVIEWS
   ======================================== */
.review-item {
  background: white;
  padding: 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-teal);
}

.review-author {
  font-weight: 600;
  color: var(--primary-blue);
  margin-bottom: 10px;
}

.review-text {
  color: var(--text-dark);
  font-style: italic;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.review-stars {
  font-size: 1.3rem;
  color: gold;
  letter-spacing: 2px;
}

.no-reviews {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.no-reviews p {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* Rating input (form) */
.rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 5px;
  justify-content: center;
  font-size: 2rem;
}

.rating input {
  display: none;
}

.rating label {
  cursor: pointer;
  color: #ccc;
  transition: color 0.2s;
}

/* Hover delle stelle nel form */
.rating label:hover,
.rating label:hover ~ label {
  color: gold;
}

/* Selezione nel form */
.rating input:checked ~ label {
  color: gold;
}



/* ========================================
   FOOTER
   ======================================== */
footer {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 40px 0 20px;
  margin-top: 80px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: 20px;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 10px;
}

.footer-section a {
  color: var(--white);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-section a:hover {
  opacity: 1;
  color: var(--primary-teal);
}

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
  opacity: 0.7;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
  text-align: center;
}

.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

.hidden {
  display: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  
  .hero {
    padding: 60px 20px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  nav ul {
    display: none;
    flex-direction: column;
    gap: 15px;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--primary-blue);
    padding: 20px;
  }
  
  nav ul.active {
    display: flex;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* ========================================
   DARK MODE SUPPORT (Auto-detect)
   ======================================== */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #0a0f1a;
    color: #e0e0e0;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #00D1B2;
  }
  
  p, .card p {
    color: #b0b0b0;
  }
  
  .card {
    background-color: #1a2332;
    border-color: #2a3545;
  }
  
  .card h3 {
    color: #00D1B2;
  }
  
  .form-container {
    background-color: #1a2332;
  }
  
  input,
  textarea,
  select {
    background-color: #0a0f1a;
    color: #e0e0e0;
    border-color: #2a3545;
  }
  
  label {
    color: #00D1B2;
  }
  
  .review-item {
    background-color: #1a2332;
  }
  
  .review-author {
    color: #00D1B2;
  }
   
   .review-text {
    color: #e0e0e0; 
  }
  
  .video-placeholder {
    background-color: #1a2332;
    color: #7F8C8D;
  }
  
  .no-reviews p {
    color: #7F8C8D;
  }
}
