/* ======================================
   RESET LEGGERO / BASE PAGE WRAPPER
====================================== */

.page-shell {
  max-width: none;   /* full width */
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", Roboto, "Segoe UI", sans-serif;
  line-height: 1.4;
  background-color: transparent;
}

/* ======================================
   HERO CARD (testa pagina)
====================================== */
.hero-card {
  background: radial-gradient(circle at 0% 0%, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0) 60%);
  background-color: rgba(17, 20, 28, 0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
  box-shadow: 0 40px 120px rgba(0,0,0,0.8);
  padding: 1.5rem 1.5rem 2rem;
  margin: 2rem; /* un po' di respiro senza boxed */
}

/* Layout a due colonne, con fallback 1 colonna su mobile */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 2rem;
  row-gap: 2rem;
  align-items: flex-start;
}
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-left { min-width: 0; }
.hero-right { display: flex; align-items: flex-start; justify-content: flex-start; }

/* ======================================
   HEADER UTENTE (avatar, nome, bottone)
====================================== */
.hero-header-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
@media (max-width: 480px) { .hero-header-row { flex-wrap: wrap; } }

.hero-avatar {
  background: radial-gradient(circle at 20% 20%, #4f46e5 0%, #0ea5e9 60%);
  color: #fff;
  width: 3rem; height: 3rem; border-radius: 999px;
  font-size: 1rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
  flex-shrink: 0;
}

.hero-id-block { flex: 1; min-width: 0; }

.hero-name-row {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; margin-bottom: .25rem;
}
.hero-hello { font-size: 1.125rem; font-weight: 600; color: #fff; line-height: 1.3; margin: 0; }

.public-profile-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: .5rem;
  color: #fff; font-size: .8rem; font-weight: 500; line-height: 1.2;
  padding: .5rem .75rem; text-decoration: none;
  box-shadow: 0 24px 48px rgba(0,0,0,0.6); white-space: nowrap;
}
.public-profile-btn:hover { background: rgba(255,255,255,0.12); }

.hero-subtext { margin: 0; font-size: .9rem; color: rgba(255,255,255,0.7); line-height: 1.4; }

/* ======================================
   AREA STATISTICHE + LINK PUBBLICO
====================================== */
.hero-stats-area { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; }
@media (max-width: 600px) { .hero-stats-area { flex-direction: column; gap: 1rem; } }

.stats-stack { display: flex; flex-direction: column; gap: .75rem; min-width: 170px; max-width: 200px; flex-shrink: 0; }
.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: .75rem; box-shadow: 0 24px 48px rgba(0,0,0,0.7); padding: .75rem 1rem;
}
.stat-value { font-size: 1rem; font-weight: 600; color: #fff; line-height: 1.2; margin-bottom: .35rem; }
.stat-label { font-size: .75rem; line-height: 1.2; color: rgba(255,255,255,0.6); }

.public-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: .75rem; box-shadow: 0 24px 48px rgba(0,0,0,0.7); padding: 1rem;
  flex: 1; min-width: 220px;
}
.public-card-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; row-gap: .5rem; margin-bottom: .75rem; }
.public-card-title { font-size: .8rem; font-weight: 500; color: rgba(255,255,255,0.7); line-height: 1.2; }

.mini-open-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25);
  border-radius: .5rem; padding: .45rem .6rem; line-height: 1; font-size: .8rem; color:#fff; font-weight:500;
  text-decoration:none; box-shadow:0 16px 32px rgba(0,0,0,0.6); display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
}
.mini-open-btn:hover { background: rgba(255,255,255,0.15); }

.public-url {
  display: block; font-size: .75rem; line-height: 1.3; color: #fff; word-break: break-all;
  background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.15); border-radius: .5rem; padding: .6rem .7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin-bottom: .75rem;
}
.public-actions-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.qr-open-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25);
  border-radius: .5rem; padding: .5rem .7rem; font-size: .8rem; font-weight: 500; color: #fff; line-height: 1.2;
  box-shadow:0 16px 32px rgba(0,0,0,0.6); cursor: pointer; white-space: nowrap;
}
.qr-open-btn:hover { background: rgba(255,255,255,0.15); }

/* ======================================
   QR PREVIEW
====================================== */
.qr-preview-card {
  background: #fff; border-radius: .75rem; border: 1px solid #d1d5db;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6); padding: 1rem; width: fit-content;
}
.qr-preview-img { width: 120px; height: 120px; object-fit: contain; display: block; }
@media (max-width: 800px) {
  .hero-right { order: 99; }
  .qr-preview-card { background: #fff; margin-top: .5rem; }
}

/* ======================================
   BLOCCO "GESTISCI IL TUO PROFILO"
====================================== */
.manage-card {
  background-color: #f9fafb; color: #0f172a; border-radius: 1rem; box-shadow: 0 40px 100px rgba(0,0,0,0.6);
  border: 1px solid #e5e7eb; padding: 1.25rem 1.25rem 1.5rem; margin: 2rem;
}
.manage-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; row-gap: .75rem; margin-bottom: 1rem; }
.manage-head-left { min-width: 0; }
.manage-title { margin: 0; font-size: 1rem; font-weight: 600; color: #0f172a; line-height: 1.3; display: flex; align-items: center; gap: .4rem; }
.manage-desc { margin: .25rem 0 0 0; font-size: .8rem; color: #6b7280; line-height: 1.3; }

.manage-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px,100%), 1fr));
  gap: .75rem; margin-top: .75rem;
}
.manage-item {
  background: #fff; border: 1px solid #e5e7eb; border-radius: .75rem; box-shadow: 0 24px 60px rgba(0,0,0,0.08);
  padding: .9rem 1rem; display: flex; align-items: flex-start; gap: .75rem; text-decoration: none; transition: all .15s; position: relative;
}
.manage-item:hover { background: #f3f4f6; }

.manage-icon { font-size: 1.25rem; line-height: 1; }
.manage-body { flex: 1; min-width: 0; }
.manage-label { font-size: .9rem; font-weight: 500; color: #0f172a; line-height: 1.3; }
.manage-arrow { font-size: 1rem; font-weight: 500; color: #6b7280; line-height: 1; }

/* ======================================
   MODALE QR
====================================== */
.qr-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 2rem;
}
.qr-modal {
  background: #fff; border-radius: 1rem; border: 1px solid #e5e7eb; box-shadow: 0 40px 80px rgba(0,0,0,0.4);
  max-width: 320px; width: 100%; padding: 1.5rem; text-align: center; position: relative;
}
.qr-close-btn {
  position: absolute; top: .75rem; right: .75rem; background: #f3f4f6; border: 1px solid #d1d5db;
  border-radius: .5rem; padding: .4rem .5rem; line-height:1; font-size:.8rem; font-weight:500; color:#374151; cursor:pointer;
}
.qr-close-btn:hover { background:#e5e7eb; }
.qr-modal-title { font-size: .95rem; font-weight: 600; color: #0f172a; line-height: 1.3; margin: 0 0 .75rem; }
.qr-modal-img-wrap {
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: .75rem; padding: 1rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 24px rgba(0,0,0,0.05);
}
.qr-modal-img-wrap img { width: 160px; height: 160px; object-fit: contain; }
.qr-public-url {
  font-size: .75rem; line-height: 1.3; color: #6b7280; word-break: break-all; margin-top: .75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background:#f3f4f6; border-radius:.5rem; padding:.5rem; border:1px solid #e5e7eb;
}
.qr-download-btn {
  display:inline-block; margin-top:1rem; font-size:.8rem; line-height:1.2; font-weight:500;
  background:#111827; color:#fff; border:1px solid #000; border-radius:.5rem; padding:.5rem .75rem; text-decoration:none; box-shadow:0 16px 32px rgba(0,0,0,0.2);
}
.qr-download-btn:hover { background:#1f2937; }


/* === Avatar (cerchio) === */
.hero-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Wrapper per cerchio perfetto */
.hero-avatar-wrapper {
  width: 80px;                  /* puoi regolare la dimensione */
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(145deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* immagine dentro il cerchio */
.hero-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;           /* sempre dentro il cerchio */
  border-radius: 50%;
  display: block;
}

/* iniziale fallback */
.hero-avatar-initial {
  color: #fff;
  font-size: 2rem;
  font-weight: 600;
  user-select: none;
}
