/**
 * NexCard Pro - Card Public Stylesheet v3.0
 * Sin Tailwind. Optimizado Android + performance.
 * Las variables dinámicas (--main, --face-bg, etc.) se inyectan via PHP.
 */

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

/* ─── BASE ────────────────────────────────────────────── */
body {
    background: #05070a;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system,
                 BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow: auto;
    /* FIX Android: tap highlight eliminado globalmente */
    -webkit-tap-highlight-color: transparent;
}

* { -webkit-tap-highlight-color: transparent; }

/* ─── SCENE ───────────────────────────────────────────── */
.scene {
    width: 380px;
    height: 720px;
    perspective: 1200px;
}

@media (max-width: 420px) {
    .scene {
        width: 92vw;
        height: calc(92vw * 1.895);
    }
}

/* ─── CARD FLIP ───────────────────────────────────────── */
.card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    cursor: pointer;
    will-change: transform;
    touch-action: manipulation;
}

.card.is-flipped { transform: rotateY(180deg); }

/* ─── CARAS ───────────────────────────────────────────── */
.card__face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 1.8rem;
    padding: 2.5rem;
    box-shadow: 0 40px 80px -15px rgba(0,0,0,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    background-color: var(--face-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@supports not (backdrop-filter: blur(1px)) {
    .card__face { background-color: var(--face-bg-solid); }
}

.card__face--front {
    color: white;
    justify-content: flex-start;
    padding-top: 4rem;
    z-index: 1;
}

.card__face--back {
    transform: rotateY(180deg);
    justify-content: space-between;
    color: white;
    padding-bottom: 2.5rem;
    z-index: 1;
}

/* ─── FONDO INTERIOR ──────────────────────────────────── */
.face-image-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
    opacity: var(--bg-opacity, 0.55);
    pointer-events: none;
    will-change: opacity;
}

/* ─── AVATAR ──────────────────────────────────────────── */
.nc-avatar-ring {
    width: 192px;
    height: 192px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.6));
    margin-bottom: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.nc-avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #111827;
    display: block;
}

/* ─── TEXTO FRONTAL ───────────────────────────────────── */
.nc-front-text {
    text-align: center;
    width: 100%;
    padding: 0 8px;
    position: relative;
    z-index: 1;
}

.name-box {
    width: 100%;
    max-width: 310px;
    margin: 0.5rem auto 0.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.txt-name {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
    display: inline-block;
    font-size: 1.85rem;
    transition: font-size 0.1s;
    color: var(--text-primary, #ffffff);
    -webkit-text-stroke: var(--stroke-width, 0px) var(--stroke-color, #000);
}

.txt-job {
    font-size: 0.77rem;
    letter-spacing: 0.4em;
    margin-bottom: 4px;
    color: var(--text-secondary, rgba(255,255,255,0.9));
    -webkit-text-stroke: var(--stroke-width, 0px) var(--stroke-color, #000);
}

.txt-company {
    font-size: 0.77rem;
    letter-spacing: 0.2em;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary, rgba(255,255,255,0.7));
    -webkit-text-stroke: var(--stroke-width, 0px) var(--stroke-color, #000);
}

/* text-shadow para legibilidad, compatible con stroke */
.readable-txt {
    text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,1);
}

/* ─── GRID BOTONES FRONTALES ──────────────────────────── */
.nc-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 10px;
    width: 100%;
    padding: 0 8px;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

/* ─── BOTONES 3D ──────────────────────────────────────── */
.btn-3d-slim {
    height: 52px;
    width: 100%;
    border-radius: var(--radius-btn, 12px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.08s, box-shadow 0.08s;
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    font-family: inherit;
    background: none;
}

.btn-3d-slim:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 0 rgba(0,0,0,0.4) !important;
    opacity: 0.92;
}

.btn-white {
    background: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
    color: #111;
    box-shadow: 0 4px 0 0 #999;
}

.btn-whatsapp {
    background: linear-gradient(180deg, #2ae071 0%, #25D366 100%);
    color: white;
    box-shadow: 0 4px 0 0 #128C7E;
}

.btn-brand {
    background: linear-gradient(180deg, var(--main-light) 0%, var(--main) 100%);
    color: white;
    box-shadow: 0 4px 0 0 var(--main-dark);
}

/* ─── TAP INDICATOR ───────────────────────────────────── */
.tap-indicator {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    margin-top: 14px;
    animation: pulse 2s infinite;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.2; }
    50%       { opacity: 0.6; }
}

/* ─── LOGO PIE ────────────────────────────────────────── */
.nc-logo-foot {
    max-height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
    margin-top: 8px;
    position: relative;
    z-index: 1;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ─── CARA TRASERA ────────────────────────────────────── */
.nc-back-top {
    width: 100%;
    margin-top: 2.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.txt-qr {
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
    padding: 0 1.5rem;
    color: var(--text-secondary, #ffffff);
    -webkit-text-stroke: var(--stroke-width, 0px) var(--stroke-color, #000);
}

.qr-container {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 1.2rem;
    border-radius: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: inline-block;
}

.qr-container img {
    width: 256px;
    height: 256px;
    border-radius: 1rem;
    display: block;
}

/* ─── BOTTOM CARA TRASERA ─────────────────────────────── */
.nc-back-bottom {
    width: 100%;
    padding: 0 2rem 0;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.nc-back-extra-btn { width: 100%; margin-bottom: 1.5rem; }

.nc-back-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
}

.txt-footer {
    font-size: 0.77rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0;
    width: 100%;
    text-align: center;
    display: block;
    color: var(--text-primary, rgba(255,255,255,0.6));
    -webkit-text-stroke: var(--stroke-width, 0px) var(--stroke-color, #000);
}
