/* ============================================================
   VCard — Public Smart Card Page Styles
   Light theme matching vcard landing.css palette
   Mobile-first, phone-optimized
   ============================================================ */

@import url('../fonts/fonts.css?v=20261021a');

:root {
  --theme:      #06b6d4;    /* overridden by JS from user's card settings */
  --navy:       #0f1c36;
  --bg:         #f0f2f5;
  --bg-card:    #ffffff;
  --text:       #1e2638;
  --text-muted: #5a6a88;
  --border:     #d8dde8;
  --radius:     20px;
  --sh:         0 2px 14px rgba(15,28,54,.08);
  --sh-lg:      0 8px 40px rgba(15,28,54,.14);
}

*, *::before, *::after { box-sizing: border-box; margin:0; padding:0; }

html, body {
  min-height: 100%;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Loading ────────────────────────────────────────────── */
.loading-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 50;
}
.loading-spin {
  width: 40px; height: 40px;
  border: 3px solid rgba(15,28,54,0.1);
  border-top-color: var(--theme);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ──────────────────────────────────────────────── */
.error-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; text-align: center; padding: 32px;
  gap: 12px; color: var(--text);
}
.error-emoji { font-size: 3.5rem; }
.error-screen h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem; font-weight: 800; color: var(--navy);
}
.error-screen p { color: var(--text-muted); }

/* ── Root ───────────────────────────────────────────────── */
.card-root {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 0 0 48px;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity:0; transform: translateY(20px); } }

/* ── Background — subtle Hero gradient from landing ──────── */
.card-bg {
  position: fixed; inset: 0;
  z-index: 0;
  background: linear-gradient(160deg, #e8eef8 0%, #f0f2f5 55%, #e5f7fa 100%);
  transition: background 0.4s ease;
}
.card-bg::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 45% at 15% 60%, rgba(6,182,212,.08) 0%, transparent 65%),
    radial-gradient(ellipse 40% 35% at 90% 20%, rgba(15,28,54,.05) 0%, transparent 65%);
  pointer-events: none;
}

/* ── Inner card ─────────────────────────────────────────── */
.card-inner {
  position: relative; z-index: 1;
  width: calc(100% - 32px);
  max-width: 420px;
  margin: 20px auto 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--sh-lg);
  display: flex; flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* ── Header banner — uses theme color for top strip ─────── */
.card-header {
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 36px 24px 28px;
  text-align: center;
  gap: 6px;
  background: linear-gradient(160deg, var(--navy) 0%, color-mix(in srgb, var(--theme) 25%, var(--navy)) 100%);
  position: relative;
  overflow: hidden;
}
.card-header::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(255,255,255,.07) 0%, transparent 70%);
  pointer-events: none;
}

/* Avatar */
.card-avatar-wrap { position: relative; margin-bottom: 10px; z-index: 1; }
.card-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.avatar-initial {
  font-size: 2rem; font-weight: 800;
  color: rgba(255,255,255,0.9);
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; }

/* Logo */
.card-logo-wrap { margin-bottom: 8px; z-index: 1; }
.card-logo {
  height: 32px; max-width: 110px;
  object-fit: contain;
}

/* Text in header (white on dark) */
.card-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem; font-weight: 800; line-height: 1.1;
  color: #fff; z-index: 1;
}
.card-role  { font-size: 0.88rem; color: rgba(255,255,255,0.7); font-weight: 500; z-index: 1; }
.card-company { font-size: 0.8rem; color: rgba(255,255,255,0.5); z-index: 1; }
.card-bio {
  font-size: 0.85rem; color: rgba(255,255,255,0.65);
  line-height: 1.5; max-width: 300px; margin-top: 4px; z-index: 1;
}

/* ── Body section — light background ────────────────────── */
.card-body-section {
  width: 100%;
  padding: 20px 20px 0;
}

/* ── Action buttons ─────────────────────────────────────── */
.card-actions {
  display: flex; gap: 10px;
  width: 100%; padding: 20px 20px 0;
  justify-content: center; flex-wrap: wrap;
}
.card-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 20px;
  border-radius: 50px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600; font-size: 0.875rem;
  border: none; cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.card-btn--theme {
  background: var(--theme);
  color: #fff;
  box-shadow: 0 4px 16px rgba(6,182,212,.3);
}
.card-btn--theme:hover { filter: brightness(1.08); transform: translateY(-1px); }
.card-btn--outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.card-btn--outline:hover { border-color: var(--theme); color: var(--theme); }

/* ── Social links ───────────────────────────────────────── */
.card-social {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center;
  padding: 16px 20px 22px;
  width: 100%;
}
.social-link {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  font-size: 0.65rem; font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s ease;
  flex-direction: column; gap: 2px;
}
.social-link:hover {
  background: var(--brand, var(--theme));
  border-color: var(--brand, var(--theme));
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.22);
}
.social-link svg { width: 20px; height: 20px; }
.social-link span { font-size: 0.55rem; }

/* ── Custom links ───────────────────────────────────────── */
.card-custom-links {
  width: 100%; padding: 16px 20px 0;
  display: flex; flex-direction: column; gap: 10px;
}
.custom-link-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem; font-weight: 500;
  transition: all 0.2s ease;
}
.custom-link-btn:hover {
  border-color: var(--theme);
  background: rgba(6,182,212,.04);
  transform: translateX(3px);
}
.custom-link-btn::after { content: '→'; margin-left: auto; color: var(--text-muted); }

/* ── Save contact ───────────────────────────────────────── */
.card-save {
  width: calc(100% - 40px);
  margin: 20px 20px 0;
  padding: 15px;
  background: linear-gradient(135deg, var(--navy) 0%, color-mix(in srgb, var(--theme) 30%, var(--navy)) 100%);
  color: #fff;
  border: none; border-radius: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15,28,54,.2);
  transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.card-save:hover { filter: brightness(1.08); transform: translateY(-2px); }

/* ── Footer ─────────────────────────────────────────────── */
.card-footer { margin: 24px 0 0; text-align: center; padding: 4px 20px 16px; }
.card-footer__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: 50px;
  background: var(--theme);
  border: 1.5px solid var(--border);
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(6,182,212,.15);
  transition: all 0.2s ease;
}
.card-footer__brand:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ── Card style variants ─────────────────────────────────── */

/* MODERN (default) — already set as base, just keep defaults */
.card-inner.style-modern .card-name   { font-size: 1.5rem; font-weight: 700; }

/* MINIMAL — flat, no decoration, clean */
.card-inner.style-minimal             { border-radius: 0 !important; }
.card-inner.style-minimal .card-avatar { border: none; box-shadow: none; }
.card-inner.style-minimal .card-name  { font-weight: 400; letter-spacing: .04em; font-size: 1.25rem; }
.card-inner.style-minimal .card-btn   { border-radius: 4px; }
.card-inner.style-minimal .card-actions { gap: 6px; }

/* BOLD — strong, impactful */
.card-inner.style-bold .card-name     { font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; }
.card-inner.style-bold .card-role     { font-size: 1rem; font-weight: 700; opacity: .85; }
.card-inner.style-bold .card-avatar   { border: 4px solid var(--theme); box-shadow: 0 0 0 2px rgba(255,255,255,.15); border-radius: 12px; }
.card-inner.style-bold .card-btn      { font-weight: 800; border-radius: 6px; letter-spacing: .02em; }
.card-inner.style-bold                { border-radius: 8px !important; }

/* GLASS — frosted glass effect */
.card-inner.style-glass               { background: rgba(255,255,255,.05) !important; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.18) !important; }
.card-inner.style-glass .card-btn--theme  { background: rgba(255,255,255,.2) !important; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.card-inner.style-glass .card-btn--outline { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); }
.card-inner.style-glass .card-avatar  { border: 2px solid rgba(255,255,255,.4); }

/* ── Logo smart sizing ──────────────────────────────────── */
/* Quadrato: dimensione contenuta, aspect-ratio bilanciato */
.card-logo.logo-square {
  height: 38px;
  max-width: 60px;
  object-fit: contain;
}
/* Rettangolare (wide): larghezza ampliata per loghi orizzontali */
.card-logo.logo-wide {
  height: 28px;
  max-width: 160px;
  object-fit: contain;
}

/* ── Azienda: logo come immagine principale (hero) ──────── */
.card-logo-wrap.logo-hero-wrap { margin-bottom: 14px; }
.card-logo.logo-hero {
  height: auto;
  width: auto;
  max-height: 110px;
  max-width: 250px;
  object-fit: contain;
  background: rgba(255,255,255,0.95);
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ── Secondo ruolo ──────────────────────────────────────── */
.card-role2 {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  z-index: 1;
  margin-top: -2px;
}

