* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #ff7a00;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --dark-color: #2c3e50;
  --light-color: #f8f9fa;
  --border-color: #dee2e6;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: var(--dark-color);
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
  padding: 20px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card h2 {
  margin-bottom: 25px;
  color: var(--dark-color);
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark-color);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #6c757d;
  font-size: 0.875rem;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: #e66d00;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-link {
  background: var(--primary-color);
  color: white;
  display: block;
  margin-top: 10px;
}

.info-box {
  background: #e7f3ff;
  border-left: 4px solid #2196F3;
  padding: 20px;
  border-radius: 8px;
}

.info-box h3 {
  margin-bottom: 15px;
  color: #1976D2;
}

.info-box ul {
  list-style-position: inside;
  color: #555;
}

.info-box li {
  margin-bottom: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 0.875rem;
}

.status-ativa {
  background: #d4edda;
  color: #155724;
}

.status-paga {
  background: #d1ecf1;
  color: #0c5460;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.qr-section {
  text-align: center;
  margin: 30px 0;
}

.qr-code {
  max-width: 300px;
  width: 100%;
  height: auto;
  border: 3px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  background: white;
  margin-bottom: 20px;
}

.cobranca-info {
  background: var(--light-color);
  padding: 20px;
  border-radius: 8px;
  text-align: left;
  margin-top: 20px;
}

.cobranca-info p {
  margin-bottom: 10px;
  font-size: 1rem;
}

.cobranca-info strong {
  color: var(--dark-color);
}

.copy-box {
  display: flex;
  gap: 10px;
}

.copy-box input {
  flex: 1;
  font-family: monospace;
  font-size: 0.875rem;
}

.btn-copy {
  padding: 12px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-copy:hover {
  background: #e66d00;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.action-buttons .btn {
  flex: 1;
}

.loading {
  text-align: center;
  padding: 30px;
}

.spinner {
  border: 4px solid var(--light-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.success-card {
  text-align: center;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.success-info {
  background: var(--light-color);
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: left;
}

.success-info p {
  margin-bottom: 10px;
  font-size: 1rem;
}

.link-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  padding: 30px;
  border-radius: 12px;
  margin: 20px 0;
  text-align: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.link-box h3 {
  margin-bottom: 15px;
  color: white;
  font-size: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.portal-info {
  color: white;
  margin-bottom: 20px;
  font-size: 1rem;
  opacity: 0.95;
}

.btn-portal {
  background: white;
  color: #667eea;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 15px 30px;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: none;
  display: inline-block;
  text-decoration: none;
  margin: 10px 0;
}

.btn-portal:hover {
  background: #f8f9fa;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.portal-note {
  display: block;
  color: white;
  margin-top: 15px;
  font-size: 0.875rem;
  opacity: 0.8;
}

footer {
  text-align: center;
  color: white;
  margin-top: 40px;
  padding: 20px;
  opacity: 0.9;
}

footer p {
  margin-bottom: 5px;
}

/* Responsividade */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  .card {
    padding: 20px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .copy-box {
    flex-direction: column;
  }

  .btn-copy {
    width: 100%;
  }
}

/* Animação de erro */
.shake {
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* Toast de notificação */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 4px solid var(--success-color);
}

.toast.error {
  border-left: 4px solid var(--danger-color);
}
