/* KYC Onboarding Mobile Styles */

/* Reset y base */
:root {
  --incode-safe-area-bottom: 24px;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  :root {
    --incode-safe-area-bottom: max(env(safe-area-inset-bottom), 24px);
  }
}

.incode-mobile-container {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body:has(.incode-mobile-container) {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .incode-mobile-container,
  .welcome-screen,
  .success-container {
    min-height: 100dvh;
  }
}

/* Pantalla de bienvenida */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
  background: linear-gradient(135deg, #3aa4d8 0%, #1c5a83 100%);
}

.welcome-card {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  max-width: 400px;
}

.welcome-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 24px;
  color: #333;
  margin-bottom: 15px;
  font-weight: 700;
}

.welcome-description {
  color: #666;
  margin-bottom: 30px;
  line-height: 1.6;
  font-size: 15px;
}

.btn-start {
  background: #111;
  color: white;
  border: none;
  padding: 16px 40px;
  font-size: 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(17, 17, 17, 0.35);
}

.btn-start:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.btn-start:active {
  transform: translateY(0);
}

.welcome-note {
  color: #999;
  margin-top: 15px;
  font-size: 12px;
}

/* Contenedor de cámara/iframe */
.camera-container {
  display: none;
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  padding-bottom: var(--incode-safe-area-bottom);
  background: #f6f8fb;
}

@supports (height: 100dvh) {
  .camera-container {
    height: 100dvh;
  }
}

.incode-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background-color: transparent;
  border-radius: 0;
}

/* Loading overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding-bottom: var(--incode-safe-area-bottom);
  box-sizing: border-box;
}

.loading-content {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2881bb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-text {
  color: #666;
  font-size: 16px;
}

/* Mensajes de estado */
.status-message {
  display: none;
}

/* Contenedor de éxito */
.success-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #3aa4d8 0%, #1c5a83 100%);
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + var(--incode-safe-area-bottom));
  box-sizing: border-box;
}

.success-card {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 40px;
  color: white;
  font-weight: bold;
}

.success-title {
  color: #333;
  margin-bottom: 10px;
  font-size: 24px;
  font-weight: 700;
}

.success-description {
  color: #666;
  margin-bottom: 30px;
  font-size: 15px;
  line-height: 1.5;
}

.btn-close {
  padding: 12px 30px;
  background: #111;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(17, 17, 17, 0.35);
}

.btn-close:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.btn-close:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 480px) {
  .welcome-card,
  .success-card {
    padding: 30px 20px;
  }

  .welcome-title,
  .success-title {
    font-size: 20px;
  }

  .welcome-description,
  .success-description {
    font-size: 14px;
  }
}
