/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Container */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header gov.br */
.header {
  background-color: #1351b4;
  padding: 12px 0;
}

.header-logo {
  height: 24px;
  width: auto;
}

/* Main Content */
.main-content {
  padding: 16px 0 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

/* Balance Card */
.balance-card {
  background: linear-gradient(135deg, #005aa5 0%, #003d73 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(0, 90, 165, 0.3);
}

.balance-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.balance-icon {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.caixa-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.balance-info {
  flex: 1;
}

.balance-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  margin-bottom: 4px;
}

.balance-amount-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.balance-amount {
  color: white;
  font-size: 28px;
  font-weight: 700;
}

.pix-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.qr-icon {
  width: 14px;
  height: 14px;
}

/* Info Card */
.info-card {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.info-title {
  color: #856404;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.info-text {
  color: #856404;
  font-size: 14px;
  line-height: 1.5;
}

.info-text strong {
  font-weight: 700;
}

/* Form Card */
.form-card {
  background: white;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 20px;
}

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

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

.required {
  color: #dc3545;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: #005aa5;
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 90, 165, 0.1);
}

.form-input.error {
  border-color: #dc3545;
  background: #fff5f5;
}

.error-message {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #dc3545;
  font-size: 13px;
}

.error-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Submit Button */
.submit-button {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #005aa5 0%, #003d73 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 90, 165, 0.4);
}

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

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

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

.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

.spinner-circle {
  stroke-dasharray: 50;
  stroke-dashoffset: 20;
}

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

.lgpd-text {
  font-size: 12px;
  color: #666;
  text-align: center;
}

/* Success Card */
.success-card {
  background: white;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.saque-info {
  background: linear-gradient(135deg, #005aa5 0%, #003d73 100%);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  color: white;
}

.saque-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.saque-amount {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.saque-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.success-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.check-icon {
  width: 28px;
  height: 28px;
  color: #28a745;
}

.success-title {
  font-size: 20px;
  font-weight: 700;
  color: #28a745;
}

.pix-valor {
  margin-bottom: 16px;
}

.valor-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.valor-amount {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
}

.pix-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff3cd;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #856404;
}

.spinner-small {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
}

.spinner-small circle {
  stroke: #856404;
  stroke-dasharray: 50;
  stroke-dashoffset: 20;
}

.qr-container {
  margin-bottom: 20px;
}

.qr-box {
  display: inline-block;
  padding: 16px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
}

.qr-image {
  width: 180px;
  height: 180px;
  display: block;
}

.pix-code-container {
  background: #f5f5f5;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}

.pix-code {
  display: block;
  font-size: 11px;
  color: #333;
  word-break: break-all;
  margin-bottom: 12px;
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: #005aa5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-button:hover {
  background: #003d73;
}

.copy-icon {
  width: 16px;
  height: 16px;
}

.protocolo {
  font-size: 12px;
  color: #666;
}

/* Confirmed Card */
.confirmed-card {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.confirmed-icon-container {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirmed-check-icon {
  width: 40px;
  height: 40px;
  color: white;
}

.confirmed-title {
  font-size: 24px;
  font-weight: 700;
  color: #28a745;
  margin-bottom: 12px;
}

.confirmed-text {
  font-size: 16px;
  color: #333;
  margin-bottom: 20px;
}

.confirmed-info {
  background: #e8f5e9;
  border-radius: 10px;
  padding: 16px;
}

.confirmed-info p {
  font-size: 14px;
  color: #2e7d32;
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

.toast {
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  animation: fadeInUp 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* Responsive */
@media (max-width: 360px) {
  .balance-amount {
    font-size: 24px;
  }
  
  .form-title {
    font-size: 16px;
  }
  
  .qr-image {
    width: 150px;
    height: 150px;
  }
}
