/* Bybit PIX - Modern Responsive Design (Desktop + Mobile) */
*{margin:0;padding:0;box-sizing:border-box}

:root {
  --bg: #0b0e14;
  --card-bg: #141a23;
  --card-border: #222b3a;
  --accent: #f7a600;
  --accent-gradient: linear-gradient(135deg, #f7a600 0%, #e8850f 100%);
  --text: #f0f4f8;
  --muted: #8b98a9;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --yellow: #f59e0b;
}

html {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 10%, #17202d 0%, var(--bg) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

@media (min-width: 641px) {
  body {
    padding: 24px 16px;
  }
  .app-container {
    min-height: auto;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    margin: auto;
    overflow: hidden;
  }
}

/* Header */
.top-header {
  background: var(--accent-gradient);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}

.top-header h1 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-ready {
  background: rgba(34, 197, 94, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-waiting {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.badge-expired {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.badge-https {
  background: rgba(0, 0, 0, 0.25);
  color: #e2e8f0;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
}

/* Payment Info Box */
.info-card {
  background: #0e131b;
  border-bottom: 1px solid var(--card-border);
  padding: 14px 18px;
  flex: 0 0 auto;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
  font-weight: 600;
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-value.amount {
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
}

.info-value.process-pill {
  color: #60a5fa;
  font-size: 11px;
  background: rgba(96, 165, 250, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  width: fit-content;
}

/* SDK Wrap */
.sdk-wrap {
  flex: 1 1 auto;
  min-height: 480px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: #111720;
  display: flex;
  flex-direction: column;
}

#sdk-container {
  position: relative;
  width: 100%;
  min-height: 100%;
  flex: 1;
}

#sdk-container iframe {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  border: 0 !important;
}

/* Fullscreen Selfie Mode (Imersivo nativo sem distorções de zoom) */
#screen-selfie.fullscreen-selfie {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 999999 !important;
  background: #000 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#screen-selfie.fullscreen-selfie .sdk-wrap {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  flex: 1 1 100% !important;
  overflow: hidden !important;
}

#screen-selfie.fullscreen-selfie #sdk-container {
  width: 100% !important;
  height: 100% !important;
  flex: 1 1 100% !important;
  position: relative !important;
  overflow: hidden !important;
}

#screen-selfie.fullscreen-selfie #sdk-container iframe {
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100% !important;
  max-height: 100% !important;
  border: 0 !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

.floating-selfie-hud {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Loading & Error */
.sdk-message-box {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  margin: auto;
}

.sdk-message-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.sdk-message-text {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.5;
}

.sdk-btn-retry {
  margin-top: 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.sdk-btn-retry:hover {
  opacity: 0.9;
}

/* Floating / Bottom Logs Bar */
.footer-bar {
  background: #0e131b;
  border-top: 1px solid var(--card-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}

.btn-toggle-logs {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-toggle-logs:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.live-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* Logs Drawer / Modal */
.logs-drawer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: flex-end;
  justify-content: center;
}

.logs-drawer.active {
  display: flex;
}

.logs-modal-box {
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  background: #141a23;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--card-border);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.logs-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logs-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.btn-icon:hover {
  color: #fff;
}

.logs-body {
  padding: 12px;
  overflow-y: auto;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
  max-height: 55vh;
  background: #0b0e14;
}

.log-entry {
  padding: 2px 0;
  word-break: break-all;
}

.log-entry.INFO { color: #93c5fd; }
.log-entry.WARNING { color: #fde047; }
.log-entry.ERROR { color: #f87171; }

/* Waiting & Expired Screens */
.state-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.state-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.state-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.state-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 320px;
  margin-bottom: 20px;
}

.pulse {
  animation: pulseAnim 2s infinite ease-in-out;
}

@keyframes pulseAnim {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

/* 2FA & Success Cards on Link */
.code-input {
  width: 100%;
  max-width: 280px;
  padding: 14px 16px;
  background: #0b0e14;
  border: 2px solid var(--card-border);
  border-radius: 12px;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 6px;
  text-align: center;
  outline: none;
  transition: all 0.2s;
  font-family: 'SF Mono', Consolas, monospace;
  margin: 12px auto;
  display: block;
}

.code-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(247, 166, 0, 0.3);
}

.card-success-box {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
  width: 100%;
}

