/* ═══════════════════════════════════════════════════════════
   Tarjeta Digital BNI San Isidro — app.css
   ═══════════════════════════════════════════════════════════ */

:root {
    --bni-rojo:    #C8102E;
    --bni-oscuro:  #8B0000;
    --color-marca: #C8102E;
    --radio:       14px;
    --sombra:      0 4px 24px rgba(0,0,0,.10);
    --font:        'Plus Jakarta Sans', sans-serif;
}

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

body {
    font-family: var(--font);
    color: #1a1a1a;
    background: #f5f5f7;
}

.body-tarjeta {
    background: linear-gradient(160deg, #f5f5f7 0%, #ebebed 100%);
    min-height: 100vh;
}

.fw-800 { font-weight: 800 !important; }
.fw-600 { font-weight: 600 !important; }

/* ── Header ──────────────────────────────────────────────── */
.app-header {
    background: linear-gradient(90deg, var(--bni-rojo), var(--bni-oscuro));
    padding: .5rem 0;
}

.bni-badge {
    width: 48px; height: 48px;
    background: white;
    color: var(--bni-rojo);
    font-weight: 800;
    font-size: .95rem;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: .5px;
    flex-shrink: 0;
}

/* ── Formulario ──────────────────────────────────────────── */
.card-form {
    border: none;
    border-radius: var(--radio);
}

.section-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--bni-rojo);
    margin-bottom: .75rem;
    margin-top: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: .4rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bni-rojo);
    box-shadow: 0 0 0 .2rem rgba(200, 16, 46, .2);
}

/* ── Foto upload ─────────────────────────────────────────── */
.foto-preview-wrapper {
    width: 100px; height: 100px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}

.foto-placeholder,
.foto-preview {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.foto-placeholder {
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    border: 2px dashed #ccc;
}

.foto-overlay {
    position: absolute;
    bottom: 4px; right: 4px;
    width: 28px; height: 28px;
    background: var(--bni-rojo);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
    cursor: pointer;
    border: 2px solid white;
}

/* ── Color picker ────────────────────────────────────────── */
.color-picker-group {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}

.color-swatch {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
    display: flex; align-items: center; justify-content: center;
}

.color-swatch:hover { transform: scale(1.15); }

.color-swatch.active {
    border-color: #333;
    transform: scale(1.1);
}

.color-custom {
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    color: white;
    font-size: .85rem;
}

/* ── Botón principal ─────────────────────────────────────── */
.btn-crear {
    background: linear-gradient(90deg, var(--bni-rojo), var(--bni-oscuro));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    transition: opacity .2s, transform .1s;
    padding: .75rem 1.5rem;
}

.btn-crear:hover { color: white; opacity: .9; }
.btn-crear:active { transform: scale(.98); }

/* ═══════════════════════════════════════════════════════════
   TARJETA PÚBLICA (ver.php)
   ═══════════════════════════════════════════════════════════ */

.tarjeta-wrapper {
    max-width: 460px;
    margin: 0 auto;
    min-height: 100vh;
    background: white;
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
}

/* Header de la tarjeta */
.tarjeta-header {
    padding: 2.5rem 2rem 4rem;
    position: relative;
    text-align: center;
}

.bni-badge-sm {
    display: inline-block;
    background: rgba(255,255,255,.25);
    color: white;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .25rem .75rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(4px);
}

.avatar-container {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
}

.avatar-img,
.avatar-iniciales {
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.avatar-iniciales {
    background: white;
    color: var(--color-marca);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    font-weight: 800;
}

/* Body tarjeta */
.tarjeta-body {
    padding: 4rem 2rem 2rem;
    flex: 1;
}

.tarjeta-nombre {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: .25rem;
    line-height: 1.2;
}

.tarjeta-profesion {
    text-align: center;
    color: var(--color-marca);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: .25rem;
}

.tarjeta-empresa {
    text-align: center;
    color: #666;
    font-size: .875rem;
    margin-bottom: .5rem;
}

.tarjeta-frase {
    text-align: center;
    font-style: italic;
    color: #555;
    font-size: .875rem;
    line-height: 1.5;
    background: #fafafa;
    border-left: 3px solid var(--color-marca);
    padding: .5rem .75rem;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

/* Botones de contacto */
.contacto-btns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: .75rem;
    margin: 1.5rem 0;
}

.btn-contacto {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    padding: .75rem .5rem;
    background: #f5f5f7;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-size: .75rem;
    font-weight: 600;
    transition: background .15s, transform .1s;
    border: 1px solid #ebebeb;
}

.btn-contacto i { font-size: 1.4rem; color: var(--c, var(--color-marca)); }
.btn-contacto:hover { background: #ebebeb; color: #111; transform: translateY(-2px); }
.btn-wa i { color: #25D366 !important; }

/* Redes sociales */
.redes-row {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: .5rem 0;
}

.red-social {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem 1rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .15s;
}

.red-social:hover { opacity: .85; }
.red-linkedin { background: #0A66C2; color: white; }
.red-instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

/* Guardar contacto */
.btn-guardar-contacto {
    background: var(--color-marca);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    padding: .8rem;
    transition: opacity .15s;
}
.btn-guardar-contacto:hover { opacity: .9; color: white; }

/* Compartir */
.compartir-section { }

.compartir-titulo {
    font-weight: 700;
    font-size: .9rem;
    color: #333;
    margin-bottom: 1rem;
}

.btn-wa-share {
    background: #25D366;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: .875rem;
    padding: .6rem .5rem;
}
.btn-wa-share:hover { background: #1ebc59; color: white; }

.btn-share-nativo {
    background: #333;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: .875rem;
    padding: .6rem .5rem;
}
.btn-share-nativo:hover { background: #111; color: white; }

/* QR */
.qr-section {
    background: #fafafa;
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #ebebeb;
}

.qr-titulo {
    font-weight: 700;
    font-size: .85rem;
    margin-bottom: 1rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.qr-container {
    display: inline-block;
    background: white;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
}

.btn-qr-download {
    background: transparent;
    border: 2px solid var(--color-marca);
    color: var(--color-marca);
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    padding: .4rem 1rem;
    transition: background .15s, color .15s;
}
.btn-qr-download:hover { background: var(--color-marca); color: white; }

/* Toast copiado */
.toast-copiado {
    background: #1a1a1a;
    color: white;
    font-size: .8rem;
    padding: .4rem .8rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: .5rem;
    animation: fadeIn .2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Footer tarjeta */
.tarjeta-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: .75rem;
    color: #aaa;
    border-top: 1px solid #f0f0f0;
}

.tarjeta-footer a { color: #888; text-decoration: none; font-weight: 600; }
.tarjeta-footer a:hover { color: var(--bni-rojo); }

/* ── Admin ───────────────────────────────────────────────── */
.avatar-mini {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

/* ── Página gracias ──────────────────────────────────────── */
.link-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    text-align: left;
}

.link-box-edit {
    background: #fffcf0;
    border-color: #ffc107;
}

.link-box-label {
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: .5rem;
    color: #555;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 576px) {
    .tarjeta-wrapper { max-width: 100%; box-shadow: none; }
    .tarjeta-body { padding: 3.5rem 1.25rem 1.5rem; }
    .tarjeta-header { padding: 2rem 1.25rem 3.5rem; }
}
