/* ===================================
   PAYMENT PAGE STYLES - JEEL 2025
   =================================== */

/* ===================================
   DISABLE TEXT SELECTION ON UI ELEMENTS
   =================================== */

/* Desabilitar seleção de texto em elementos da interface */
.navbar,
.btn,
button,
.payment-header,
.payment-title,
.payment-subtitle,
.form-label,
.alert,
.payment-form-container,
.form-section,
.form-actions,
.navbar-brand,
.nav-link,
.brand-text,
.payment-security,
.qr-container,
.countdown-container,
.invoice-header,
.invoice-title,
.invoice-subtitle,
.invoice-item,
.invoice-total,
.invoice-footer {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Permitir seleção apenas em conteúdo de texto específico */
p:not(.payment-subtitle):not(.payment-security),
.alert-dismissible,
.invalid-feedback,
.form-text {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Desabilitar seleção em títulos e headings */
h1, h2, h3, h4, h5, h6 {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Permitir seleção em campos de formulário */
input,
textarea,
select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

:root {
  --primary-color: #1affb2;
  --primary-dark: #00d991;
  --secondary-color: #0a1121;
  --accent-color: #ff6b6b;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --light-bg: #f8fafc;
  --dark-bg: #0f172a;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --border-radius: 12px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, var(--light-bg) 0%, #e2e8f0 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===================================
   TESTE BANNER
   =================================== */

.alert-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 2px solid #ffc107;
  border-radius: var(--border-radius);
  color: #856404;
  font-weight: 600;
  padding: 1rem;
  margin-top: 100px; /* Para compensar navbar fixa */
  animation: pulse 2s infinite;
}

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

/* ===================================
   NAVIGATION
   =================================== */

.navbar {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(26, 255, 178, 0.1);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-color) !important;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.brand-text {
  margin-left: 0.5rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

/* ===================================
   MAIN LAYOUT
   =================================== */

.payment-main {
  padding-top: 120px;
  padding-bottom: 60px;
  min-height: 100vh;
}

/* ===================================
   PAYMENT HEADER
   =================================== */

.payment-header {
  margin-bottom: 3rem;
}

.payment-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  background: white;
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 100px;
  transition: all 0.3s ease;
}

.step i {
  font-size: 1.5rem;
}

.step.completed {
  background: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.step.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--secondary-color);
  transform: scale(1.05);
}

.step-line {
  width: 60px;
  height: 2px;
  background: var(--border-color);
  margin: 0 0.5rem;
}

.payment-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.payment-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===================================
   ORDER SUMMARY
   =================================== */

.order-summary {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  height: fit-content;
  position: sticky;
  top: 140px;
}

.summary-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.summary-item {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.item-info h5 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.item-details {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
}

.item-price {
  text-align: right;
  margin-top: 1rem;
}

.current-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--success-color);
  margin-right: 0.5rem;
}

.original-price {
  font-size: 1rem;
  color: var(--text-secondary);
  text-decoration: line-through;
}

.summary-benefits {
  margin-bottom: 1.5rem;
}

.summary-benefits h6 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 0.75rem;
}

.summary-benefits ul {
  list-style: none;
  padding: 0;
}

.summary-benefits li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.summary-total {
  border-top: 2px solid var(--border-color);
  padding-top: 1rem;
}

.discount-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--success-color);
}

.total-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--secondary-color);
}

/* ===================================
   PAYMENT FORM
   =================================== */

.payment-form-container {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.form-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.form-label {
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.form-control {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fafbfc;
  position: relative;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 255, 178, 0.1);
  background: white;
  transform: translateY(-1px);
}

.form-control:hover:not(:focus) {
  border-color: var(--primary-dark);
}

.form-control.is-invalid {
  border-color: var(--accent-color);
  animation: shake 0.5s ease-in-out;
}

.form-control.is-valid {
  border-color: var(--success-color);
}

/* Efeitos de validação em tempo real */
.input-focused .form-label {
  color: var(--primary-color) !important;
  font-weight: 700;
  transform: scale(0.95);
  transition: all 0.2s ease;
}

.input-filled .form-control {
  background: white;
  border-color: var(--success-color);
}

/* Animação de erro */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Placeholder personalizado */
.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.form-control:focus::placeholder {
  opacity: 0.4;
}

/* Estilos para feedback de validação */
.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--accent-color);
  font-weight: 600;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilo para campos válidos */
.form-control.is-valid {
  border-color: var(--success-color);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.94-.94 4.55-4.54L6.87.31 2.37 4.82l-1.43-1.43L0 4.33l2.3 2.4z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* ===================================
   PAYMENT METHODS
   =================================== */

.payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.payment-method {
  background: #fafbfc;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.payment-method:hover {
  border-color: var(--primary-color);
  background: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.payment-method.active {
  border-color: var(--primary-color);
  background: rgba(26, 255, 178, 0.05);
  color: var(--primary-dark);
}

.payment-method i {
  font-size: 2rem;
  color: var(--primary-color);
}

.payment-method span {
  font-weight: 600;
  font-size: 0.875rem;
}

.payment-method small {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* ===================================
   MERCADO PAGO CONTAINER
   =================================== */

.mp-checkout-container {
  margin-top: 1.5rem;
  min-height: 300px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background: #fafbfc;
  position: relative;
}

.mp-checkout-container::before {
  content: "Carregando checkout seguro...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ===================================
   FORM ACTIONS
   =================================== */

.form-actions {
  text-align: center;
  margin-top: 2rem;
}

.btn-payment {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border: none;
  color: var(--secondary-color);
  font-weight: 700;
  font-size: 1.125rem;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.btn-payment::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-payment:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.btn-payment:hover::before {
  left: 100%;
}

.btn-payment:active {
  transform: translateY(0);
  transition: transform 0.1s;
}

.btn-payment:disabled,
.btn-payment.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
  transform: none;
  background: #6c757d;
}

.btn-payment:disabled:hover,
.btn-payment.btn-disabled:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

.payment-security {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

/* ===================================
   LOADING OVERLAY
   =================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

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

.loading-content {
  text-align: center;
  color: white;
}

.loading-text {
  margin-top: 1rem;
  font-size: 1.125rem;
  font-weight: 500;
}

/* ===================================
   FORM VALIDATION
   =================================== */

.field-error {
  color: var(--accent-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: scale(1.1);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(26, 255, 178, 0.1);
  border-color: var(--primary-color);
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.form-check-label a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.form-check-label a:hover {
  text-decoration: underline;
  color: var(--primary-color);
}

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

@media (max-width: 768px) {
  .payment-main {
    padding-top: 100px;
    padding-bottom: 40px;
  }

  .payment-title {
    font-size: 2rem;
  }

  .payment-step-indicator {
    flex-direction: column;
    gap: 1rem;
  }

  .step-line {
    width: 2px;
    height: 30px;
    margin: 0;
  }

  .order-summary {
    position: static;
    margin-bottom: 2rem;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }

  .payment-form-container {
    padding: 1.5rem;
  }

  .form-section {
    padding-bottom: 1.5rem;
  }
}

@media (max-width: 576px) {
  .payment-title {
    font-size: 1.75rem;
  }

  .payment-form-container,
  .order-summary {
    padding: 1rem;
  }

  .btn-payment {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
  }
}
