/* ============================================================
   TARJETA DIGITAL — card.css
   Estilos del perfil público — 5 plantillas
   ============================================================ */

:root { --brand: #1D9E75; }

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

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       font-size: 15px; -webkit-font-smoothing: antialiased; }

/* ── CARD WRAP COMÚN ── */
.card-wrap { max-width: 480px; margin: 0 auto; padding-bottom: 60px; }

.card-powered { text-align: center; padding: 16px; font-size: 11px; color: #bbb; }
.dark-powered  { color: #444; }

/* ── LEAD FORM (común a todas las plantillas) ── */
.lead-form-wrap  { margin: 16px 16px 0; }
.lead-toggle-btn { width: 100%; padding: 13px; border: 2px solid var(--brand); border-radius: 12px;
                   background: transparent; color: var(--brand); font-size: 14px; font-weight: 500;
                   cursor: pointer; transition: all .2s; }
.lead-toggle-btn:hover,
.lead-toggle-btn.active { background: var(--brand); color: #fff; }
.lead-form-body  { padding: 16px; background: #f9f9f9; border-radius: 0 0 12px 12px;
                   border: 1px solid #eee; border-top: none; }
.tpl-dark .lead-form-body { background: #1a1a1a; border-color: #333; }

.lf-group  { margin-bottom: 10px; }
.lf-input  { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 10px;
             font-size: 14px; background: #fff; color: #111; }
.tpl-dark .lf-input { background: #111; border-color: #333; color: #eee; }
.lf-input:focus { outline: none; border-color: var(--brand); }
textarea.lf-input { resize: none; }
.lf-submit { width: 100%; padding: 12px; border-radius: 10px; background: var(--brand); color: #fff;
             border: none; font-size: 14px; font-weight: 500; cursor: pointer; transition: filter .2s; }
.lf-submit:disabled { opacity: .6; }
.lf-submit:hover:not(:disabled) { filter: brightness(.9); }

/* ── vCARD button (Classic, Minimal, Dark) ── */
.card-vcf-btn { display: flex; align-items: center; justify-content: center; gap: 10px;
                margin: 12px 16px 0; padding: 13px; border: 1.5px solid #e0e0e0;
                border-radius: 12px; background: #fff; font-size: 14px; font-weight: 500;
                color: #333; text-decoration: none; transition: all .2s; }
.card-vcf-btn:hover { border-color: var(--brand); color: var(--brand); }
.card-vcf-btn svg  { width: 18px; height: 18px; fill: currentColor; }
.tpl-dark .card-vcf-btn { background: #1a1a1a; border-color: #2a2a2a; color: #ccc; }


/* ══════════════════════════════════════
   PLANTILLA: CLASSIC
══════════════════════════════════════ */
.tpl-classic { background: #f5f5f5; min-height: 100vh; }

.c-cover { height: 110px; position: relative; }
.c-avatar-wrap { position: absolute; bottom: -40px; left: 50%; transform: translateX(-50%); }
.c-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
            border: 4px solid #fff; display: block; background: #eee; }
.c-avatar-init { display: flex; align-items: center; justify-content: center;
                 font-size: 28px; font-weight: 600; color: #fff; }

.c-info  { text-align: center; padding: 52px 24px 20px; background: #fff; }
.c-name  { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.c-title { font-size: 14px; color: #555; margin-bottom: 2px; }
.c-company { font-size: 13px; color: #888; }
.c-bio   { font-size: 13px; color: #666; margin-top: 10px; line-height: 1.5; }

.c-links { padding: 4px 16px 0; background: #fff; }
.c-link-btn { display: flex; align-items: center; gap: 14px; padding: 13px 16px;
              margin-bottom: 8px; background: #fafafa; border: 1px solid #eee;
              border-radius: 12px; text-decoration: none; color: #111; transition: all .2s; }
.c-link-btn:hover { border-color: var(--brand); background: #fff; transform: translateY(-1px); }
.c-link-icon  { width: 28px; height: 28px; flex-shrink: 0; }
.c-link-icon svg { width: 28px; height: 28px; }
.c-link-label { flex: 1; font-size: 14px; font-weight: 500; }
.c-link-arrow { width: 16px; height: 16px; opacity: .3; flex-shrink: 0; }


/* ══════════════════════════════════════
   PLANTILLA: DARK
══════════════════════════════════════ */
.tpl-dark { background: #0f0f0f; min-height: 100vh; color: #f0f0f0; }

.d-header  { background: #1a1a2e; position: relative; padding-top: 48px; text-align: center; }
.d-accent-line { height: 3px; width: 100%; }
.d-avatar-wrap { margin: 0 auto; width: fit-content; }
.d-avatar  { width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
             border: 2px solid; display: block; background: #2a2a3e; }
.d-avatar-init { display: flex; align-items: center; justify-content: center;
                 font-size: 28px; font-weight: 600; background: #2a2a3e; }

.d-info    { text-align: center; padding: 16px 24px 0; }
.d-name    { font-size: 22px; font-weight: 700; color: #f0f0f0; margin-bottom: 4px; }
.d-title   { font-size: 14px; color: #9a9aaa; margin-bottom: 2px; }
.d-company { font-size: 13px; color: #555; }
.d-divider { height: 2px; width: 40px; margin: 14px auto; border-radius: 2px; }
.d-bio     { font-size: 13px; color: #777; line-height: 1.5; }

.d-links   { padding: 4px 16px 0; }
.d-link-btn { display: flex; align-items: center; gap: 14px; padding: 13px 16px;
              margin-bottom: 8px; background: #1a1a1a; border: 1px solid #2a2a2a;
              border-radius: 12px; text-decoration: none; color: #ddd; transition: all .2s; }
.d-link-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.d-link-icon  { width: 28px; height: 28px; flex-shrink: 0; }
.d-link-icon svg { width: 28px; height: 28px; }
.d-link-label { flex: 1; font-size: 14px; font-weight: 500; }
.d-link-arrow { width: 16px; height: 16px; opacity: .2; flex-shrink: 0; }


/* ══════════════════════════════════════
   PLANTILLA: MINIMAL
══════════════════════════════════════ */
.tpl-minimal { background: #fafafa; min-height: 100vh; }

.m-top    { padding: 40px 24px 20px; }
.m-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
            display: block; margin-bottom: 14px; }
.m-avatar-init { display: flex; align-items: center; justify-content: center;
                 font-size: 20px; font-weight: 600; }
.m-name     { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.m-subtitle { font-size: 13px; color: #888; margin-bottom: 8px; }
.m-bio      { font-size: 13px; color: #666; line-height: 1.5; }

.m-links   { background: #fff; border-top: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb; }
.m-link-row { display: flex; align-items: center; gap: 14px; padding: 14px 24px;
              border-bottom: 1px solid #f0f0f0; text-decoration: none; color: #111; transition: background .15s; }
.m-link-row:last-child { border-bottom: none; }
.m-link-row:hover { background: #f5f5f5; }
.m-link-icon { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
               display: flex; align-items: center; justify-content: center; }
.m-link-icon svg { width: 20px; height: 20px; }
.m-link-label   { flex: 1; font-size: 14px; font-weight: 500; }
.m-link-chevron { width: 20px; height: 20px; color: #bbb; flex-shrink: 0; }

.tpl-minimal .lead-form-wrap  { margin: 16px 0 0; padding: 0 24px; }
.tpl-minimal .card-vcf-btn    { margin: 12px 24px 0; }


/* ══════════════════════════════════════
   PLANTILLA: BOLD
══════════════════════════════════════ */
.tpl-bold { background: #fff; min-height: 100vh; }

.b-cover  { min-height: 150px; padding: 28px 20px 20px; display: flex; align-items: flex-end; gap: 16px; }
.b-avatar { width: 64px; height: 64px; border-radius: 12px; object-fit: cover;
            border: 2px solid rgba(255,255,255,.4); flex-shrink: 0; }
.b-avatar-init { display: flex; align-items: center; justify-content: center;
                 font-size: 24px; font-weight: 700; background: rgba(255,255,255,.2); color: #fff; }
.b-cover-info { flex: 1; }
.b-name    { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.b-title   { font-size: 13px; color: rgba(255,255,255,.8); }
.b-company { font-size: 12px; color: rgba(255,255,255,.6); }

.b-bio-wrap { padding: 14px 16px 4px; }
.b-bio  { font-size: 13px; color: #666; line-height: 1.5; }

.b-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px 0; }
.b-link-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px;
               background: #f5f5f5; border-radius: 14px; text-decoration: none; color: #222; transition: all .2s; }
.b-link-cell:hover { background: #ebebeb; transform: translateY(-1px); }
.b-link-icon { width: 36px; height: 36px; }
.b-link-icon svg { width: 36px; height: 36px; }
.b-link-label { font-size: 12px; font-weight: 500; text-align: center; }

.tpl-bold .lead-form-wrap  { margin: 12px 16px 0; }
.tpl-bold .card-vcf-btn    { margin: 12px 16px 0; }


/* ══════════════════════════════════════
   PLANTILLA: ICONS
══════════════════════════════════════ */
.tpl-icons { background: #f2f2f7; min-height: 100vh; }

.i-header      { background: #fff; padding: 20px 16px; display: flex; align-items: center;
                 gap: 14px; border-bottom: 1px solid #ebebeb; }
.i-avatar      { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.i-avatar-init { display: flex; align-items: center; justify-content: center;
                 font-size: 22px; font-weight: 600; }
.i-header-info { flex: 1; }
.i-name     { font-size: 17px; font-weight: 600; margin-bottom: 2px; }
.i-subtitle { font-size: 12px; color: #888; }
.i-bio      { font-size: 13px; color: #666; padding: 10px 16px 4px; line-height: 1.4; background: #fff; }

.i-connect-btn { display: block; margin: 12px 16px 8px; padding: 12px; border: 2px solid;
                 border-radius: 12px; background: #fff; font-size: 14px; font-weight: 500;
                 cursor: pointer; text-align: center; width: calc(100% - 32px); transition: all .2s; }
.i-connect-btn:hover { opacity: .85; }

.i-grid  { display: grid; gap: 10px; padding: 10px 16px 0; }
.i-cell  { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 8px;
           background: #fff; border-radius: 16px; text-decoration: none; color: #222;
           transition: transform .2s, box-shadow .2s; }
.i-cell:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.i-icon-box { border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.i-icon-box svg { fill: currentColor; }
.i-label { font-weight: 500; text-align: center; color: #444; line-height: 1.2; }

/* Tamaño pequeño — 3 columnas compacto */
.i-grid-small { grid-template-columns: repeat(3, 1fr); }
.i-grid-small .i-icon-box { width: 52px; height: 52px; }
.i-grid-small .i-icon-box svg { width: 28px; height: 28px; }
.i-grid-small .i-label { font-size: 11px; }
.i-grid-small .i-cell  { padding: 14px 6px; border-radius: 14px; }

/* Tamaño grande — 3 columnas estilo iPhone/Tapni */
.i-grid-large { grid-template-columns: repeat(3, 1fr); }
.i-grid-large .i-icon-box { width: 72px; height: 72px; border-radius: 18px; }
.i-grid-large .i-icon-box svg { width: 38px; height: 38px; }
.i-grid-large .i-label { font-size: 12px; }
.i-grid-large .i-cell  { padding: 18px 6px; gap: 10px; border-radius: 18px; }

/* Tamaño iOS — pantalla de iPhone */
.tpl-icons.mode-ios { background: #e8e6e0; }

.i-grid-ios {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 8px 12px 0;
}
.i-grid-ios .i-cell {
    background: transparent;
    border-radius: 0;
    padding: 10px 4px 14px;
    gap: 5px;
    box-shadow: none;
    align-items: center;
}
.i-grid-ios .i-cell:hover { transform: scale(1.08); box-shadow: none; }

/* Contenedor del ícono iOS */
.i-grid-ios .i-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* fondo sólido del color de marca — Opción A */
    background-color: var(--icon-color, #555);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG en blanco sobre fondo sólido — Opción A */
.i-grid-ios .i-icon-box svg {
    width: 36px;
    height: 36px;
    fill: #fff;
    color: #fff;
    position: relative;
    z-index: 1;
}

/* PNG real si existe — Opción B: cubre todo el ícono */
.i-grid-ios .i-icon-box img.icon-png {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    z-index: 2;
}

.i-grid-ios .i-label {
    font-size: 10.5px;
    color: #111;
    font-weight: 400;
    letter-spacing: -.01em;
    text-align: center;
    line-height: 1.2;
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── RESPONSIVE CARDS ── */
@media (max-width: 480px) {
  .tpl-icons { background: #f2f2f7; }
  .card-wrap  { min-height: 100vh; }
  .i-icon-box { width: 46px; height: 46px; }
  .i-icon-box svg { width: 24px; height: 24px; }
}
