/**
 * Libro Landing Page - Frontend CSS
 * Basato su lp-anello - usa variabili CoreFramework
 */

/* ===== VARIABILI LAYOUT (font definiti in bizdash-common.css) ===== */
:root {
  --libro-max-width: 1200px;
  --libro-content-width: 800px;
}

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

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
}
body.libro-landing {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: var(--text-m);
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
}

/* ===== CONTAINER ===== */
.libro-container {
  width: 100%;
  max-width: var(--libro-max-width);
  margin: 0 auto;
  padding: 0 var(--space-l);
}
.libro-container--narrow {
  max-width: var(--libro-content-width);
}

/* ===== HERO ===== */
.libro-hero {
  background: linear-gradient(135deg, var(--tertiary-d-7) 0%, var(--tertiary-d-4) 100%);
  padding: var(--space-3xl) 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
}
.libro-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-2xl);
  align-items: center;
}
.libro-hero-content {
  color: var(--text-title-overlay);
}
.libro-hero-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 var(--space-l);
  color: var(--text-title-overlay);
}
.libro-hero-subtitle {
  font-size: var(--text-l);
  line-height: 1.7;
  margin: 0 0 var(--space-l);
  color: var(--light-80);
}
.libro-hero-alt {
  margin: var(--space-m) 0 0;
  font-size: var(--text-s);
  color: var(--light-60);
}
.libro-hero-alt a {
  color: var(--primary-l-2);
  text-decoration: none;
  transition: color 0.2s;
}
.libro-hero-alt a:hover {
  color: var(--primary-l-4);
}

/* Social Proof */
.libro-social-proof {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  margin-bottom: var(--space-l);
  flex-wrap: wrap;
}
.libro-social-proof--center {
  justify-content: center;
}
.libro-stars {
  display: flex;
  align-items: center;
  gap: 2px;
}
.libro-rating-text {
  font-size: var(--text-s);
  color: var(--light-70);
}

/* Hero Cover */
.libro-hero-cover {
  display: flex;
  justify-content: center;
  align-items: center;
}
.libro-cover-img {
  max-width: 100%;
  width: auto;
  max-height: 500px;
  border-radius: var(--radius-s);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 12px 24px -8px rgba(0, 0, 0, 0.3);
  animation: heroImageReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes heroImageReveal {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95) rotate(-2deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}
.libro-cover-img:hover {
  transform: scale(1.03);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Form */
.libro-hero-form {
  max-width: 400px;
}
.libro-hero-form .frm-fluent-form,
.libro-hero-form .fluentform {
  background: transparent !important;
}
.libro-hero-form .ff-el-input--content input[type="email"] {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  padding: var(--space-s) var(--space-m) !important;
  border-radius: var(--radius-m) !important;
  font-size: var(--text-m) !important;
}
.libro-hero-form .ff-el-input--content input[type="email"]::placeholder {
  color: var(--light-50) !important;
}
.libro-hero-form .ff-el-input--content input[type="email"]:focus {
  border-color: var(--primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px var(--primary-40) !important;
}
.libro-hero-form .ff-btn-submit {
  background: var(--primary) !important;
  color: white !important;
  border: none !important;
  padding: var(--space-s) var(--space-l) !important;
  border-radius: var(--radius-m) !important;
  font-weight: 600 !important;
  font-size: var(--text-m) !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  width: 100% !important;
  margin-top: var(--space-s) !important;
}
.libro-hero-form .ff-btn-submit:hover {
  background: var(--primary-d-2) !important;
  transform: translateY(-2px) !important;
}

/* ===== SECTION TITLES ===== */
.libro-section-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--text-title);
  margin: 0 0 var(--space-xl);
  text-align: center;
}
.libro-section-title--light {
  color: var(--text-title-overlay);
}

/* ===== INTRIGO ===== */
.libro-intrigo {
  padding: var(--space-3xl) 0;
  background: var(--bg-surface);
}
.libro-intrigo-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-title);
  margin: 0 0 var(--space-xl);
  text-align: center;
}
.libro-intrigo-content {
  font-size: var(--text-l);
  line-height: 1.8;
  color: var(--text-body);
}
.libro-intrigo-content p {
  margin: 0 0 var(--space-m);
}
.libro-intrigo-hook {
  font-family: var(--ff-serif);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--primary);
  margin: var(--space-xl) 0 0;
  text-align: center;
}

/* ===== PROMISES ===== */
.libro-promises {
  padding: var(--space-3xl) 0;
  background: var(--bg-body);
}
.libro-promises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-l);
}
.libro-promise-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-l);
  padding: var(--space-xl);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.libro-promise-card:hover {
  transform: translateY(-0.4rem);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}
.libro-promise-emoji {
  display: block;
  font-size: 2.5rem;
  margin-bottom: var(--space-m);
}
.libro-promise-title {
  font-family: var(--ff-sans);
  font-size: var(--text-l);
  font-weight: 600;
  color: var(--text-title);
  margin: 0 0 var(--space-s);
}
.libro-promise-desc {
  font-size: var(--text-s);
  color: var(--dark-60);
  margin: 0;
  line-height: 1.6;
}

/* ===== TESTIMONIALS ===== */
.libro-testimonials {
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, var(--tertiary-d-7) 0%, var(--tertiary-d-4) 100%);
}
.libro-testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-l);
}
.libro-testimonial-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-l);
  padding: var(--space-l);
}
.libro-testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-m);
}
.libro-testimonial-quote {
  font-family: var(--ff-serif);
  font-size: var(--text-m);
  font-style: normal;
  line-height: 1.7;
  color: var(--light-90);
  margin: 0 0 var(--space-m);
  border: none;
  padding: 0;
}
.libro-testimonial-quote strong {
  color: var(--primary-l-2);
}
.libro-testimonial-author {
  font-size: var(--text-s);
  color: var(--light-60);
  font-style: normal;
}

/* ===== AUTHOR ===== */
.libro-author {
  padding: var(--space-3xl) 0;
  background: var(--secondary-l-4);
}
.libro-author-card {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}
.libro-author-avatar {
  flex-shrink: 0;
  width: 11rem;
  height: 11rem;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 4px solid var(--secondary);
}
.libro-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.libro-author-name {
  font-family: var(--ff-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-title);
  margin: 0 0 var(--space-m);
}
.libro-author-bio {
  font-size: var(--text-m);
  line-height: 1.7;
  color: var(--text-body);
}
.libro-author-bio p {
  margin: 0 0 var(--space-s);
}

/* ===== BONUS ===== */
.libro-bonus {
  padding: var(--space-2xl) 0;
  background: linear-gradient(135deg, var(--primary-l-4) 0%, var(--secondary-l-4) 100%);
}
.libro-bonus-card {
  display: flex;
  align-items: center;
  gap: var(--space-l);
}
.libro-bonus-emoji {
  font-size: 3rem;
  flex-shrink: 0;
}
.libro-bonus-title {
  font-family: var(--ff-sans);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-title);
  margin: 0 0 var(--space-xs);
}
.libro-bonus-desc {
  font-size: var(--text-m);
  color: var(--text-body);
  margin: 0;
}

/* ===== ACQUISTA ===== */
.libro-acquista {
  padding: var(--space-3xl) 0;
  background: var(--bg-body);
}
.libro-acquista-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.libro-acquista-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-title);
  margin: 0 0 var(--space-s);
}
.libro-acquista-subtitle {
  font-size: var(--text-l);
  color: var(--dark-60);
  font-style: italic;
  margin: 0 0 var(--space-l);
}
.libro-acquista-note {
  font-size: var(--text-s);
  color: var(--dark-50);
  margin: var(--space-m) 0 0;
}

/* Buy Button */
.libro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-m) var(--space-xl);
  font-family: var(--ff-btn);
  font-size: var(--text-l);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-m);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.libro-btn--buy {
  background: #22c55e;
  color: white;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}
.libro-btn--buy:hover {
  background: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}
.libro-btn-price {
  background: rgba(255, 255, 255, 0.2);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-s);
  margin-left: var(--space-xs);
}

/* ===== FORMATS TABS ===== */
.libro-formats {
  max-width: 700px;
  margin: 0 auto;
}
.libro-formats-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-l);
  border-bottom: 2px solid var(--border-primary);
  padding-bottom: var(--space-s);
}
.libro-format-tab {
  padding: var(--space-s) var(--space-l);
  font-family: var(--ff-sans);
  font-size: var(--text-m);
  font-weight: 500;
  color: var(--dark-60);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
}
.libro-format-tab:hover {
  color: var(--primary);
}
.libro-format-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.libro-format-panel {
  display: none;
  text-align: center;
  padding: var(--space-l) 0;
}
.libro-format-panel.is-active {
  display: block;
}
.libro-format-title {
  font-family: var(--ff-sans);
  font-size: var(--text-l);
  font-weight: 600;
  color: var(--text-title);
  margin: 0 0 var(--space-s);
}
.libro-format-desc {
  font-size: var(--text-s);
  color: var(--dark-60);
  margin: 0 0 var(--space-l);
}
.libro-format-stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-s);
}
.libro-store-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-s) var(--space-m);
  font-size: var(--text-s);
  font-weight: 500;
  color: var(--text-body);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-m);
  text-decoration: none;
  transition: all 0.2s;
}
.libro-store-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-m);
}

/* ===== FINAL CTA ===== */
.libro-final {
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, var(--tertiary-d-4) 0%, var(--tertiary-d-7) 100%);
  text-align: center;
}
.libro-final-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--text-title-overlay);
  margin: 0 0 var(--space-m);
}
.libro-final-desc {
  font-size: var(--text-l);
  color: var(--light-80);
  margin: 0 0 var(--space-xl);
}
.libro-final-form {
  max-width: 400px;
  margin: 0 auto;
}
.libro-final-form .ff-el-input--content input[type="email"] {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}
.libro-final-form .ff-el-input--content input[type="email"]::placeholder {
  color: var(--light-50) !important;
}
.libro-final-form .ff-btn-submit {
  background: var(--primary) !important;
  color: white !important;
}

/* ===== FOOTER ===== */
.libro-footer {
  padding: var(--space-xl) 0;
  background: var(--tertiary-d-7);
  text-align: center;
}
.libro-footer p {
  font-size: var(--text-xs);
  color: var(--light-50);
  margin: 0;
}
.libro-footer a {
  color: var(--light-50);
  text-decoration: none;
  transition: color 0.2s;
}
.libro-footer a:hover {
  color: var(--primary-l-2);
}

/* ===== RESPONSIVE ===== */

/* Tablet (max-width: 1023px) */
@media (max-width: 1023px) {
  .libro-hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }
  .libro-hero-cover {
    order: -1;
  }
  .libro-cover-img {
    max-width: 280px;
  }
  .libro-hero-form {
    margin: 0 auto;
  }
  .libro-social-proof {
    justify-content: center;
  }
  .libro-author-card {
    flex-direction: column;
    text-align: center;
  }
  .libro-bonus-card {
    flex-direction: column;
    text-align: center;
  }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
  .libro-container {
    padding: 0 var(--space-m);
  }
  .libro-hero {
    padding: var(--space-2xl) 0;
    min-height: auto;
  }
  .libro-hero-title {
    font-size: var(--text-l);
  }
  .libro-cover-img {
    max-width: 200px;
  }
  .libro-promises-grid,
  .libro-testimonials-grid {
    grid-template-columns: 1fr;
  }
  .libro-author-avatar {
    width: 8rem;
    height: 8rem;
  }
  .libro-formats-tabs {
    flex-direction: column;
    align-items: stretch;
    border-bottom: none;
  }
  .libro-format-tab {
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 0;
  }
  .libro-format-tab.is-active {
    background: var(--primary-10);
    border-bottom-color: var(--border-primary);
  }
}

/* ===== DARK MODE OVERRIDES ===== */
html.cf-theme-dark .libro-intrigo {
  background: var(--bg-surface);
}
html.cf-theme-dark .libro-promises {
  background: var(--bg-body);
}
html.cf-theme-dark .libro-author {
  background: var(--tertiary-d-5);
}
html.cf-theme-dark .libro-bonus {
  background: linear-gradient(135deg, var(--tertiary-d-4) 0%, var(--primary-d-4) 100%);
}
html.cf-theme-dark .libro-acquista {
  background: var(--bg-body);
}
