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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

.checkout-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.checkout-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 30px;
  text-align: center;
}

.checkout-header h1 {
  font-size: 28px;
  margin-bottom: 5px;
}

.checkout-header p {
  opacity: 0.9;
  font-size: 14px;
}

.checkout-form {
  padding: 30px;
}

.form-section {
  margin-bottom: 30px;
}

.form-section h2 {
  font-size: 18px;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input.error {
  border-color: #e74c3c;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Resumo do Pagamento */
.payment-summary {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 15px;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row.highlight {
  font-weight: 600;
  color: #667eea;
  font-size: 18px;
  padding-top: 15px;
}

/* Botão de Submit */
.btn-submit {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Resultado */
.checkout-result {
  padding: 30px;
}

.result-header {
  text-align: center;
  margin-bottom: 30px;
}

.result-header svg {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
}

.result-header.success {
  color: #27ae60;
}

.result-header h2 {
  font-size: 22px;
  color: #333;
}

/* Cartão do Boleto */
.boleto-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.boleto-card h3 {
  font-size: 16px;
  color: #667eea;
  margin-bottom: 15px;
}

.boleto-info {
  margin-bottom: 15px;
}

.boleto-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.boleto-row span:first-child {
  color: #666;
}

.boleto-row span:last-child {
  font-weight: 600;
  color: #333;
}

.boleto-code {
  margin-bottom: 15px;
}

.boleto-code label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.code-box {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.code-box code {
  flex: 1;
  padding: 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 12px;
  word-break: break-all;
  font-family: 'Courier New', monospace;
}

.btn-copy {
  padding: 12px 16px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy:hover {
  background: #5a6fd6;
}

.btn-boleto {
  display: block;
  text-align: center;
  padding: 14px;
  background: #27ae60;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-boleto:hover {
  background: #219a52;
}

/* Lista de Parcelas */
.installments-list {
  margin-top: 20px;
}

.installments-list h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
}

.installment-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
}

.installment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.installment-number {
  font-weight: 600;
  color: #667eea;
}

.installment-value {
  font-weight: 600;
  color: #333;
}

.installment-due {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.installment-code {
  font-size: 11px;
  color: #888;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  background: #fff;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.installment-actions {
  display: flex;
  gap: 10px;
}

.installment-actions button,
.installment-actions a {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.installment-actions .btn-copy-small {
  background: #e0e0e0;
  color: #333;
  border: none;
}

.installment-actions .btn-view {
  background: #667eea;
  color: #fff;
}

/* Aviso de Parcelas Pendentes */
.pending-notice {
  display: flex;
  gap: 15px;
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 2px solid #f39c12;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.notice-icon {
  flex-shrink: 0;
}

.notice-icon svg {
  width: 40px;
  height: 40px;
  color: #f39c12;
}

.notice-content h4 {
  font-size: 16px;
  color: #856404;
  margin-bottom: 10px;
}

.notice-content p {
  font-size: 14px;
  color: #856404;
  line-height: 1.5;
  margin-bottom: 8px;
}

.notice-content .notice-small {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 0;
}

/* Botão Novo Checkout */
.btn-new {
  width: 100%;
  padding: 16px;
  background: #fff;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.2s, color 0.2s;
}

.btn-new:hover {
  background: #667eea;
  color: #fff;
}

/* Mensagem de Erro */
.error-message {
  padding: 30px;
  text-align: center;
}

.error-message p {
  color: #e74c3c;
  margin-bottom: 20px;
  font-size: 15px;
}

.error-message button {
  padding: 14px 30px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

/* Utilitários */
.hidden {
  display: none !important;
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.checkout-result,
.error-message {
  animation: fadeIn 0.3s ease;
}
