/* ==========================================================================
   WePayCode - iOS Native & PWA Human Interface Design System
   Padrão visual 100% nativo Apple iOS (SF Pro, Frosted Glass, Haptic Feedback)
   ========================================================================== */

/* 1. VARIÁVEIS DO SISTEMA iOS */
:root {
  --ios-system-blue: #007aff;
  --ios-system-green: #34c759;
  --ios-system-indigo: #5856d6;
  --ios-system-orange: #ff9500;
  --ios-system-pink: #ff2d55;
  --ios-system-purple: #af52de;
  --ios-system-red: #ff3b30;
  --ios-system-teal: #5ac8fa;
  --ios-system-yellow: #ffcc00;

  --ios-bg-grouped: #f2f2f7;
  --ios-card-bg: #ffffff;
  --ios-separator: rgba(60, 60, 67, 0.12);
  --ios-separator-opaque: #c6c6c8;
  --ios-label: #000000;
  --ios-secondary-label: #8e8e93;
  --ios-tertiary-label: #c7c7cc;

  --ios-blur-bg: rgba(255, 255, 255, 0.85);
  --ios-blur-dark: rgba(24, 24, 27, 0.85);
  --ios-shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --ios-shadow-float: 0 12px 32px -4px rgba(0, 122, 255, 0.28);
  --ios-tabbar-height: 60px;
}

/* 2. BASE DO APP NATIVO */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Plus Jakarta Sans", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--ios-bg-grouped);
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative !important;
}

/* Toques nativos e micro-animações iOS */
button, 
.btn, 
.nav-link, 
.ios-tab-item, 
.ios-quick-action,
.ios-touchable {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  transition: transform 0.14s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.14s ease;
}

button:active, 
.btn:active, 
.ios-tab-item:active, 
.ios-quick-action:active,
.ios-touchable:active {
  transform: scale(0.96) !important;
  opacity: 0.85;
}

/* 3. iOS HEADER MOBILE (BARRA SUPERIOR NATIVA) */
.ios-mobile-header {
  display: none;
}

@media (max-width: 1024px) {
  .ios-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--ios-blur-bg);
    -webkit-backdrop-filter: blur(25px) saturate(190%);
    backdrop-filter: blur(25px) saturate(190%);
    border-bottom: 0.5px solid var(--ios-separator);
    z-index: 100;
  }

  .ios-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .ios-app-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #0a192f 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.35);
  }

  .ios-header-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #0f172a;
  }

  .ios-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .ios-balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    border: 0.5px solid rgba(5, 150, 105, 0.2);
  }

  .ios-avatar-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  }

  .ios-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* 4. iOS BOTTOM TAB BAR (BARRA DE NAVEGAÇÃO INFERIOR ESTILO IPHONE) */
.ios-bottom-tabbar {
  display: none;
}

@media (max-width: 1024px) {
  .ios-bottom-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--ios-tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--ios-blur-bg);
    -webkit-backdrop-filter: blur(30px) saturate(210%);
    backdrop-filter: blur(30px) saturate(210%);
    border-top: 0.5px solid var(--ios-separator);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    user-select: none;
  }

  .ios-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-decoration: none;
    color: #8e8e93;
    font-size: 10px;
    font-weight: 600;
    gap: 3px;
    position: relative;
  }

  .ios-tab-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.1;
    transition: transform 0.15s ease, stroke 0.15s ease;
  }

  .ios-tab-item.active {
    color: var(--ios-system-blue);
  }

  .ios-tab-item.active svg {
    stroke: var(--ios-system-blue);
    transform: translateY(-1px);
  }

  .ios-tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--ios-system-blue);
    border-radius: 50%;
  }

  /* Botão Central de Ação Flutuante (Gerar Código / Ação Rápida) */
  .ios-tab-action {
    position: relative;
    top: -14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #0f172a;
    font-size: 10.5px;
    font-weight: 700;
  }

  .ios-action-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px -2px rgba(29, 78, 216, 0.45);
    border: 3px solid #ffffff;
    margin-bottom: 2px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .ios-tab-action:active .ios-action-circle {
    transform: scale(0.9);
  }

  /* Ajuste no container para não cobrir conteúdo */
  .app-container .main-content {
    padding-bottom: calc(var(--ios-tabbar-height) + env(safe-area-inset-bottom, 0px) + 24px) !important;
  }
}

/* 5. iOS BOTTOM ACTION SHEET ("MAIS" / MENU DESLIZANTE) */
.ios-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.ios-sheet-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.ios-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ios-bg-grouped);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 12px 18px calc(env(safe-area-inset-bottom, 16px) + 20px);
  z-index: 2001;
  transform: translateY(105%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
}

.ios-bottom-sheet.active {
  transform: translateY(0);
}

.ios-sheet-handle {
  width: 40px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 9999px;
  margin: 0 auto 16px;
  cursor: grab;
}

.ios-sheet-title {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ios-sheet-close-btn {
  background: #e2e8f0;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 6. iOS INSET GROUPED LIST (ESTILO CONFIGURAÇÕES DO IPHONE) */
.ios-grouped-card {
  background: var(--ios-card-bg);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--ios-shadow-card);
  border: 0.5px solid var(--ios-separator);
}

.ios-list-row {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  text-decoration: none;
  color: #0f172a;
  position: relative;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.ios-list-row:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 54px;
  right: 0;
  height: 0.5px;
  background: var(--ios-separator);
}

.ios-list-row:active {
  background-color: #f1f5f9;
}

.ios-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: #ffffff;
  flex-shrink: 0;
}

.ios-row-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.ios-row-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 1px;
}

.ios-row-value {
  font-size: 14px;
  color: #64748b;
  margin-right: 8px;
}

.ios-chevron {
  width: 16px;
  height: 16px;
  color: #c7c7cc;
}

/* 7. BANNER MODAL PWA "ADICIONAR À TELA DE INÍCIO" (NATIVO iOS) */
.ios-pwa-install-banner {
  position: fixed;
  bottom: calc(var(--ios-tabbar-height) + env(safe-area-inset-bottom, 0px) + 16px);
  left: 16px;
  right: 16px;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  backdrop-filter: blur(25px) saturate(180%);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0,0,0,0.06);
  z-index: 1500;
  display: none;
  animation: iosSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ios-pwa-install-banner.active {
  display: block;
}

@keyframes iosSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ios-pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ios-pwa-app-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  flex-shrink: 0;
}

.ios-pwa-instructions {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0.5px solid #e2e8f0;
}

.ios-share-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #e0f2fe;
  color: #0284c7;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
}

/* 8. SEGMENTED CONTROL NATIVO iOS (Abas Fluidas) */
.ios-segmented-control {
  display: flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 12px;
  position: relative;
  user-select: none;
  margin-bottom: 20px;
}

.ios-segment-btn {
  flex: 1;
  text-align: center;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #64748b;
  border-radius: 9px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ios-segment-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 9. CARTÃO APPLE WALLET TITANIUM / SAPPHIRE */
.ios-wallet-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
  border-radius: 22px;
  padding: 24px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 36px -8px rgba(30, 58, 138, 0.35), 0 0 0 1px rgba(255,255,255,0.12) inset;
  margin-bottom: 20px;
}

.ios-wallet-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.ios-wallet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.ios-emv-chip {
  width: 38px;
  height: 28px;
  background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
  border-radius: 6px;
  position: relative;
  border: 1px solid #d4af37;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.4);
}

.ios-emv-chip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0,0,0,0.2);
}

.ios-wallet-balance-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 4px;
}

.ios-wallet-balance-val {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1.2px;
  color: #ffffff;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ios-wallet-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* 10. GRADE DE AÇÕES RÁPIDAS CIRCULARES (ESTILO IPHONE / REVOLUT) */
.ios-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.ios-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  gap: 8px;
  user-select: none;
}

.ios-action-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ios-shadow-card);
  border: 0.5px solid var(--ios-separator);
  color: #1d4ed8;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ios-action-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

.ios-action-btn:active .ios-action-icon {
  transform: scale(0.92);
  background: #f8fafc;
}

.ios-action-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-align: center;
  letter-spacing: -0.2px;
}

/* 11. PASSES ESTILO APPLE WALLET COM NOTCHES PERFURADOS */
.ios-pass-card {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--ios-shadow-card);
  border: 0.5px solid var(--ios-separator);
  margin-bottom: 16px;
  position: relative;
}

.ios-pass-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #cbd5e1;
  position: relative;
}

/* Notches nas laterais simulando ticket */
.ios-pass-header::before,
.ios-pass-header::after {
  content: '';
  position: absolute;
  bottom: -9px;
  width: 18px;
  height: 18px;
  background-color: var(--ios-bg-grouped);
  border-radius: 50%;
  border: 0.5px solid var(--ios-separator);
  z-index: 5;
}

.ios-pass-header::before {
  left: -10px;
}

.ios-pass-header::after {
  right: -10px;
}

.ios-pass-body {
  padding: 20px;
}

.ios-pass-code-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* 12. SWITCH NATIVO APPLE iOS (TOGGLE) */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.ios-switch-slider:before {
  position: absolute;
  content: "";
  height: 27px;
  width: 27px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ios-switch input:checked + .ios-switch-slider {
  background-color: var(--ios-system-green);
}

.ios-switch input:checked + .ios-switch-slider:before {
  transform: translateX(20px);
}

/* 13. MOCKUP iPHONE 16 PRO (PARA LANDING E PREVIEW) */
.ios-phone-mockup {
  width: 310px;
  height: 620px;
  background: #09090b;
  border-radius: 52px;
  padding: 12px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 4px #27272a, 0 0 0 8px #09090b;
  position: relative;
  margin: 0 auto;
}

.ios-dynamic-island {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 28px;
  background: #000000;
  border-radius: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
}

.ios-camera-lens {
  width: 10px;
  height: 10px;
  background: #1e1b4b;
  border-radius: 50%;
  border: 1.5px solid #0f172a;
}

.ios-phone-screen {
  width: 100%;
  height: 100%;
  background: var(--ios-bg-grouped);
  border-radius: 42px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 14. RESPONSIVIDADE PROFUNDA & POLIMENTO VISUAL */
@media (max-width: 1024px) {
  /* Esconder topbar de desktop antiga */
  .topbar {
    display: none !important;
  }

  /* Ajustar o container principal */
  .app-container {
    display: block !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 12px 14px 80px !important;
  }

  .content-body {
    padding: 0 !important;
  }

  /* Grids de Geração, Carteira, Demo, Docs e Landing Page */
  div[style*="grid-template-columns: 1.4fr 1fr"],
  div[style*="grid-template-columns: 1.15fr 0.85fr"],
  div[style*="grid-template-columns: 1.1fr 0.9fr"],
  div[style*="grid-template-columns: 1.2fr 0.8fr"],
  div[style*="grid-template-columns: 1.3fr 1fr"],
  div[style*="grid-template-columns: 1fr 1.15fr"],
  div[style*="grid-template-columns: 280px 1fr"],
  div[style*="grid-template-columns: 260px 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 2fr 1fr 1fr"],
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns: 2fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Previne zoom automático indesejado no iOS Safari ao tocar em inputs */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Public Header no Mobile */
  header div[style*="max-width: 1280px"] {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  header nav[style*="display: flex"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
    padding-bottom: 4px !important;
    gap: 14px !important;
  }

  header nav[style*="display: flex"]::-webkit-scrollbar {
    display: none;
  }

  /* Tabelas Responsivas com rolagem suave */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    margin-bottom: 16px;
  }

  .table th, .table td {
    padding: 10px 12px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }

  /* Cards Mobile */
  .card {
    padding: 16px !important;
    border-radius: 18px !important;
    margin-bottom: 14px !important;
  }

  /* Botões táteis iOS */
  .btn {
    min-height: 44px;
    padding: 10px 16px !important;
    font-size: 14px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Footer responsivo */
  footer div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
}

/* Telas muito pequenas (iPhone SE / 375px) */
@media (max-width: 480px) {
  div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  .ios-header-title {
    font-size: 15px;
  }

  .ios-tab-item {
    font-size: 9.5px;
  }

  .btn-lg {
    width: 100% !important;
    margin-bottom: 8px;
  }
}

/* ==========================================================================
   5. COMPONENTES APPLE ID & AUTHENTICATION NATIVE SHEET
   ========================================================================== */
.ios-auth-wrapper {
  max-width: 480px;
  margin: 36px auto 60px;
  padding: 0 16px;
}

@media (max-width: 640px) {
  .ios-auth-wrapper {
    margin: 16px auto 40px;
    padding: 0 12px;
  }
}

.ios-auth-card {
  background: var(--ios-card-bg);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .ios-auth-card {
    padding: 24px 20px;
    border-radius: 24px;
  }
}

.ios-auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.ios-auth-badge {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 20px -4px rgba(30, 64, 175, 0.35);
}

.ios-auth-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
  margin-bottom: 6px;
}

.ios-auth-subtitle {
  font-size: 14px;
  color: #64748b;
  line-height: 1.45;
}

/* Demo Pills Segmented */
.ios-demo-pills {
  background: #f1f5f9;
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 22px;
  border: 1px solid #e2e8f0;
}

.ios-demo-pill-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #475569;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ios-demo-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 480px) {
  .ios-demo-buttons-grid {
    grid-template-columns: 1fr;
  }
}

.ios-demo-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ios-demo-user-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.ios-demo-user-btn.admin {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.ios-demo-user-btn.admin:hover {
  background: #1e293b;
}

/* Campos de Formulário Estilo iOS Grouped */
.ios-form-group {
  margin-bottom: 16px;
}

.ios-form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.ios-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.ios-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.ios-text-input {
  width: 100%;
  height: 48px;
  padding: 10px 14px 10px 42px;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 16px !important; /* Previne auto zoom no Safari */
  color: #0f172a;
  font-weight: 500;
  transition: all 0.2s ease;
}

.ios-text-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #007aff;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.ios-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 600px) {
  .ios-form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
}

/* ==========================================================================
   6. APPLE PAY SHEET & INSTANT AUTHORIZATION MODAL
   ========================================================================== */
.ios-apple-pay-sheet {
  max-width: 520px;
  margin: 20px auto 50px;
  background: #ffffff;
  border-radius: 30px;
  padding: 30px 24px 28px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.9);
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .ios-apple-pay-sheet {
    margin: 12px 12px 90px;
    padding: 22px 18px 24px;
    border-radius: 26px;
  }
}

.ios-apple-pay-handle {
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 9999px;
  margin: 0 auto 18px;
}

.ios-apple-pay-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.ios-apple-pay-badge-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.ios-apple-pay-badge-logo svg {
  color: #0f172a;
}

/* Merchant Header */
.ios-pay-merchant-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.ios-merchant-avatar {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

/* Big Amount Box */
.ios-pay-amount-box {
  text-align: center;
  padding: 18px 12px;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 20px;
  border: 1.5px dashed #cbd5e1;
}

.ios-pay-amount-label {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.ios-pay-amount-value {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 6px;
}

/* Mini Apple Card Preview */
.ios-pay-card-preview {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 18px;
  padding: 16px 18px;
  color: #ffffff;
  margin-bottom: 22px;
  box-shadow: 0 8px 20px -3px rgba(15, 23, 42, 0.25);
  position: relative;
  overflow: hidden;
}

.ios-pay-card-preview::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.ios-pay-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.ios-pay-card-balance {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.ios-pay-card-sub {
  font-size: 11.5px;
  color: #a7f3d0;
  margin-top: 4px;
}

/* Apple Pay Slide / Action Button */
.ios-apple-pay-btn {
  width: 100%;
  height: 56px;
  border-radius: 16px;
  background: #000000;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 12px;
}

.ios-apple-pay-btn:active {
  transform: scale(0.97);
  background: #1e1e1e;
}

.ios-faceid-glyph {
  width: 24px;
  height: 24px;
  animation: iosPulse 2s infinite ease-in-out;
}

@keyframes iosPulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

.ios-pay-cancel-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.ios-pay-cancel-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Responsividade Mobile Extra */
@media (max-width: 1024px) {
  /* Partner checkout grid responsiveness */
  div[style*="grid-template-columns: 1.2fr 0.8fr"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

@media (max-width: 640px) {
  /* Order confirmation 3-col info grid */
  div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* ==========================================================================
   7. NAVBAR PÚBLICA NATIVA iOS & CONTENÇÃO DE OVERFLOW
   ========================================================================== */
.public-header-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.public-nav-desktop {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14.5px;
  font-weight: 600;
}

.public-mobile-menu-btn {
  display: none;
}

/* Tab bar pública no mobile */
.ios-public-tabbar {
  display: none;
}

/* Classes da Landing Page */
.landing-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.landing-hero-title {
  font-size: clamp(30px, 6vw, 50px);
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  word-break: break-word;
}

.landing-partners-row {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 16px;
  font-weight: 700;
  color: #475569;
}

.landing-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.landing-guarantee-banner {
  margin-top: 40px;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  padding: 24px 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.landing-zero-trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.landing-cta-banner {
  max-width: 1280px;
  margin: 0 auto;
  background: linear-gradient(135deg, #1e40af 0%, #1a56db 100%);
  border-radius: 28px;
  padding: 60px 40px;
  text-align: center;
  color: white;
}

/* REGRAS CRÍTICAS PARA MOBILE (<= 1024px) */
@media (max-width: 1024px) {
  /* Header público no mobile */
  .public-nav-desktop {
    display: none !important;
  }

  .public-mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    cursor: pointer;
  }

  /* Barra inferior pública */
  .ios-public-tabbar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--ios-tabbar-height);
    background: var(--ios-blur-bg);
    -webkit-backdrop-filter: blur(25px) saturate(190%);
    backdrop-filter: blur(25px) saturate(190%);
    border-top: 0.5px solid var(--ios-separator);
    z-index: 99;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    justify-content: space-around;
    align-items: center;
  }

  /* Padding extra no rodapé para não ser coberto pela tabbar pública */
  body.has-public-tabbar {
    padding-bottom: calc(var(--ios-tabbar-height) + env(safe-area-inset-bottom, 16px)) !important;
  }

  /* Grids da Landing no mobile */
  .landing-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    text-align: center !important;
  }

  .landing-hero-grid p {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .landing-hero-grid div[style*="display: flex; align-items: center; gap: 16px;"] {
    justify-content: center !important;
    flex-wrap: wrap !important;
  }

  .landing-partners-row {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 14px 20px !important;
  }

  .landing-steps-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .landing-guarantee-banner {
    flex-direction: column !important;
    text-align: center !important;
    gap: 18px !important;
    padding: 20px 16px !important;
  }

  .landing-guarantee-banner .btn {
    width: 100% !important;
  }

  .landing-zero-trust-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .landing-cta-banner {
    padding: 36px 20px !important;
    border-radius: 22px !important;
  }

  .landing-cta-banner h2 {
    font-size: 26px !important;
  }

  .landing-cta-banner .btn {
    width: 100% !important;
  }

  /* Mockup iPhone responsivo */
  .ios-phone-mockup {
    max-width: 100% !important;
    width: 280px !important;
    height: auto !important;
    min-height: 520px !important;
    margin: 0 auto !important;
    padding: 10px !important;
    border-radius: 44px !important;
  }

  .ios-phone-screen {
    border-radius: 36px !important;
  }

  /* Imagens, SVGs e containers nunca estouram a largura da tela */
  img, svg, canvas {
    max-width: 100% !important;
  }

  section {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
  }
}

/* ==========================================================================
   8. SCANNER DE QR CODE ESTILO APPLE CAMERA NATIVE
   ========================================================================== */
.ios-scanner-wrapper {
  max-width: 480px;
  margin: 16px auto 40px;
  padding: 0 14px;
}

.ios-scanner-viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000000;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ios-scanner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-scanner-target {
  width: 72%;
  height: 72%;
  position: relative;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  border-radius: 20px;
}

.ios-scanner-corners span {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3.5px solid #007aff;
}

.ios-scanner-corners .top-left {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 16px;
}

.ios-scanner-corners .top-right {
  top: -2px;
  right: -2px;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 16px;
}

.ios-scanner-corners .bottom-left {
  bottom: -2px;
  left: -2px;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 16px;
}

.ios-scanner-corners .bottom-right {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 16px;
}

.ios-scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent 0%, #007aff 50%, transparent 100%);
  box-shadow: 0 0 12px 2px #007aff;
  animation: iosScanBeam 2.4s infinite ease-in-out;
}

@keyframes iosScanBeam {
  0% { top: 8%; opacity: 0.3; }
  50% { top: 92%; opacity: 1; }
  100% { top: 8%; opacity: 0.3; }
}

.ios-scanner-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.ios-scanner-btn-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease;
}

.ios-scanner-btn-circle:active {
  transform: scale(0.92);
  background: #e2e8f0;
}




