/* Mobile-first: cadastro fácil para usuários leigos */
:root {
  --jinko-green: #198754;
  --jinko-green-dark: #157347;
  --touch-min: 52px;
  --font-base: 17px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.form-mobile {
  font-size: var(--font-base);
  line-height: 1.5;
  padding-bottom: 100px;
  background: #f8f9fa;
}

/* Evita zoom automático no iPhone ao focar campos */
body.form-mobile .form-control,
body.form-mobile .form-select,
body.form-mobile select.form-control {
  font-size: 16px !important;
  min-height: var(--touch-min);
  padding: 12px 14px;
  border-radius: 10px;
}

body.form-mobile label.form-label,
body.form-mobile .form-group > label {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #212529;
}

body.form-mobile .form-text,
body.form-mobile small.text-muted {
  font-size: 0.9rem;
  display: block;
  margin-top: 4px;
}

/* Navbar compacta */
.top-bar-mobile {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 10px 12px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.top-bar-mobile .brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--jinko-green);
}

.lang-btn-mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  margin-left: 4px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: #333;
  background: #fff;
}

.lang-btn-mobile.active {
  border-color: var(--jinko-green);
  background: var(--jinko-green);
  color: #fff;
}

/* Barra de progresso */
.progress-mobile {
  padding: 12px 16px 8px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.progress-mobile__text {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #495057;
}

.progress-mobile .progress {
  height: 10px;
  border-radius: 5px;
}

/* Instruções simplificadas */
.tip-box {
  background: #e7f5ff;
  border: 1px solid #74c0fc;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 20px;
  font-size: 1rem;
}

.tip-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.tip-box ol {
  margin: 0;
  padding-left: 1.2rem;
}

.tip-box li {
  margin-bottom: 4px;
}

/* Seções do formulário */
.section-title-mobile {
  background: var(--jinko-green);
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  margin: 24px 0 14px;
}

body.form-mobile .form-group {
  margin-bottom: 18px;
}

/* Botão fixo no rodapé — sempre visível */
.sticky-submit-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, #fff 85%, transparent);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 1020;
}

.sticky-submit-wrap .btn-submit-mobile {
  min-height: 56px;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.sticky-submit-wrap .btn-submit-mobile:disabled {
  opacity: 0.7;
}

/* Upload de foto — mobile (iOS/Android) */
.photo-upload-area {
  text-align: center;
  margin: 20px 0;
}

.photo-preview-box {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--jinko-green);
  cursor: pointer;
}

.photo-preview-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #e9ecef;
}

.photo-preview-wrap img.foto-preview-img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  border-radius: 50%;
  display: block;
}

.photo-preview-wrap img.foto-preview-img.foto-visivel {
  opacity: 1;
  visibility: visible;
}

.photo-preview-wrap .photo-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #6c757d;
  font-size: 0.85rem;
  line-height: 1.3;
  padding: 12px;
  box-sizing: border-box;
}

.photo-preview-wrap .photo-placeholder .icone-camera {
  font-size: 2.5rem;
  margin-bottom: 6px;
  line-height: 1;
}

.photo-preview-wrap.tem-foto .photo-placeholder {
  display: none !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Input de arquivo criado via JS — nunca visível na página */
input[type="file"].foto-input-js {
  display: none !important;
  visibility: hidden !important;
  position: fixed !important;
  left: -9999em !important;
  top: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  pointer-events: none !important;
}

.foto-input-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 10;
  cursor: pointer;
  border: 0;
  margin: 0;
  padding: 0;
  font-size: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.foto-input-overlay::-webkit-file-upload-button {
  display: none;
  visibility: hidden;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.photo-status-ok {
  color: var(--jinko-green);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.photo-status-wait {
  color: #856404;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.btn-camera-mobile {
  min-height: 56px;
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: 12px;
  border: 2px dashed var(--jinko-green);
  background: #f0fff4;
  color: var(--jinko-green-dark);
  width: 100%;
}

.btn-camera-mobile:active {
  background: #d8f3dc;
}

/* Esconde rodapé antigo que cobria o conteúdo */
body.form-mobile footer.fixed-bottom {
  display: none;
}

/* Botão continuar cadastro */
.btn-continue-mobile {
  min-height: 48px;
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 10px;
  width: 100%;
}

/* Alertas mais legíveis */
body.form-mobile .alert {
  font-size: 1rem;
  border-radius: 12px;
}

body.form-mobile .alert-danger {
  font-weight: 600;
}

/* Dica endereço automático */
.address-hint {
  background: #fff3cd;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  body.form-mobile .container-narrow {
    max-width: 560px;
  }
}
