/**
 * ════════════════════════════════════════════════════════════════
 *  ASAAS — CSS  (css/asaas.css)
 *  Estilos para:
 *   1. Modal de checkout (co-*)
 *   2. Painel administrativo Asaas (aa-*)
 * ════════════════════════════════════════════════════════════════
 */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --pix-green:   #00a650;
  --pix-green-2: #007a3d;
  --asaas-blue:  #0066cc;
}

/* ═══════════════════════════════════════════════════════════════
   1. MODAL DE CHECKOUT
   ═══════════════════════════════════════════════════════════════ */

.co-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: coFadeIn 0.2s ease;
}
@keyframes coFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.co-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22);
  animation: coSlideUp 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes coSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ── */
.co-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.co-modal-header-left { display: flex; flex-direction: column; gap: 6px; }
.co-plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  width: fit-content;
}
.co-plan-emoji { font-size: 16px; }
.co-price-display { display: flex; align-items: baseline; gap: 4px; }
.co-price-value   { font-size: 28px; font-weight: 900; color: #0f172a; }
.co-price-period  { font-size: 14px; color: #64748b; }

.co-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.co-close-btn:hover { background: #e2e8f0; color: #1e293b; }

/* ── Progress steps ── */
.co-steps {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  gap: 0;
  border-bottom: 1px solid #f1f5f9;
}
.co-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  flex: 1;
  text-align: center;
  transition: color 0.2s;
}
.co-step--active    { color: #1d4ed8; }
.co-step--completed { color: #16a34a; }
.co-step-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: #fff;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.co-step--active    .co-step-dot { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.co-step--completed .co-step-dot { background: #16a34a; color: #fff; border-color: #16a34a; }
.co-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0;
  position: relative;
  top: -12px;
}

/* ── Body ── */
.co-modal-body { padding: 0; }
.co-step-content { padding: 24px; }
.co-step-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.co-step-title i { color: #2563eb; }
.co-step-sub {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ── Form ── */
.co-form { display: flex; flex-direction: column; gap: 0; }
.co-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.co-form-group { display: flex; flex-direction: column; gap: 5px; }
.co-form-group--full { grid-column: 1 / -1; }
.co-label { font-size: 12px; font-weight: 700; color: #374151; }
.co-input {
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.co-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.co-input::placeholder { color: #94a3b8; }

.co-notice {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #0369a1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
}
.co-notice i { flex-shrink: 0; margin-top: 1px; }

.co-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ── Order summary ── */
.co-order-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.co-order-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: #374151;
  padding: 4px 0;
}
.co-order-row--total {
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
  padding-top: 10px;
  font-size: 15px;
}
.co-order-total { font-size: 18px; color: #0f172a; }

/* ── Payment method selector ── */
.co-method-selector { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.co-method-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.co-method-card:hover { border-color: #93c5fd; background: #f8fbff; }
.co-method--selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.co-method-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.co-method-icon--pix  { background: #d1fae5; color: var(--pix-green); }
.co-method-icon--card { background: #ede9fe; color: #7c3aed; font-size: 18px; }
.co-method-info { flex: 1; }
.co-method-name { font-size: 14px; font-weight: 700; color: #1e293b; }
.co-method-desc { font-size: 12px; color: #64748b; margin-top: 2px; }
.co-method-check {
  color: #cbd5e1;
  font-size: 20px;
  transition: color 0.15s;
}
.co-method--selected .co-method-check { color: #2563eb; }

/* ── PIX info ── */
.co-pix-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #166534;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.co-pix-info i { flex-shrink: 0; margin-top: 1px; }

/* ── PIX screen ── */
.co-pix-screen { text-align: center; }
.co-pix-header { margin-bottom: 20px; }
.co-pix-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #d1fae5;
  color: #065f46;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.co-pix-amount { font-size: 32px; font-weight: 900; color: #0f172a; margin: 4px 0; }
.co-pix-expiry { font-size: 12.5px; color: #ef4444; display: flex; align-items: center; justify-content: center; gap: 5px; }

.co-pix-body { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.co-qr-container {
  width: 200px;
  height: 200px;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.co-qr-img { width: 100%; height: 100%; object-fit: contain; }
.co-qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 13px;
}
.co-qr-placeholder i { font-size: 40px; }

.co-pix-copy-area { width: 100%; }
.co-pix-copy-label { font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 6px; }
.co-pix-copy-wrap { display: flex; gap: 6px; }
.co-pix-code-input {
  flex: 1;
  font-size: 11px;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  color: #374151;
  background: #f8fafc;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.co-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.co-copy-btn:hover { background: #1d4ed8; }

.co-pix-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  margin-top: 8px;
}
.co-pix-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  animation: coPulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes coPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.co-pix-instructions {
  text-align: left;
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}
.co-pix-instructions strong { color: #1e293b; }
.co-pix-instructions ol { margin: 8px 0 0 16px; padding: 0; line-height: 1.8; }

/* ── Credit card form ── */
.co-secure-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  color: #166534;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}
.co-card-input-wrap { position: relative; }
.co-card-brand {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: #94a3b8;
}
.co-divider { border: none; border-top: 1px solid #f1f5f9; margin: 16px 0 12px; }
.co-section-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 12px; }

/* ── Processing ── */
.co-processing { text-align: center; padding: 48px 24px; }
.co-processing-anim {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
}
.co-processing-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  animation: coSpin 1s linear infinite;
}
@keyframes coSpin { to { transform: rotate(360deg); } }
.co-processing-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #2563eb;
}

/* ── Success ── */
.co-success { text-align: center; padding: 40px 24px; }
.co-success-icon {
  font-size: 64px;
  color: #16a34a;
  margin-bottom: 16px;
  animation: coBounceIn 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes coBounceIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}
.co-success-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 16px 0 24px;
}
.co-success-features span {
  background: #f0fdf4;
  color: #166534;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
}
.co-btn-done { margin: 0 auto; padding: 12px 28px; font-size: 15px; }

/* ── Error ── */
.co-error { text-align: center; padding: 40px 24px; }
.co-error-icon { font-size: 56px; color: #ef4444; margin-bottom: 16px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .co-modal { border-radius: 16px 16px 0 0; max-height: 95vh; margin-top: auto; align-self: flex-end; }
  .co-modal-overlay { align-items: flex-end; padding: 0; }
  .co-form-row { grid-template-columns: 1fr; }
  .co-steps { padding: 12px 16px; }
  .co-step span { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   2. PAINEL ADMINISTRATIVO ASAAS (aa-*)
   ═══════════════════════════════════════════════════════════════ */

.aa-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.aa-page-title { font-size: 22px; font-weight: 900; color: #0f172a; margin: 0; }
.aa-page-sub   { font-size: 13px; color: #64748b; margin: 2px 0 0; }

/* KPIs */
.aa-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.aa-kpi-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.aa-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.aa-kpi-icon--blue   { background: #eff6ff; color: #2563eb; }
.aa-kpi-icon--green  { background: #f0fdf4; color: #16a34a; }
.aa-kpi-icon--amber  { background: #fffbeb; color: #d97706; }
.aa-kpi-icon--purple { background: #faf5ff; color: #7c3aed; }
.aa-kpi-value { font-size: 24px; font-weight: 900; color: #0f172a; line-height: 1; }
.aa-kpi-label { font-size: 12px; color: #64748b; margin-top: 2px; }

/* Tabs */
.aa-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}
.aa-tab {
  padding: 8px 18px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.aa-tab:hover { background: #e2e8f0; color: #1e293b; }
.aa-tab--active { background: #fff; color: #2563eb; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* Table */
.aa-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #e2e8f0; }
.aa-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.aa-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #e2e8f0;
}
.aa-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: #374151;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.aa-table tr:last-child td { border-bottom: none; }
.aa-table tr:hover td { background: #f8fbff; }

/* Status badges */
.aa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.aa-badge--confirmed, .aa-badge--received, .aa-badge--active {
  background: #dcfce7; color: #166534;
}
.aa-badge--pending  { background: #fef9c3; color: #854d0e; }
.aa-badge--overdue  { background: #fee2e2; color: #991b1b; }
.aa-badge--deleted, .aa-badge--cancelled, .aa-badge--inactive {
  background: #f1f5f9; color: #64748b;
}
.aa-badge--expired  { background: #fce7f3; color: #9d174d; }

/* Environment toggle */
.aa-env-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}
.aa-env-toggle select {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
  outline: none;
}

/* Config section */
.aa-config-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.aa-config-title {
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.aa-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.aa-config-group { display: flex; flex-direction: column; gap: 5px; }
.aa-config-label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; }
.aa-config-input {
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: monospace;
  color: #1e293b;
  transition: border-color 0.15s;
  outline: none;
}
.aa-config-input:focus { border-color: #3b82f6; }
.aa-config-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Connection status */
.aa-conn-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.aa-conn--ok    { background: #dcfce7; color: #166534; }
.aa-conn--fail  { background: #fee2e2; color: #991b1b; }
.aa-conn--idle  { background: #f1f5f9; color: #64748b; }

/* API Key status badge */
.aa-key-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
}
.aa-key-status--ok      { background: #dcfce7; color: #166534; }
.aa-key-status--missing { background: #fef3c7; color: #92400e; }

/* Key notice banner */
.aa-key-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #1e40af;
  margin-bottom: 16px;
  line-height: 1.5;
}
.aa-key-notice i { color: #3b82f6; flex-shrink: 0; margin-top: 2px; }

/* Empty state */
.aa-empty {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}
.aa-empty i { font-size: 40px; margin-bottom: 12px; display: block; }
.aa-empty-title { font-size: 15px; font-weight: 700; color: #64748b; margin-bottom: 4px; }

/* Loading */
.aa-loading {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
  font-size: 13px;
}
.aa-loading i { display: block; font-size: 24px; margin-bottom: 10px; }

/* Responsive */
@media (max-width: 900px) {
  .aa-kpis { grid-template-columns: 1fr 1fr; }
  .aa-config-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .aa-kpis { grid-template-columns: 1fr; }
  .aa-tabs  { width: 100%; overflow-x: auto; }
  .aa-page-header { flex-direction: column; align-items: flex-start; }
}
