/* =========================
   BASE / RESET
   ========================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

:root {
  --hg-bg: #050008;
  --hg-bg-soft: #0d0513;
  --hg-surface: #16051f;
  --hg-surface-soft: #1f0a2b;
  --hg-primary: #ff2e6e;
  --hg-primary-soft: #ff5c90;
  --hg-text: #ffffff;
  --hg-muted: #b7a3c7;
  --hg-border: #392043;
  --hg-radius: 18px;
  --hg-radius-sm: 10px;
  --hg-shadow: 0 14px 40px rgba(0,0,0,0.55);
  --hg-font-main: "Montserrat", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--hg-font-main);
  background:
    radial-gradient(900px 400px at 50% -150px, #2b0020 0, #0b020f 50%, #020005 100%);
  color: var(--hg-text);
}

/* Utilidades */
.d-none { display: none !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }

/* =========================
   AUTH (view-auth.php)
   ========================= */

.hg-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.hg-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 22px 20px 18px;
  background: radial-gradient(120% 160% at -10% -10%, rgba(255,46,110,0.06), transparent),
              radial-gradient(120% 160% at 110% -10%, rgba(255,255,255,0.03), transparent),
              rgba(7, 1, 12, 0.98);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--hg-shadow);
}

.hg-logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.hg-logo-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hg-primary), var(--hg-primary-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.65);
}

.hg-logo-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.hg-logo-text p {
  margin: 0;
  font-size: 13px;
  color: var(--hg-muted);
}

/* Deixa todos os steps visíveis por padrão */
.hg-auth-step {
    display: block;
}

/* Esconde só quando tiver a classe d-none (usada pelo PHP/JS) */
.hg-auth-step.d-none {
    display: none !important;
}

.hg-label {
  font-size: 12px;
  color: var(--hg-muted);
  margin-bottom: 4px;
}

.hg-input {
  background: var(--hg-surface);
  border-radius: var(--hg-radius-sm);
  border: 1px solid var(--hg-border);
  color: var(--hg-text);
  font-size: 13px;
  padding: 9px 11px;
}

.hg-input::placeholder {
  color: #7b627f;
}

.hg-btn-full {
  width: 100%;
  border-radius: 999px;
  font-weight: 600;
}

.hg-link {
  font-size: 11px;
  color: var(--hg-primary-soft);
  text-decoration: none;
  padding: 0;
}

.hg-link:hover {
  text-decoration: underline;
}

.hg-sub {
  font-size: 12px;
  color: var(--hg-muted);
}

.hg-step-title h2 {
  margin: 0 0 2px;
  font-size: 18px;
}

.hg-step-title p {
  margin: 0;
}

.hg-alert {
  font-size: 12px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(255,46,110,0.1);
  border: 1px solid rgba(255,46,110,0.35);
  color: #ff96b9;
}

/* =========================
   APP WRAPPER (view-app.php)
   ========================= */

.hg-app-wrapper {
  position: relative;
  min-height: 100vh;
  padding-bottom: 68px; /* espaço pro bottom nav */
  background:
    radial-gradient(900px 400px at 50% -150px, #2b0020 0, #050008 55%, #010003 100%);
}

.hg-app-views {
  padding: 14px 14px 10px;
}

/* Views internas */
.hg-view {
  display: none;
}

.hg-view.is-active {
  display: block;
}

/* =========================
   HOME (view-home.php)
   ========================= */

.hg-app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 6px;
  background: radial-gradient(260px 120px at -40px -30px, rgba(255,46,110,0.12), transparent);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.04);
}

.hg-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--hg-primary), var(--hg-primary-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0,0,0,0.7);
}

.hg-user-info .hg-hello {
  margin: 0;
  font-size: 11px;
  color: var(--hg-muted);
}

.hg-user-info .hg-username {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

/* Carrossel */
.hg-carousel {
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.hg-carousel-inner {
  display: flex;
  gap: 10px;
}

.hg-carousel-item {
  flex: 0 0 82%;
  max-width: 320px;
  cursor: pointer;
}

.hg-card-highlight {
  padding: 12px 12px 10px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,46,110,0.18), rgba(14,2,19,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--hg-shadow);
}

.hg-card-highlight h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.hg-card-highlight p {
  margin: 0;
  font-size: 12px;
}

.hg-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.5);
  color: var(--hg-primary-soft);
  font-size: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Módulos lista */
.hg-modules {
  margin-top: 18px;
}

.hg-section-title {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--hg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hg-module-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  margin-bottom: 8px;
  background: var(--hg-bg-soft);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.65);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.hg-module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.7);
  border-color: rgba(255,46,110,0.4);
}

.hg-module-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: var(--hg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.hg-module-content h5 {
  margin: 0;
  font-size: 14px;
}

.hg-module-content p {
  margin: 0;
  font-size: 11px;
  color: var(--hg-muted);
}

.hg-module-status {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.hg-badge-small {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hg-primary);
  color: #fff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hg-arrow {
  font-size: 14px;
  color: var(--hg-muted);
}

/* =========================
   CONEXÕES (view-connections.php)
   ========================= */

.hg-modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.hg-modal-header h3 {
  margin: 0;
  font-size: 17px;
}

.hg-close-view {
  border: none;
  background: transparent;
  color: var(--hg-muted);
  font-size: 18px;
  cursor: pointer;
}

#hg-connections-view,
#hg-menu-view{
  padding: 16px;
}

.hg-connections-body {
  background: var(--hg-bg-soft);
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--hg-shadow);
}

.hg-search-box {
  display: flex;
  gap: 8px;
}

.hg-btn-search {
  border-radius: 999px;
  padding: 0 14px;
  font-size: 12px;
}

.hg-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hg-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 12px;
  background: var(--hg-surface);
  border: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}

.hg-subtitle {
  margin: 10px 0 5px;
  font-size: 12px;
  color: var(--hg-muted);
}

.hg-help {
  font-size: 10px;
  color: var(--hg-muted);
}

.hg-share-link {
  margin-top: 4px;
  padding: 10px;
  border-radius: 12px;
  background: #0b030f;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 10px;
  word-break: break-all;
  cursor: pointer;
}

.hg-item-share{
  margin-bottom: 20px;
}

/* =========================
   MENU (view-menu.php)
   ========================= */

.hg-view-menu .hg-menu-body {
  background: var(--hg-bg-soft);
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--hg-shadow);
}

.hg-menu-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--hg-surface);
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--hg-text);
  cursor: pointer;
  font-size: 13px;
}

.hg-menu-item .hg-arrow {
  font-size: 13px;
}

.hg-menu-logout {
  background: rgba(255,46,110,0.06);
  border-color: rgba(255,46,110,0.4);
  color: var(--hg-primary-soft);
}

/* =========================
   BOTTOM NAV (view-app.php)
   ========================= */

.hg-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 10px;
  padding: 0 14px;
  z-index: 90;
  display: flex;
  justify-content:center;
  align-items: center;
}

.hg-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hg-nav-btn {
  flex: 1;
  margin: 0 4px;
  padding: 8px 6px 6px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(5,0,10,0.9);
  color: var(--hg-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hg-nav-btn .hg-nav-icon {
  font-size: 16px;
}

.hg-nav-btn.is-active {
  background: var(--hg-primary);
  color: #fff;
  border-color: var(--hg-primary-soft);
  box-shadow: 0 8px 18px rgba(0,0,0,0.75);
}

.hg-nav-label {
  font-size: 10px;
}

.hg-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffeb3b;
  margin-top: 1px;
}

/* =========================
   TOAST
   ========================= */

.hg-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  background: #000;
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: all 0.2s ease;
}
.hg-toast.show {
  opacity: 0.96;
  transform: translateX(-50%) translateY(0);
}


/* AUTH WRAPPER */
.hg-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 400px at 50% -150px, #2b0020 0, #0b020f 55%, #020005 100%);
}

/* CARD */
.hg-auth-card {
  width: 100%;
  max-width: 440px;
  padding: 22px 22px 18px;
  background:
    radial-gradient(160% 160% at -20% -30%, rgba(255,46,110,0.09), transparent),
    radial-gradient(140% 160% at 120% -40%, rgba(255,255,255,0.04), transparent),
    rgba(6, 1, 12, 0.98);
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.75);
}

/* LOGO / TÍTULO */
.hg-logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.hg-logo-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hg-primary), var(--hg-primary-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,0.8);
}

.hg-logo-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}
.hg-logo-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--hg-muted);
}

/* STEPS */

/* LABEL + INPUT */
.hg-label {
  display: block;
  font-size: 11px;
  color: var(--hg-muted);
  margin: 8px 0 2px;
}

.hg-input {
  width: 100%;
  background: var(--hg-surface);
  border-radius: 12px;
  border: 1px solid var(--hg-border);
  color: var(--hg-text);
  font-size: 13px;
  padding: 9px 11px;
  outline: none;
}
.hg-input:focus {
  border-color: var(--hg-primary);
  box-shadow: 0 0 0 1px rgba(255,46,110,0.25);
}
.hg-input::placeholder {
  color: #7b627f;
}

/* BOTÃO PRINCIPAL */
.hg-btn-full {
  width: 100%;
  border-radius: 999px;
  font-weight: 600;
  padding: 9px 12px;
  font-size: 13px;
}
.btn.btn-primary.hg-btn-full {
  background: var(--hg-primary);
  border-color: var(--hg-primary);
}
.btn.btn-primary.hg-btn-full:hover {
  background: var(--hg-primary-soft);
  border-color: var(--hg-primary-soft);
}

/* LINKS "Esqueci a senha" / "Voltar" */
.hg-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--hg-muted);
  text-decoration: none;
}
.hg-link:hover {
  color: var(--hg-primary-soft);
  text-decoration: underline;
}

/* TITULOS DOS STEPS */
.hg-step-title h2 {
  margin: 4px 0 2px;
  font-size: 18px;
  font-weight: 600;
}
.hg-step-title .hg-sub {
  margin: 0;
  font-size: 11px;
  color: var(--hg-muted);
}

/* ALERTA */
.hg-alert {
  font-size: 11px;
  padding: 7px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(255,46,110,0.06);
  border: 1px solid rgba(255,46,110,0.4);
  color: #ff9fbd;
}

#hg-toast-box {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(8px);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  background: #111;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
}
#hg-toast-box.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#hg-toast-box.is-success { background: #ff2f68; }
#hg-toast-box.is-error { background: #ff4444; }

.sp-photo-popup { background: transparent !important; padding: 0 !important; box-shadow: none !important; }
.sp-photo-close {
  position: fixed !important;
  top: 10px !important;
  right: 12px !important;
  color: #fff !important;
  opacity: 0.9 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  outline: none !important;
}
.sp-photo-close:hover { opacity: 1 !important; }