/* ════════════════════════════════════════════════════════════════════════════
   br4-kyc-webview.css — Modal fullscreen com iframe pra KYC biométrico
   Permissões câmera + microfone via iframe.allow
   ════════════════════════════════════════════════════════════════════════════ */

.br4-kyc-webview-modal[hidden] { display: none !important; }

.br4-kyc-webview-modal {
  position: fixed;
  inset: 0;
  z-index: 15000;
  display: flex;
  flex-direction: column;
  background: #1B202B;
  animation: br4KycWebviewFadeIn 0.28s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-overflow-scrolling: touch;
}

@keyframes br4KycWebviewFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Header */
.br4-kyc-webview-modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top, 0px)) 14px 12px;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.98) 0%, rgba(8, 8, 8, 0.82) 100%);
  border-bottom: 1px solid rgba(30, 64, 175, 0.2);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  z-index: 2;
}

.br4-kyc-webview-modal__close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px 9px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}

.br4-kyc-webview-modal__close:hover {
  background: rgba(30, 64, 175, 0.12);
  border-color: rgba(30, 64, 175, 0.35);
  color: #10B981;
}

.br4-kyc-webview-modal__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  text-align: center;
  flex: 1;
  padding: 0 8px;
}

.br4-kyc-webview-modal__indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(30, 64, 175, 0.1);
  border: 1px solid rgba(30, 64, 175, 0.32);
  border-radius: 20px;
  font-size: 0.66rem;
  font-weight: 800;
  color: #10B981;
  letter-spacing: 0.08em;
}

.br4-kyc-webview-modal__dot {
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 8px #1E40AF;
  animation: br4KycDotPulse 1.6s ease-in-out infinite;
}

@keyframes br4KycDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.2); }
}

/* Body (contém loading, error e iframe) */
.br4-kyc-webview-modal__body {
  flex: 1 1 auto;
  position: relative;
  background: #1B202B;
  overflow: hidden;
}

.br4-kyc-webview-modal__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.br4-kyc-webview-modal__iframe[hidden] { display: none !important; }

/* Loading */
.br4-kyc-webview-modal__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(203, 213, 225, 0.9);
  padding: 24px;
  text-align: center;
}

.br4-kyc-webview-modal__loading p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.br4-kyc-webview-modal__loading-sub {
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: rgba(156, 163, 175, 0.7) !important;
}

.br4-kyc-webview-modal__loader {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(30, 64, 175, 0.18);
  border-top-color: #1E40AF;
  border-radius: 50%;
  animation: br4KycWebviewSpin 0.85s linear infinite;
  margin-bottom: 6px;
}

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

/* Error */
.br4-kyc-webview-modal__error[hidden] { display: none !important; }
.br4-kyc-webview-modal__error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(203, 213, 225, 0.92);
  padding: 24px;
  text-align: center;
}

.br4-kyc-webview-modal__error h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.br4-kyc-webview-modal__error p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(156, 163, 175, 0.85);
  max-width: 340px;
  line-height: 1.5;
}

.br4-kyc-webview-modal__retry-btn {
  margin-top: 8px;
  padding: 12px 28px;
  background: linear-gradient(180deg, #3B5BDB 0%, #17a34a 48%, #1E3A8A 100%);
  border: 1px solid rgba(30, 64, 175, 0.6);
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.18s ease, transform 0.12s ease;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.35);
}

.br4-kyc-webview-modal__retry-btn:hover { filter: brightness(1.07); }
.br4-kyc-webview-modal__retry-btn:active { transform: scale(0.985); }

/* Footer */
.br4-kyc-webview-modal__footer {
  flex: 0 0 auto;
  padding: 10px 14px max(10px, env(safe-area-inset-bottom, 0px));
  background: rgba(8, 8, 8, 0.92);
  border-top: 1px solid rgba(30, 64, 175, 0.16);
  text-align: center;
}

.br4-kyc-webview-modal__powered {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(30, 64, 175, 0.7);
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .br4-kyc-webview-modal__title { font-size: 0.85rem; }
  .br4-kyc-webview-modal__close { padding: 8px 10px; font-size: 0.8rem; }
  .br4-kyc-webview-modal__indicator { padding: 5px 8px; font-size: 0.6rem; }
}
