/* ==========================================================================
   CHA App - Stylesheet Unificado (Inspirado em 1.html a 7.html)
   ========================================================================== */

:root {
  --blue-gov: #1351b4;
  --blue-hover: #0c3c8b;
  --yellow-gov: #f8c200;
  --green-gov: #008f43;
  --bg-app: #f6f6f6;
  --bg-white: #ffffff;
  --text-dark: #333333;
  --text-muted: #666666;
  --border-color: #e0e0e0;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* Container padrão Mobile */
.app-container {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  background-color: var(--bg-white);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   TELA 1: Splash / Início (1.html)
   ========================================================================== */
.hero-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 50px 20px 30px;
}

.hero-img {
  width: 85%;
  max-width: 320px;
  height: auto;
  object-fit: contain;
}

.login-section {
  width: 100%;
  padding: 0 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
  margin-bottom: 30px;
}

.btn-entrar {
  background-color: var(--blue-gov);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  margin-bottom: 15px;
  box-shadow: 0 4px 10px rgba(19, 81, 180, 0.25);
  transition: background-color 0.2s, transform 0.1s;
}

.btn-entrar:active {
  background-color: var(--blue-hover);
  transform: scale(0.98);
}

.texto-ajuda {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 25px;
}

.qr-link {
  color: var(--blue-gov);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.footer-version {
  width: 100%;
  text-align: right;
  padding: 10px 20px 20px;
  font-size: 12px;
  color: #999;
}

/* ==========================================================================
   TELA 2 & 3: Login CPF & Senha (2.html & 3.html)
   ========================================================================== */
.login-header {
  padding: 30px 20px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-gov {
  height: 38px;
  object-fit: contain;
}

.login-card {
  padding: 20px 25px;
  display: flex;
  flex-direction: column;
}

.title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.subtitle {
  font-size: 15px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 24px;
}

.input-group {
  margin-bottom: 18px;
  position: relative;
}

.input-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  display: block;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  color: var(--text-dark);
  background-color: #fafafa;
  transition: border-color 0.2s;
  -webkit-user-select: text;
  user-select: text;
}

.input-field:focus {
  border-color: var(--blue-gov);
  background-color: #ffffff;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 38px;
  cursor: pointer;
  color: #777;
  font-size: 18px;
}

.alert-error {
  background-color: #fde8e8;
  color: #c81e1e;
  border: 1px solid #f8b4b4;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
}

.alert-error.visible {
  display: block;
}

.cpf-destaque {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue-gov);
  margin-bottom: 18px;
  padding: 10px 14px;
  background-color: #f0f4ff;
  border-radius: 6px;
}

.btn-primary {
  background-color: var(--blue-gov);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(19, 81, 180, 0.25);
  margin-bottom: 20px;
  transition: background-color 0.2s;
}

.btn-primary:active {
  background-color: var(--blue-hover);
}

.options-title {
  font-size: 13px;
  font-weight: 600;
  color: #777;
  text-transform: uppercase;
  margin: 15px 0 10px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #444;
  background-color: #ffffff;
  cursor: pointer;
}

.option-btn i {
  color: var(--blue-gov);
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.selo {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #777;
  background-color: #eee;
  padding: 3px 6px;
  border-radius: 4px;
}

.login-footer {
  margin-top: auto;
  padding: 20px;
  font-size: 12px;
  color: #888;
  text-align: center;
}

/* ==========================================================================
   TELA 4 & 5: Dashboard / Painel (4.html & 5.html)
   ========================================================================== */
.gov-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notification-icon {
  position: relative;
  font-size: 20px;
  color: #555;
  cursor: pointer;
}

.badge-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background-color: #d32f2f;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 5px;
}

.avatar-container {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #e0e0e0;
  cursor: pointer;
}

.user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-container {
  background: linear-gradient(135deg, #1351b4 0%, #0d3270 100%);
  color: white;
  padding: 22px 20px;
  border-radius: 0 0 16px 16px;
  position: relative;
  overflow: hidden;
}

.user-greeting {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 6px;
}

.account-level {
  font-size: 12px;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.account-level strong {
  color: var(--yellow-gov);
}

.level-bar-container {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.level-segment {
  flex: 1;
  height: 6px;
  background-color: var(--yellow-gov);
  border-radius: 3px;
}

.btn-nivel {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.search-area {
  padding: 16px 20px 10px;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: #f0f2f5;
  border-radius: 8px;
  padding: 10px 14px;
  color: #666;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-dark);
  margin-left: 8px;
}

.section-title {
  padding: 14px 20px 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}

.services-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 80px;
}

.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.service-item:active {
  background: #f7f9fc;
  transform: scale(0.99);
}

.service-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.service-icon {
  font-size: 18px;
  color: var(--blue-gov);
  width: 24px;
  text-align: center;
}

.service-text {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.service-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-green-list {
  background-color: var(--green-gov);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  padding: 2px 7px;
}

.arrow-icon {
  color: #bbb;
  font-size: 14px;
}

/* ==========================================================================
   TELA 6: Carteira de Documentos (6.html)
   ========================================================================== */
.breadcrumb {
  padding: 14px 20px 6px;
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
}

.page-header {
  padding: 6px 20px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-arrow {
  font-size: 18px;
  color: var(--blue-gov);
  cursor: pointer;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.page-description {
  padding: 0 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.card-wrapper {
  margin: 0 20px 20px;
  background: linear-gradient(135deg, #184232 0%, #0d281e 100%);
  color: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(13, 40, 30, 0.25);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card-wrapper:active {
  transform: scale(0.98);
}

.doc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.doc-sigla {
  background-color: rgba(255, 255, 255, 0.2);
  color: #7bed9f;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.doc-nome {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  max-width: 70%;
  text-transform: uppercase;
}

.doc-bottom {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.label-registro {
  font-size: 11px;
  text-transform: uppercase;
  color: #a8d5c4;
  letter-spacing: 0.5px;
}

.value-registro {
  font-size: 16px;
  font-weight: 700;
  font-family: monospace;
}

.footer-info {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #7bed9f;
}

.fab {
  position: fixed;
  bottom: 80px;
  right: 25px;
  width: 52px;
  height: 52px;
  background-color: var(--blue-gov);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(19, 81, 180, 0.4);
  cursor: pointer;
}

/* ==========================================================================
   TELA 7: Carteira Digital / Visualizador HD (7.html)
   ========================================================================== */
.viewer-header {
  background: white;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.viewer-header .close-btn {
  font-size: 22px;
  color: var(--blue-gov);
  cursor: pointer;
  padding: 4px;
}

.doc-title-bar {
  background-color: var(--yellow-gov);
  color: var(--blue-gov);
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  padding: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.carousel-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
}

.carousel-track {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-slide {
  width: 33.3333%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card-canvas {
  width: 100%;
  max-width: 380px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  background-color: #fff;
}

.qr-card-container {
  background: white;
  width: 100%;
  max-width: 340px;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.qr-text-info {
  font-size: 12px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 16px;
}

.qr-code-wrapper {
  padding: 12px;
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 16px;
}

.qr-code-wrapper img, .qr-code-wrapper canvas {
  width: 170px;
  height: 170px;
  display: block;
}

.qr-text-footer {
  font-size: 12px;
  color: #222;
  font-weight: 600;
  line-height: 1.4;
}

.pagination {
  position: absolute;
  bottom: 16px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 20;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.dot.active {
  background: var(--blue-gov);
  transform: scale(1.25);
}

.carousel-nav-arrows {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
}

.carousel-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-gov);
  cursor: pointer;
  pointer-events: auto;
  font-size: 16px;
}

/* ==========================================================================
   BARRA DE NAVEGAÇÃO INFERIOR (BOTTOM NAV)
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  background-color: #ffffff;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #777;
  font-size: 10px;
  cursor: pointer;
  gap: 4px;
  text-decoration: none;
}

.nav-item i {
  font-size: 18px;
}

.nav-item.active {
  color: var(--blue-gov);
  font-weight: 700;
}

.nav-item.active i {
  color: var(--blue-gov);
}

/* Modal Foto de Perfil (5.html) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 340px;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-btn {
  background-color: var(--blue-gov);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}
