:root{
  --hx-bg:
    radial-gradient(circle at top left, rgba(198,255,70,.10), transparent 28%),
    radial-gradient(circle at top right, rgba(255,122,89,.10), transparent 24%),
    radial-gradient(circle at 50% 20%, rgba(146,110,255,.10), transparent 26%),
    linear-gradient(180deg, #0b1020 0%, #0e1326 44%, #11182d 100%);

  --hx-surface: rgba(255,255,255,.06);
  --hx-surface-2: rgba(255,255,255,.10);
  --hx-card: rgba(255,255,255,.82);
  --hx-card-strong: rgba(255,255,255,.92);
  --hx-border: rgba(255,255,255,.14);
  --hx-border-soft: rgba(255,255,255,.08);

  --hx-text: #f5f7ff;
  --hx-text-dark: #0e1324;
  --hx-muted: rgba(245,247,255,.72);
  --hx-muted-dark: rgba(14,19,36,.64);

  --hx-lime: #c6ff46;
  --hx-coral: #ff7a59;
  --hx-violet: #926eff;
  --hx-cyan: #7de7ff;

  --hx-success: #18c37e;
  --hx-shadow-lg: 0 30px 80px rgba(0,0,0,.34);
  --hx-shadow-md: 0 18px 40px rgba(0,0,0,.22);
  --hx-shadow-sm: 0 10px 24px rgba(0,0,0,.16);

  --hx-radius-xl: 28px;
  --hx-radius-lg: 22px;
  --hx-radius-md: 18px;
  --hx-radius-sm: 14px;
}

html{
  scroll-behavior: smooth;
}

body.hx-body{
  background: var(--hx-bg);
  color: var(--hx-text);
  min-height: 100vh;
  letter-spacing: -.01em;
}

body.hx-body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.025), rgba(255,255,255,.025)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 72px,
      rgba(255,255,255,.025) 73px
    );
  mask-image: linear-gradient(180deg, rgba(0,0,0,.35), transparent 92%);
  opacity: .18;
}

.container{
  position: relative;
}

.hx-topbar{
  background: rgba(8,12,24,.55) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 30px rgba(0,0,0,.14);
}

.hx-brand{
  font-weight: 900;
  font-size: 1.42rem;
  color: #fff !important;
  letter-spacing: -.03em;
}

.hx-brand-sub{
  color: rgba(255,255,255,.56);
  font-weight: 700;
  margin-left: 8px;
}

.navbar .nav-link{
  color: rgba(255,255,255,.78) !important;
  font-weight: 600;
}

.navbar .nav-link:hover{
  color: #fff !important;
}

.navbar .btn-primary,
.btn.btn-primary{
  background: linear-gradient(135deg, var(--hx-lime) 0%, #e7ff9a 100%);
  border: 0;
  color: #10151f;
  font-weight: 800;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(198,255,70,.22);
}

.navbar .btn-primary:hover,
.btn.btn-primary:hover{
  color: #10151f;
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(198,255,70,.26);
}

.btn{
  transition: all .22s ease;
}

.btn.btn-success{
  background: linear-gradient(135deg, var(--hx-coral) 0%, #ffb38f 100%);
  border: 0;
  color: #191919;
  font-weight: 800;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(255,122,89,.20);
}

.btn.btn-success:hover{
  color: #191919;
  transform: translateY(-1px);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-light{
  border-radius: 14px;
  font-weight: 700;
}

.btn-outline-primary{
  border-color: rgba(146,110,255,.42);
  color: #5940b0;
  background: rgba(146,110,255,.08);
}

.btn-outline-primary:hover{
  background: rgba(146,110,255,.14);
  border-color: rgba(146,110,255,.55);
  color: #422b96;
}

.btn-outline-secondary{
  border-color: rgba(125,231,255,.45);
  color: #0f5771;
  background: rgba(125,231,255,.11);
}

.btn-outline-secondary:hover{
  background: rgba(125,231,255,.16);
  border-color: rgba(125,231,255,.62);
  color: #0c4a61;
}

.hx-search .form-control{
  width: min(520px, 100%);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
  backdrop-filter: blur(10px);
}

.hx-search .form-control::placeholder{
  color: rgba(255,255,255,.42);
}

.hx-card{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--hx-radius-xl);
  background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.82));
  box-shadow: var(--hx-shadow-lg);
  color: var(--hx-text-dark);
  overflow: hidden;
}

.hx-card .text-muted,
.hx-card .small.text-muted{
  color: var(--hx-muted-dark) !important;
}

.hx-alert{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--hx-shadow-md);
}

.hx-hero{
  padding: 18px 4px 10px;
}

.hx-hero h1{
  color: #f8fbff;
  font-size: clamp(2.4rem, 5.4vw, 4.65rem);
  line-height: .95;
  letter-spacing: -.05em;
  font-weight: 950;
  max-width: 12ch;
  margin-bottom: 20px;
  text-wrap: balance;
}

.hx-hero .lead{
  color: rgba(245,247,255,.78) !important;
  max-width: 58ch;
  font-size: clamp(1rem, 1.8vw, 1.32rem);
  line-height: 1.55;
}

.hx-badge{
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  letter-spacing: -.01em;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.hx-mini-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.hx-mini-card{
  position: relative;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  backdrop-filter: blur(16px);
  color: #fff;
  padding: 18px 16px;
  min-height: 126px;
  box-shadow: 0 16px 34px rgba(0,0,0,.18);
}

.hx-mini-card::before{
  content:"";
  position: absolute;
  inset: auto auto 0 0;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: radial-gradient(circle, rgba(198,255,70,.22), transparent 68%);
  pointer-events: none;
}

.hx-mini-title{
  font-weight: 900;
  font-size: 1.08rem;
  margin-bottom: 8px;
  letter-spacing: -.02em;
}

.hx-mini-text{
  color: rgba(245,247,255,.72);
  font-size: .96rem;
  line-height: 1.45;
}

.hx-avatar{
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #10151f;
  background: linear-gradient(135deg, var(--hx-lime), #fff0a8);
  box-shadow: 0 12px 28px rgba(198,255,70,.20);
}

.hx-avatar-sm{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #10151f;
  background: linear-gradient(135deg, var(--hx-cyan), #d8fbff);
  box-shadow: 0 10px 22px rgba(125,231,255,.20);
}

.hx-media{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hx-media img{
  width: 180px;
  max-width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--hx-shadow-sm);
}

.hx-modal{
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,247,252,.94));
  box-shadow: var(--hx-shadow-lg);
}

.modal-content{
  border: 0;
}

.modal-header,
.modal-footer{
  border-color: rgba(14,19,36,.08);
}

.form-control,
.form-select{
  border-radius: 16px;
  border: 1px solid rgba(14,19,36,.10);
  min-height: 50px;
  background: rgba(248,250,255,.92);
  color: #0e1324;
  box-shadow: none;
}

.form-control:focus,
.form-select:focus{
  border-color: rgba(146,110,255,.52);
  box-shadow: 0 0 0 4px rgba(146,110,255,.10);
  background: #fff;
}

textarea.form-control{
  min-height: 120px;
}

.hx-grid-status{
  margin-top: 28px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  backdrop-filter: blur(18px);
  box-shadow: var(--hx-shadow-lg);
  padding: 16px;
}

.hx-grid-cards{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.hx-stat{
  position: relative;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.93), rgba(255,255,255,.84));
  color: var(--hx-text-dark);
  box-shadow: var(--hx-shadow-md);
  padding: 18px 16px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hx-stat::before{
  content:"";
  position: absolute;
  inset: auto -30px -30px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(198,255,70,.28), transparent 64%);
  pointer-events: none;
}

.hx-stat:nth-child(2)::before{
  background: radial-gradient(circle, rgba(255,122,89,.23), transparent 64%);
}

.hx-stat:nth-child(3)::before{
  background: radial-gradient(circle, rgba(146,110,255,.23), transparent 64%);
}

.hx-stat:nth-child(4)::before{
  background: radial-gradient(circle, rgba(125,231,255,.26), transparent 64%);
}

.hx-stat-title{
  font-weight: 900;
  font-size: .82rem;
  color: var(--hx-muted-dark);
  text-transform: uppercase;
  letter-spacing: .08em;
  position: relative;
}

.hx-stat-value{
  margin-top: 8px;
  font-weight: 950;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -.05em;
  color: var(--hx-text-dark);
  position: relative;
  line-height: 1;
}

.hx-login-uri{
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.84));
  color: var(--hx-text-dark);
  box-shadow: var(--hx-shadow-md);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.hx-login-uri::before{
  content:"";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(198,255,70,.18), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(255,122,89,.14), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(146,110,255,.12), transparent 28%);
  pointer-events: none;
}

.hx-login-uri-title{
  font-weight: 900;
  font-size: .82rem;
  color: var(--hx-muted-dark);
  text-transform: uppercase;
  letter-spacing: .08em;
  position: relative;
}

.hx-login-uri-value{
  margin-top: 10px;
  font-weight: 950;
  font-size: clamp(1.15rem, 2.4vw, 2rem);
  line-height: 1.2;
  color: var(--hx-text-dark);
  word-break: break-word;
  position: relative;
}

.badge.text-bg-success{
  background: rgba(24,195,126,.14) !important;
  color: #0d7a4f !important;
  border: 1px solid rgba(24,195,126,.22);
}

.badge.text-bg-secondary{
  background: rgba(14,19,36,.08) !important;
  color: #4a556f !important;
  border: 1px solid rgba(14,19,36,.10);
}

.dropdown-menu{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--hx-shadow-md);
  overflow: hidden;
}

footer{
  color: rgba(245,247,255,.62);
}

footer .text-muted,
footer a.text-muted{
  color: rgba(245,247,255,.62) !important;
}

footer a.text-muted:hover{
  color: #fff !important;
}

.hx-profile-link{
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.hx-profile-link:hover{
  text-decoration: none;
  opacity: .82;
}

/* FIX MODAL BOOTSTRAP */
.modal{
  z-index: 2000;
}

.modal-backdrop{
  z-index: 1990;
}

.modal-dialog{
  position: relative;
  z-index: 2001;
  pointer-events: auto;
}

.modal-content{
  position: relative;
  z-index: 2002;
  pointer-events: auto;
}

.modal-header,
.modal-body,
.modal-footer{
  position: relative;
  z-index: 2003;
}

.modal-body,
.modal-body *{
  pointer-events: auto;
}

.modal input,
.modal select,
.modal textarea,
.modal button,
.modal label{
  pointer-events: auto;
}

@media (max-width: 1199px){
  .hx-hero h1{
    max-width: 13ch;
  }
}

@media (max-width: 991.98px){
  main.container{
    padding-top: 18px !important;
  }

  .hx-mini-grid{
    grid-template-columns: 1fr;
  }

  .hx-grid-cards{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .navbar-collapse{
    margin-top: 14px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(14px);
  }

  .navbar .btn,
  .navbar .nav-link{
    width: 100%;
  }
}

@media (max-width: 767.98px){
  .hx-topbar .container{
    padding-left: 14px;
    padding-right: 14px;
  }

  main.container{
    padding-left: 14px;
    padding-right: 14px;
  }

  .hx-hero{
    padding-top: 6px;
  }

  .hx-hero h1{
    font-size: clamp(2.15rem, 10vw, 3.2rem);
    max-width: none;
    line-height: .98;
    margin-bottom: 16px;
  }

  .hx-hero .lead{
    font-size: 1rem;
    line-height: 1.5;
  }

  .hx-card{
    border-radius: 24px;
  }

  .hx-grid-status{
    border-radius: 24px;
    padding: 12px;
  }

  .hx-grid-cards{
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .hx-stat{
    border-radius: 20px;
    min-height: 104px;
    padding: 14px;
  }

  .hx-stat-title{
    font-size: .74rem;
  }

  .hx-stat-value{
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }

  .hx-login-uri{
    border-radius: 20px;
    padding: 14px;
  }

  .hx-login-uri-value{
    font-size: 1.14rem;
    line-height: 1.25;
  }

  .modal-dialog{
    margin: 12px;
  }

  .modal-content{
    border-radius: 22px;
  }

  .btn{
    min-height: 48px;
  }
}

@media (max-width: 520px){
  .hx-grid-cards{
    grid-template-columns: 1fr;
  }

  .hx-login-uri .d-flex{
    align-items: flex-start !important;
  }

  .hx-login-uri .btn{
    width: 100%;
  }

  .hx-badge{
    width: 100%;
    text-align: center;
  }

  .hx-mini-card{
    min-height: auto;
  }

  .form-control,
  .form-select{
    min-height: 48px;
  }
}
/* =========================================================
   FIX CONTRASTO: card/bootstrap su sfondi chiari
   ========================================================= */

.card,
.card .card-body,
.card .card-header,
.card .card-footer,
.modal-content,
.dropdown-menu,
.table,
.table thead,
.table tbody,
.table tr,
.table th,
.table td,
.list-group,
.list-group-item,
.pagination .page-link,
.page-item .page-link{
  color: var(--hx-text-dark);
}

.card .text-muted,
.card .small.text-muted,
.modal-content .text-muted,
.dropdown-menu .text-muted,
.table .text-muted,
.list-group-item .text-muted{
  color: var(--hx-muted-dark) !important;
}

.card a:not(.btn):not(.nav-link),
.modal-content a:not(.btn):not(.nav-link),
.dropdown-menu a:not(.btn):not(.dropdown-item){
  color: #3f46c8;
}

.card a:not(.btn):not(.nav-link):hover,
.modal-content a:not(.btn):not(.nav-link):hover,
.dropdown-menu a:not(.btn):not(.dropdown-item):hover{
  color: #2d3199;
}

/* titoli e testi dentro le card del profilo/community */
.card .fw-bold,
.card .fw-semibold,
.card strong,
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6{
  color: var(--hx-text-dark);
}

/* tabelle admin leggibili */
.table{
  --bs-table-color: var(--hx-text-dark);
  --bs-table-striped-color: var(--hx-text-dark);
  --bs-table-hover-color: var(--hx-text-dark);
}

.table-light,
.table-light th,
.table-light td{
  color: var(--hx-text-dark) !important;
}

/* dropdown leggibile */
.dropdown-menu .dropdown-item{
  color: var(--hx-text-dark);
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus{
  color: var(--hx-text-dark);
  background: rgba(146,110,255,.10);
}

.dropdown-menu .dropdown-header{
  color: var(--hx-muted-dark);
}

/* card profilo/amici/post */
.hx-post-card,
.hx-post-card .card-body,
.hx-friend,
.hx-friend-name,
.hx-friend-left,
.hx-cover-actions + *{
  color: var(--hx-text-dark);
}

/* chip/stato amici più leggibili */
.hx-chip{
  color: var(--hx-text-dark);
}

.hx-chip.on{
  color: #0d7a4f;
}

.hx-chip.off{
  color: #6b7280;
}

/* nav pills profilo */
.nav-pills .nav-link{
  color: rgba(245,247,255,.82);
  border-radius: 14px;
}

.nav-pills .nav-link:hover{
  color: #fff;
  background: rgba(255,255,255,.08);
}

.nav-pills .nav-link.active{
  color: #ffffff;
}

/* pagination leggibile */
.page-link{
  background: rgba(255,255,255,.88);
  border-color: rgba(14,19,36,.08);
}

.page-item.active .page-link{
  color: #10151f;
  background: linear-gradient(135deg, var(--hx-lime) 0%, #e7ff9a 100%);
  border-color: transparent;
}

/* form piccoli nelle tabelle/admin */
.form-control.form-control-sm,
.form-select.form-select-sm{
  color: var(--hx-text-dark);
}