/* ============================================================
   AlbumBuilder PRO — templates.css
   Pagina Template Designer
   ============================================================ */

/* ── HERO ─────────────────────────────────────────────────── */
.tpl-hero {
  padding: 100px 0 60px;
  position: relative;
  overflow: hidden;
}
.tpl-hero-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(174,135,68,0.12) 0%, transparent 65%);
  pointer-events: none;
}
.tpl-hero-content { text-align: center; position: relative; z-index: 1; }
.tpl-hero-content h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}
.tpl-hero-sub {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.75;
}
.tpl-hero-meta {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.tpl-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--color-text-dim);
}
.tpl-meta-item svg { color: var(--color-gold); }

/* ── GRID SECTION ─────────────────────────────────────────── */
.tpl-grid-section { padding: var(--section-py) 0; }
.tpl-section-head {
  text-align: center;
  margin-bottom: 60px;
}
.tpl-section-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 12px; }
.tpl-section-head p { font-size: 1rem; color: var(--color-text-muted); }
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ── CARD ─────────────────────────────────────────────────── */
.tpl-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-gold-dark);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  display: flex;
  flex-direction: column;
}
.tpl-card:hover {
  transform: translateY(-8px);
  border-color: rgba(174,135,68,0.4);
  border-top-color: var(--color-gold);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 40px rgba(174,135,68,0.1);
}
.tpl-card-free {
  border-top-color: var(--color-gold);
  background: linear-gradient(160deg, rgba(174,135,68,0.06) 0%, var(--color-bg-card) 40%);
}

/* Badge */
.tpl-card-badge {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 3;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 5px 10px;
  border-radius: 6px;
}
.tpl-badge-free {
  background: var(--gradient-gold-h);
  color: #000;
}
.tpl-badge-new {
  background: rgba(0,180,120,0.15);
  border: 1px solid rgba(0,180,120,0.4);
  color: #4ade80;
}

/* Image */
.tpl-card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #111;
}
.tpl-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.tpl-card:hover .tpl-card-img { transform: scale(1.03); }
.tpl-card-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all .3s ease;
}
.tpl-card:hover .tpl-card-overlay {
  background: rgba(0,0,0,0.35);
  opacity: 1;
}
.tpl-overlay-label {
  background: rgba(174,135,68,0.9);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 8px 18px;
  border-radius: 8px;
}

/* Body */
.tpl-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tpl-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.tpl-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 4px;
}
.tpl-tag-type {
  background: rgba(174,135,68,0.1);
  border: 1px solid rgba(174,135,68,0.25);
  color: var(--color-gold);
}
.tpl-tag-free {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--color-border);
  color: var(--color-text-dim);
}
.tpl-tag-new {
  background: rgba(0,180,120,0.1);
  border: 1px solid rgba(0,180,120,0.3);
  color: #4ade80;
}
.tpl-card-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.2;
}
.tpl-card-tagline {
  font-size: 0.78rem;
  color: var(--color-gold);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  opacity: 0.8;
}
.tpl-card-desc {
  font-size: 0.87rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
  flex: 1;
}

/* Varianti colore */
.tpl-card-variants {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
.tpl-variant {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform .2s;
}
.tpl-variant:hover { transform: scale(1.2); }

/* Footer card */
.tpl-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}
.tpl-card-price { display: flex; flex-direction: column; }
.tpl-price-free {
  font-size: 1rem;
  font-weight: 700;
  background: var(--gradient-gold-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tpl-price-amount {
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--gradient-gold-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.tpl-price-once {
  font-size: 0.72rem;
  color: var(--color-text-dim);
}
.tpl-btn { flex-shrink: 0; font-size: 0.85rem; padding: 10px 18px; }
.tpl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, rgba(138,106,48,0.2), rgba(174,135,68,0.1)) !important;
  box-shadow: none !important;
}

/* ── CUSTOM SECTION ───────────────────────────────────────── */
.tpl-custom { padding: var(--section-py) 0; background: linear-gradient(180deg, #000 0%, #040404 100%); }
.tpl-custom-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  background: linear-gradient(135deg, rgba(174,135,68,0.08), rgba(174,135,68,0.03));
  border: 1px solid rgba(174,135,68,0.2);
  border-left: 3px solid var(--color-gold);
  border-radius: 16px;
  padding: 44px 48px;
}
.tpl-custom-icon { color: var(--color-gold); flex-shrink: 0; }
.tpl-custom-text { flex: 1; }
.tpl-custom-text h2 { font-size: 1.5rem; margin-bottom: 10px; }
.tpl-custom-text p { font-size: 0.92rem; color: var(--color-text-muted); line-height: 1.75; }
.tpl-custom-text strong { color: var(--color-gold-light); }

/* ── CTA ──────────────────────────────────────────────────── */
.tpl-cta { padding: 60px 0 80px; }
.tpl-cta-inner { text-align: center; border-top: 1px solid var(--color-border); padding-top: 60px; }
.tpl-cta-inner .ornament { margin-bottom: 24px; }
.tpl-cta-inner h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 14px; }
.tpl-cta-inner p { font-size: 1rem; color: var(--color-text-muted); margin-bottom: 36px; }
.tpl-cta-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .tpl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl-custom-inner { flex-direction: column; text-align: center; padding: 32px 24px; }
}

/* ═══════════════════════════════════════════════════════════════════
   MODALE INSTALLAZIONE TEMPLATE — Luxury Dark Gold
   ═══════════════════════════════════════════════════════════════════ */

#tpl-install-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: auto;
}

.tpl-install-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: tpl-fade-in 0.22s ease;
}

@keyframes tpl-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.tpl-install-box {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: linear-gradient(160deg, #16161e 0%, #0e0e15 100%);
  border: 1px solid rgba(174, 135, 68, 0.28);
  border-top: 2px solid var(--color-gold, #ae8744);
  border-radius: 18px;
  padding: 44px 40px 36px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: tpl-slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

@keyframes tpl-slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Pulsante chiudi */
.tpl-install-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.tpl-install-close:hover {
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.07);
}

/* Icona grande */
.tpl-install-icon {
  font-size: 38px;
  margin-bottom: 16px;
  text-align: center;
  filter: drop-shadow(0 4px 12px rgba(174,135,68,0.4));
}

/* Titolo */
.tpl-install-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ede3cc;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.25;
}
.tpl-install-title em {
  font-style: normal;
  background: linear-gradient(135deg, #c9a45a, #f0d890);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sottotitolo */
.tpl-install-subtitle {
  font-size: 0.9rem;
  color: rgba(220, 210, 195, 0.55);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.55;
}
.tpl-install-subtitle strong { color: rgba(220, 210, 195, 0.85); }

/* Lista passi */
.tpl-install-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tpl-install-steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: rgba(230, 220, 205, 0.82);
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.tpl-install-steps li:hover {
  background: rgba(174, 135, 68, 0.06);
  border-color: rgba(174, 135, 68, 0.18);
}
.tpl-install-steps li strong { color: #e8dcc8; }

.tpl-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #c9a45a, #e8c878);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  color: #1a1508;
}

/* Nota informativa */
.tpl-install-note {
  background: rgba(174, 135, 68, 0.07);
  border: 1px solid rgba(174, 135, 68, 0.18);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: rgba(220, 210, 195, 0.65);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* CTA download software */
.tpl-install-cta {
  display: block;
  text-align: center;
  font-size: 0.85rem !important;
  padding: 11px 20px !important;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.tpl-install-cta:hover { opacity: 1; }

/* Pulsante Installa nelle card */
.tpl-install-btn {
  cursor: pointer;
}

/* -------------------------------------------------------------------
   BANNER GUIDA INSTALLAZIONE  visibile solo agli utenti loggati
   ------------------------------------------------------------------- */

#tpl-install-guide {
  margin: 0 0 28px;
}

.tpl-install-guide {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(174,135,68,0.08) 0%, rgba(174,135,68,0.03) 100%);
  border: 1px solid rgba(174,135,68,0.22);
  border-left: 3px solid var(--color-gold, #ae8744);
  border-radius: 12px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  animation: tpl-fade-in 0.35s ease;
}

.tpl-guide-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  filter: drop-shadow(0 2px 6px rgba(174,135,68,0.4));
}

.tpl-guide-text {
  font-size: 0.88rem;
  color: rgba(220, 210, 195, 0.75);
  line-height: 1.6;
}

.tpl-guide-text strong {
  color: #e8dcc8;
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.tpl-guide-text em {
  font-style: normal;
  color: var(--color-gold-light, #c9a84c);
  font-weight: 600;
}
