@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* =============================================
   BASE RESET
============================================= */
.cfv-checkout,
.cfv-auth-wrap,
.cfv-denied,
.cfv-player-wrap,
.cfv-checkout *,
.cfv-auth-wrap *,
.cfv-denied * {
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

.cfv-hidden { display: none !important; }

/* =============================================
   CHECKOUT CARD
============================================= */
.cfv-checkout {
  max-width: 480px;
  width: 100%;
  margin: 0 auto 32px;
  background: #fff;
  border: 1px solid rgba(28,181,212,.16);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(28,181,212,.10), 0 2px 8px rgba(0,0,0,.05);
}

/* ── Thumbnail ── */
.cfv-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #0d2b36;
  overflow: hidden;
}
.cfv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: .6;
}
.cfv-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cfv-thumb-overlay svg {
  width: 54px;
  height: 54px;
  stroke: #fff;
}

/* ── Body ── */
.cfv-checkout-body {
  padding: 24px;
}
.cfv-checkout-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: #0d2b36;
  line-height: 1.3;
}
.cfv-checkout-desc {
  margin: 0 0 18px;
  font-size: 14px;
  color: #5e7d89;
  line-height: 1.6;
}

/* ── Prezzo ── */
.cfv-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 22px;
}
.cfv-price-amount {
  font-size: 32px;
  font-weight: 700;
  color: #1cb5d4;
  line-height: 1;
}
.cfv-price-label {
  font-size: 12px;
  color: #8fa8b0;
}

/* =============================================
   LABEL + INPUT
============================================= */
.cfv-label,
.cfv-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #0d2b36;
  letter-spacing: .01em;
}

.cfv-input,
.cfv-field input[type="text"],
.cfv-field input[type="email"],
.cfv-field input[type="password"] {
  width: 100% !important;
  display: block;
  padding: 0 16px !important;
  height: 52px;
  min-height: 52px;
  font-size: 16px !important; /* 16px evita lo zoom su iOS */
  border: 1.5px solid rgba(28,181,212,.25) !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #0d2b36 !important;
  outline: none;
  box-shadow: none !important;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s, box-shadow .2s;
}

.cfv-input:focus,
.cfv-field input:focus {
  border-color: #1cb5d4 !important;
  box-shadow: 0 0 0 3px rgba(28,181,212,.12) !important;
}

.cfv-input {
  margin-bottom: 14px;
}

/* Email confirm badge */
.cfv-email-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(28,181,212,.07);
  border: 1px solid rgba(28,181,212,.2);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #0d2b36;
  word-break: break-all;
}
.cfv-email-confirm::before {
  content: '✉️';
  flex-shrink: 0;
}

/* Stripe card wrapper */
.cfv-card-wrap {
  border: 1.5px solid rgba(28,181,212,.22);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  margin-bottom: 16px;
  min-height: 52px;
}

/* =============================================
   BOTTONI
============================================= */
.cfv-btn-primary,
.cfv-btn-pay,
.cfv-btn-register {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  min-height: 54px;
  padding: 0 20px;
  border: 0 !important;
  border-radius: 14px !important;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;
  text-decoration: none;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cfv-btn-primary,
.cfv-btn-register {
  background: linear-gradient(135deg, #1cb5d4, #0c8aa1);
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(28,181,212,.35);
}

.cfv-btn-pay {
  background: #0d2b36;
  color: #fff !important;
  box-shadow: 0 4px 18px rgba(13,43,54,.22);
}

.cfv-btn-primary:hover,
.cfv-btn-pay:hover,
.cfv-btn-register:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.cfv-btn-primary:active,
.cfv-btn-pay:active,
.cfv-btn-register:active {
  transform: translateY(0);
  opacity: .85;
}

.cfv-btn-primary:disabled,
.cfv-btn-pay:disabled,
.cfv-btn-register:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* Messaggio stato */
.cfv-msg {
  min-height: 20px;
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}
.cfv-msg.error   { color: #dc2626; }
.cfv-msg.success { color: #16a34a; }

/* =============================================
   AUTH WRAP (login / register)
============================================= */
.cfv-auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 16px 40px;
  min-height: 100vh;
  background: linear-gradient(160deg, rgba(28,181,212,.04) 0%, #f8fbfd 100%);
}

.cfv-auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid rgba(28,181,212,.16);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(28,181,212,.10), 0 2px 8px rgba(0,0,0,.05);
}

.cfv-auth-header {
  padding: 32px 28px 22px;
  text-align: center;
  background: linear-gradient(160deg, rgba(28,181,212,.07) 0%, #fff 100%);
  border-bottom: 1px solid rgba(28,181,212,.10);
}
.cfv-auth-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #0d2b36;
  line-height: 1.25;
}
.cfv-auth-header p {
  margin: 0;
  font-size: 14px;
  color: #5e7d89;
  line-height: 1.5;
}

.cfv-auth-form {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cfv-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Password toggle */
.cfv-password-wrap {
  position: relative;
}
.cfv-password-wrap input {
  padding-right: 56px !important;
}
.cfv-eye-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #7c99a2;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* Alerts */
.cfv-alert {
  margin: 16px 28px 0;
  padding: 13px 16px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.5;
}
.cfv-alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}
.cfv-alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}

/* =============================================
   DENIED / ERRORE
============================================= */
.cfv-denied {
  max-width: 460px;
  margin: 0 auto;
  padding: 56px 20px;
  text-align: center;
}
.cfv-denied-icon {
  font-size: 52px;
  margin-bottom: 16px;
  display: block;
}
.cfv-denied h3 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  color: #0d2b36;
}
.cfv-denied p {
  margin: 0;
  font-size: 15px;
  color: #5e7d89;
  line-height: 1.6;
}

/* =============================================
   PLAYER VIDEO
============================================= */
.cfv-player-wrap {
  position: relative;
  padding-top: 56.25%;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  max-width: 960px;
  margin: 0 auto 32px;
  box-shadow: 0 8px 48px rgba(0,0,0,.25);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.cfv-player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.cfv-player-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  pointer-events: none;
}

/* =============================================
   ERRORE GENERICO
============================================= */
.cfv-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 11px;
  padding: 14px 18px;
  color: #dc2626;
  font-size: 14px;
  line-height: 1.5;
}

/* =============================================
   ADMIN BAR HIDE
============================================= */
body.cfv-page #wpadminbar { display: none !important; }
html.cfv-page { margin-top: 0 !important; }

/* =============================================
   MOBILE — 480px e sotto
============================================= */
@media (max-width: 480px) {

  /* Auth wrap: occupa tutto lo schermo senza padding laterale */
  .cfv-auth-wrap {
    padding: 0;
    background: #fff;
    min-height: 100vh;
    align-items: stretch;
  }

  .cfv-auth-card {
    border-radius: 0;
    border: none;
    box-shadow: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .cfv-auth-header {
    padding: 28px 20px 18px;
    border-radius: 0;
  }
  .cfv-auth-header h2 {
    font-size: 20px;
  }

  .cfv-auth-form {
    padding: 20px;
    gap: 16px;
    flex: 1;
  }

  .cfv-alert {
    margin: 12px 20px 0;
  }

  /* Input più grandi e touch-friendly */
  .cfv-input,
  .cfv-field input[type="text"],
  .cfv-field input[type="email"],
  .cfv-field input[type="password"] {
    height: 54px;
    font-size: 16px !important;
    border-radius: 13px !important;
    padding: 0 16px !important;
  }

  /* Bottoni full-height touch */
  .cfv-btn-primary,
  .cfv-btn-pay,
  .cfv-btn-register {
    height: 56px;
    min-height: 56px;
    font-size: 16px;
    border-radius: 14px !important;
  }

  /* Checkout card: rimuovi arrotondamenti laterali */
  .cfv-checkout {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    margin-bottom: 0;
  }

  .cfv-checkout-body {
    padding: 20px;
  }

  .cfv-checkout-title {
    font-size: 17px;
  }

  .cfv-price-amount {
    font-size: 28px;
  }

  /* Player: bordi zero su mobile */
  .cfv-player-wrap {
    border-radius: 0;
    margin: 0 0 0;
    box-shadow: none;
  }

  /* Denied page */
  .cfv-denied {
    padding: 40px 20px;
  }
  .cfv-denied-icon {
    font-size: 44px;
  }
  .cfv-denied h3 {
    font-size: 19px;
  }
}

/* =============================================
   MOBILE — 360px e sotto (schermi molto piccoli)
============================================= */
@media (max-width: 360px) {
  .cfv-auth-header h2 { font-size: 18px; }
  .cfv-auth-form { padding: 16px; gap: 14px; }
  .cfv-alert { margin: 10px 16px 0; }
  .cfv-btn-primary,
  .cfv-btn-pay,
  .cfv-btn-register { font-size: 15px; }
}

/* =============================================
   TABLET — 481px a 768px
============================================= */
@media (min-width: 481px) and (max-width: 768px) {
  .cfv-auth-wrap {
    padding: 16px 12px 40px;
  }
  .cfv-auth-card {
    border-radius: 18px;
  }
  .cfv-auth-header {
    padding: 26px 22px 18px;
  }
  .cfv-auth-form {
    padding: 22px;
  }
  .cfv-alert {
    margin: 14px 22px 0;
  }
  .cfv-checkout-body {
    padding: 20px;
  }
}
