/* ============================================
   ELISA VILLEGAS RABANAL — Tarjeta Virtual
   Diseño feminino, profesional, mobile-first
   ============================================ */

:root {
    --purple-deep: #4A1259;
    --purple-main: #7B2D8E;
    --purple-light: #B66BD0;
    --rose: #E8B4D4;
    --rose-light: #F8E1EE;
    --gold: #D4A574;
    --gold-light: #F4E4C9;
    --white: #FFFFFF;
    --cream: #FFF9F5;
    --text-dark: #2D1B36;
    --text-soft: #6B5874;
    --shadow-soft: 0 10px 40px rgba(123, 45, 142, 0.15);
    --shadow-medium: 0 20px 60px rgba(123, 45, 142, 0.25);
    --shadow-strong: 0 30px 80px rgba(74, 18, 89, 0.4);
    --gradient-bg: linear-gradient(135deg, #FCE4F0 0%, #F0D9E8 35%, #E6CCE0 100%);
    --gradient-card: linear-gradient(180deg, #FFFFFF 0%, #FFF9FC 100%);
    --gradient-primary: linear-gradient(135deg, #7B2D8E 0%, #B66BD0 100%);
    --gradient-whatsapp: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    --gradient-gold: linear-gradient(135deg, #D4A574 0%, #F4E4C9 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-dark);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* ============================================
   Fondo decorativo
   ============================================ */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.circle-1 {
    width: 320px;
    height: 320px;
    background: var(--purple-light);
    top: -100px;
    left: -100px;
}

.circle-2 {
    width: 280px;
    height: 280px;
    background: var(--rose);
    bottom: -80px;
    right: -80px;
    animation-delay: -7s;
}

.circle-3 {
    width: 220px;
    height: 220px;
    background: var(--gold);
    top: 40%;
    left: 60%;
    animation-delay: -14s;
    opacity: 0.3;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ============================================
   Tarjeta principal
   ============================================ */
.card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--gradient-card);
    border-radius: 32px;
    padding: 36px 28px 28px;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(20px);
    animation: cardEntrance 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   Header — Avatar y datos
   ============================================ */
.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.avatar-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: var(--gradient-primary);
    padding: 4px;
    animation: rotateRing 8s linear infinite;
}

.avatar-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--purple-main),
        var(--rose),
        var(--gold),
        var(--purple-light),
        var(--purple-main)
    );
}

@keyframes rotateRing {
    to { transform: rotate(360deg); }
}

.avatar {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--white);
    z-index: 1;
    box-shadow: 0 8px 24px rgba(123, 45, 142, 0.3);
}

.avatar-initials {
    font-family: 'Playfair Display', serif;
    font-size: 46px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
}

.avatar-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    background: var(--gradient-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--white);
    z-index: 2;
    color: var(--purple-deep);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.avatar-badge svg {
    width: 16px;
    height: 16px;
}

.name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(24px, 6vw, 28px);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

.title {
    font-size: 15px;
    font-weight: 500;
    color: var(--purple-main);
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

.title-prefix {
    display: inline-block;
    background: var(--gradient-primary);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 4px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

.bio {
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto 20px;
}

.bio strong {
    color: var(--purple-main);
    font-weight: 600;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--purple-main);
    background: var(--rose-light);
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    border: 1px solid rgba(123, 45, 142, 0.1);
}

/* ============================================
   Botones de acción
   ============================================ */
.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: 16px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-whatsapp {
    background: var(--gradient-whatsapp);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    pointer-events: none;
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.45);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.btn-secondary {
    background: var(--white);
    color: var(--purple-main);
    border: 1.5px solid rgba(123, 45, 142, 0.15);
    padding: 14px 12px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(123, 45, 142, 0.08);
}

.btn-secondary .btn-icon {
    width: 18px;
    height: 18px;
}

.btn-secondary:hover {
    background: var(--rose-light);
    border-color: var(--purple-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(123, 45, 142, 0.15);
}

/* ============================================
   Footer
   ============================================ */
.card-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px dashed rgba(123, 45, 142, 0.15);
}

.signature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.signature-line {
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
}

.signature-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--purple-main);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.domain {
    font-size: 11px;
    color: var(--text-soft);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 600;
}

/* ============================================
   Modal QR
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45, 27, 54, 0.7);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 28px;
    padding: 36px 28px 28px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-strong);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--rose-light);
    border: none;
    color: var(--purple-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--purple-main);
    color: var(--white);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 24px;
}

/* QR con marco decorativo */
.qr-frame {
    position: relative;
    display: inline-block;
    padding: 20px;
    background: var(--white);
    border-radius: 20px;
    margin-bottom: 16px;
}

.qr-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: var(--purple-main);
    border-style: solid;
    border-width: 0;
}

.qr-corner-tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 12px; }
.qr-corner-tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 12px; }
.qr-corner-bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 12px; }
.qr-corner-br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 12px; }

.qr-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-canvas img,
.qr-canvas canvas {
    display: block;
    border-radius: 8px;
}

.qr-hint {
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 20px;
    font-style: italic;
}

.btn-modal {
    width: 100%;
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 200;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 360px) {
    .card {
        padding: 28px 20px 22px;
        border-radius: 24px;
    }

    .avatar-container {
        width: 100px;
        height: 100px;
    }

    .avatar-initials {
        font-size: 38px;
    }

    .name {
        font-size: 22px;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .card {
        max-width: 460px;
        padding: 44px 36px 32px;
    }
}

/* Modo oscuro respetuoso */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2A1230 0%, #3D1947 50%, #1F0E26 100%);
    }
}

/* Animaciones reducidas */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
