/* =============================================
   THE WALL OF LINKS – CSS Completo
   ============================================= */

/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

/* --- Reset & variabili --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0e0e0e;
  --surface:   #1a1a1a;
  --border:    #2a2a2a;
  --text:      #e8e8e8;
  --text-dim:  #888;
  --accent:    #e86a33;
  --accent-glow: rgba(232, 106, 51, .35);
  --brick-free-small:  #b5704f;
  --brick-free-big:    #c47d55;
  --brick-occupied:    #3a2a20;
  --mortar:    #2a1f18;
  --success:   #4caf50;
  --danger:    #ef5350;
  --radius:    10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Utility --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #ff8a50; }

/* =============================================
   NAVIGAZIONE
   ============================================= */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(14,14,14,.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.top-nav .logo {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--text);
}
.top-nav .logo span { color: var(--accent); }
.top-nav .nav-links { display: flex; gap: 16px; font-size: .88rem; align-items: center; }
.btn-nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 6px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: .82rem;
  transition: background .2s;
}
.btn-nav-cta:hover { background: #ff8a50; color: #fff !important; }

/* =============================================
   SEZIONE 1: WALL HERO (protagonista)
   ============================================= */
.wall-hero {
  padding: 32px 24px 40px;
  background: linear-gradient(180deg, #181210 0%, var(--bg) 100%);
}
.wall-hero-header {
  text-align: center;
  margin-bottom: 24px;
}
.wall-hero-header h1 {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), #fca95c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wall-hero-header .subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
}
.hero-price {
  color: var(--text);
  font-size: 1.1rem;
  margin-top: 8px;
}
.hero-price strong {
  color: var(--accent);
  font-size: 1.3rem;
}

/* CTA sotto il muro */
.wall-cta {
  text-align: center;
  margin-top: 28px;
}
.cta-sub {
  color: var(--text-dim);
  font-size: .85rem;
  margin-top: 10px;
}

/* Statistiche */
.wall-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
}
.stat-item { text-align: center; }
.stat-item .stat-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
}
.stat-item .stat-label {
  font-size: .72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Muro */
.wall-wrapper {
  background: var(--mortar);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: inset 0 2px 12px rgba(0,0,0,.5), 0 4px 24px rgba(0,0,0,.4);
  overflow-x: auto;
  max-width: 1100px;
  margin: 0 auto;
}
.wall {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  min-width: 800px;
}

/* Legenda */
.wall-legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 16px;
  font-size: .82rem;
  color: var(--text-dim);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch {
  width: 18px; height: 12px;
  border-radius: 2px;
  display: inline-block;
}
.legend-swatch.free  { background: #b5704f; }
.legend-swatch.taken { background: var(--brick-occupied); }

/* CTA sotto il muro */
.wall-cta {
  text-align: center;
  margin-top: 28px;
}

/* =============================================
   MATTONE SINGOLO
   ============================================= */
.brick {
  position: relative;
  height: 28px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  cursor: default;
  transition: transform .15s, box-shadow .15s, filter .15s;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}
.brick.small { width: 56px; }
.brick.big   { width: 112px; }

.brick.free {
  cursor: pointer;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.2);
}
.brick.free.small {
  background: linear-gradient(160deg, #c98860, #a5603e);
  color: rgba(255,255,255,.85);
}
.brick.free.big {
  background: linear-gradient(160deg, #d49a6e, #b56f48);
  color: rgba(255,255,255,.85);
}
.brick.free:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 12px rgba(232,106,51,.4);
  z-index: 2;
  filter: brightness(1.15);
}

.brick.occupied {
  background: var(--brick-occupied);
  color: rgba(255,255,255,.3);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.5);
}
.brick.occupied img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
  border-radius: 2px;
}

/* Tooltip */
.brick[data-tooltip] { position: relative; }
.brick[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(.9);
  background: #222;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s, transform .15s;
  z-index: 10;
}
.brick[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* =============================================
   SEZIONE 2: COME FUNZIONA
   ============================================= */
.how-it-works {
  padding: 56px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.how-it-works h2 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 32px;
  font-weight: 900;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}
.step-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: transform .2s, border-color .2s;
}
.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #d4552a);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: 16px;
}
.step-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}
.step-card p {
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* =============================================
   SEZIONE 3: ACQUISTO (due colonne)
   ============================================= */
.buy-section {
  padding: 56px 0;
}
.buy-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

/* Colonna sinistra: form */
.buy-form-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.buy-form-col h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--accent), #fca95c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.buy-desc {
  color: var(--text-dim);
  font-size: .9rem;
  margin-bottom: 24px;
}
.buy-step label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .9rem;
}
.buy-step input[type="email"],
.buy-step input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 16px;
  transition: border-color .2s;
  font-family: inherit;
}
.buy-step input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.buy-instruction {
  color: var(--text-dim);
  font-size: .9rem;
  margin-bottom: 16px;
}

.step-success-badge {
  display: inline-block;
  background: rgba(76,175,80,.15);
  color: var(--success);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Colonna destra: info */
.buy-info-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.info-card h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}
.info-card ul {
  list-style: none;
  padding: 0;
}
.info-card li {
  font-size: .85rem;
  color: var(--text-dim);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}
.info-card li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.info-card p {
  font-size: .85rem;
  color: var(--text-dim);
}

.price-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.price-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .88rem;
}
.price-brick {
  border-radius: 3px;
  height: 20px;
  flex-shrink: 0;
}
.price-brick.small-sample {
  width: 40px;
  background: linear-gradient(160deg, #c98860, #a5603e);
}
.price-brick.big-sample {
  width: 80px;
  background: linear-gradient(160deg, #d49a6e, #b56f48);
}

/* --- Pannello acquisto nel form --- */
.buy-step h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.price-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Successo dentro form */
.buy-step .checkmark {
  font-size: 2.5rem;
  margin-bottom: 12px;
  text-align: center;
}
.buy-step .brick-code-display {
  display: block;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  margin: 12px 0;
}

/* =============================================
   PULSANTI
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #d4552a);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #ff8a50, var(--accent));
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-success {
  background: linear-gradient(135deg, var(--success), #388e3c);
  color: #fff;
}
.btn-success:hover { background: linear-gradient(135deg, #66bb6a, var(--success)); }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover { background: rgba(232,106,51,.1); }
.btn-block { width: 100%; }

/* =============================================
   MESSAGGI
   ============================================= */
.msg-box {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: none;
  animation: fadeSlide .3s ease;
}
.msg-box.show { display: block; }
.msg-box.info    { background: rgba(33,150,243,.12); border-left: 4px solid #2196f3; color: #90caf9; }
.msg-box.success { background: rgba(76,175,80,.12);  border-left: 4px solid var(--success); color: #a5d6a7; }
.msg-box.error   { background: rgba(239,83,80,.12);  border-left: 4px solid var(--danger);  color: #ef9a9a; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   PAGINE LOGIN / MY BRICK
   ============================================= */
.page-card {
  max-width: 500px;
  margin: 80px auto 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.page-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), #fca95c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-card p.desc {
  color: var(--text-dim);
  margin-bottom: 24px;
  font-size: .92rem;
}
.page-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .9rem;
}
.page-card input[type="text"],
.page-card input[type="password"],
.page-card input[type="url"],
.page-card input[type="file"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 20px;
  transition: border-color .2s;
  font-family: inherit;
}
.page-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.page-card .small-link {
  display: block;
  text-align: center;
  font-size: .82rem;
  color: var(--text-dim);
  margin-top: 16px;
}
.page-card .small-link a { color: var(--accent); }

/* Anteprima */
.brick-preview-box {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.brick-preview {
  width: 112px;
  height: 28px;
  border-radius: 3px;
  background: var(--brick-occupied);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.brick-preview img { width: 100%; height: 100%; object-fit: cover; }
.brick-preview-label { font-size: .82rem; color: var(--text-dim); }

/* =============================================
   BUY PAGE – Elementi aggiuntivi
   ============================================= */
.page-header {
  padding: 40px 0 32px;
  background: linear-gradient(180deg, #181210 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), #fca95c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.page-header .subtitle {
  color: var(--text-dim);
  font-size: .95rem;
}

.buy-page {
  padding-top: 32px;
  padding-bottom: 56px;
}

.step-badge {
  display: inline-block;
  background: rgba(232,106,51,.15);
  color: var(--accent);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.step-badge-ok {
  background: rgba(76,175,80,.15);
  color: var(--success);
}
.step-desc {
  color: var(--text-dim);
  font-size: .88rem;
  margin-bottom: 16px;
}

.wall-wrapper-buy {
  margin-bottom: 8px;
}

.success-box {
  text-align: center;
  padding: 12px 0;
}
.success-box .checkmark {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.dim {
  color: var(--text-dim);
  font-size: .85rem;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .82rem;
}
.site-footer a { color: var(--accent); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 860px) {
  .buy-layout {
    grid-template-columns: 1fr;
  }
  .steps-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .wall-hero { padding: 20px 12px 28px; }
  .wall-hero-header h1 { font-size: 1.6rem; }
  .buy-form-col { padding: 24px; margin: 0 0; }
  .wall-stats { gap: 16px; }
  .stat-item .stat-value { font-size: 1.2rem; }
  .wall-legend { flex-direction: column; align-items: center; gap: 8px; }
  .top-nav .nav-links { gap: 10px; font-size: .8rem; }
}

/* =============================================
   UTILITÀ
   ============================================= */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
