/* ===========================================
   BIVID TARIFAS - TEMA MORADO (RESIDENCIAL)
   Empresa: Fresca, joven, dinámica
   =========================================== */

:root {
  --color-primary: rgb(115, 57, 170);
  --color-primary-light: rgb(147, 89, 202);
  --color-primary-dark: rgb(83, 35, 138);
  --color-accent: #0096E9;
  --color-success: #10b981;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-bg: #f8fafc;
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(115, 57, 170, 0.15);
  --shadow-lg: 0 10px 40px rgba(115, 57, 170, 0.2);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  font-family: 'Montserrat', -apple-system, sans-serif;
  background: var(--gradient-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  position: relative;
}

/* Contenedor del fondo trazo - usa absolute en lugar de fixed para iframe */
body::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  background-image: url('/assets/images/trazo.png');
  background-repeat: no-repeat;
  background-size: 45%;
  background-position: right -80px bottom 50px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

/* ========== HEADER ========== */
.bivid-header {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0 clamp(20px, 5vw, 60px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.bivid-logo {
  flex-shrink: 0;
}

.bivid-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  transition: transform 0.3s ease;
}

.bivid-logo:hover img {
  transform: scale(1.05);
}

.bivid-title {
  text-align: center;
  flex: 1;
}

.bivid-title h1 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: #fff;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  margin: 4px 0 0;
  font-weight: 500;
}

/* ========== CONTAINER ========== */
.container {
  max-width: 1024px;
  margin: 30px auto;
  padding: 0 20px 100px;
  position: relative;
  z-index: 1;
}

/* ========== FORM SECTIONS ========== */
.form-section {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(20px, 5vw, 32px);
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }
.form-section:nth-child(4) { animation-delay: 0.4s; }

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

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
}

.section-header i {
  font-size: 1.5rem;
  color: var(--color-primary);
  background: linear-gradient(135deg, rgba(115, 57, 170, 0.1), rgba(115, 57, 170, 0.05));
  padding: 12px;
  border-radius: 12px;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* ========== PLANS GRID ========== */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.plan-card {
  position: relative;
  background: var(--gradient-primary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  cursor: pointer;
  text-align: center;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.plan-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.plan-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.plan-card:hover::before {
  opacity: 1;
}

.plan-card.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  border-color: var(--color-accent);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 40px rgba(0, 150, 233, 0.3);
}

.plan-card.destacado {
  border: 2px solid #fbbf24;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.3);
}

.badge-popular {
  position: absolute;
  top: -1px;
  right: -1px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1e293b;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 0 var(--radius-md) 0 var(--radius-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-speed {
  font-size: 1rem;
  font-weight: 700;
  opacity: 0.95;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.price-currency {
  font-size: 1.2rem;
  font-weight: 600;
}

.price-currency small {
  font-size: 0.7rem;
  opacity: 0.8;
}

.plan-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.feature-tag {
  background: rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.plan-check {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 1.2rem;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.plan-card.active .plan-check {
  opacity: 1;
  transform: scale(1);
}

/* ========== EXTRAS ========== */
.extras-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.extra-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #f8fafc;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
}

.extra-item:hover {
  background: #f1f5f9;
  border-color: var(--color-primary-light);
}

.extra-item input[type="checkbox"] {
  display: none;
}

.extra-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.extra-checkbox i {
  font-size: 0.75rem;
  color: #fff;
  opacity: 0;
  transform: scale(0);
  transition: all 0.25s ease;
}

.extra-item input:checked ~ .extra-checkbox {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.extra-item input:checked ~ .extra-checkbox i {
  opacity: 1;
  transform: scale(1);
}

.extra-content {
  flex: 1;
  min-width: 0;
}

.extra-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.extra-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 4px;
}

.extra-price {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.precio-anterior {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 0.85rem;
}

.precio-actual {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1rem;
}

.oferta-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.extra-oferta {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #fbbf24;
}

/* ========== TOTAL BAR ========== */
.total-bar {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.total-bar.sticky {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 640px;
  width: calc(100% - 40px);
  z-index: 100;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--color-primary);
}

.total-bar.pulse {
  animation: pulse-total 0.3s ease;
}

@keyframes pulse-total {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.02); }
}

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

.total-label {
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-weight: 500;
}

.total-amount {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-primary);
}

/* ========== CONTACT FORM ========== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-group input {
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.25s ease;
  background: #f8fafc;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(115, 57, 170, 0.1);
}

.form-group input::placeholder {
  color: #94a3b8;
}

/* Checkbox de privacidad */
.form-checkbox {
  margin: 24px 0;
}

.form-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.form-checkbox input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-custom i {
  font-size: 0.7rem;
  color: #fff;
  opacity: 0;
  transform: scale(0);
  transition: all 0.25s ease;
}

.form-checkbox input:checked ~ .checkbox-custom {
  background: var(--color-success);
  border-color: var(--color-success);
}

.form-checkbox input:checked ~ .checkbox-custom i {
  opacity: 1;
  transform: scale(1);
}

.form-checkbox a {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 500;
}

/* ========== SUBMIT BUTTON ========== */
.btn-submit {
  width: 100%;
  padding: 18px 32px;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-submit:hover::before {
  opacity: 1;
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit i {
  transition: transform 0.3s ease;
}

.btn-submit:hover i {
  transform: translateX(4px);
}

/* ========== FOOTER ========== */
.bivid-footer {
  text-align: center;
  padding: 30px 20px 120px;
  position: relative;
  z-index: 1;
}

.bivid-footer p {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  margin: 0;
}

.bivid-footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .bivid-header-container {
    flex-direction: column;
    height: auto;
    padding: 16px 0;
    gap: 8px;
  }

  .bivid-logo img {
    height: 28px;
  }

  .header-subtitle {
    font-size: 0.7rem;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .plan-card {
    flex-direction: row;
    justify-content: space-between;
    padding: 16px 20px;
    text-align: left;
  }

  .plan-card .plan-speed {
    order: 1;
  }

  .plan-card .plan-price {
    order: 2;
  }

  .plan-card .plan-features {
    display: none;
  }

  .badge-popular {
    position: static;
    order: 0;
    margin-right: auto;
    border-radius: 20px;
    padding: 4px 10px;
  }

  .plan-check {
    position: static;
    order: 3;
  }

  .extra-item {
    flex-wrap: wrap;
  }

  .extra-price {
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
  }

  .total-bar.sticky {
    bottom: 10px;
    width: calc(100% - 20px);
    border-radius: var(--radius-md);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px 80px;
    margin-top: 20px;
  }

  .form-section {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }

  .section-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .section-header i {
    font-size: 1.2rem;
    padding: 10px;
  }

  .section-header h2 {
    font-size: 1rem;
  }

  .price-amount {
    font-size: 2rem;
  }

  .total-amount {
    font-size: 1.5rem;
  }

  .btn-submit {
    padding: 16px 24px;
    font-size: 1rem;
  }
}
