/* ============================================
   LinkPage — Public CSS
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.lp-public {
    min-height: 100vh;
    background: var(--lp-bg);
    font-family: var(--lp-font, 'Inter', sans-serif);
    color: var(--lp-text);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px 60px;
}

.lp-page { width: 100%; position: relative; z-index: 1; }

.lp-container {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: lp-fadein .5s ease;
}

@keyframes lp-fadein {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Avatar */
.lp-avatar-wrap {
    margin-bottom: 8px;
    position: relative;
}

.lp-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--lp-accent, #fff);
    box-shadow: var(--lp-shadow);
    display: block;
}

.lp-avatar-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--lp-card);
    border: 4px solid var(--lp-accent, rgba(255,255,255,0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--lp-text-muted);
}

/* Name & Bio */
.lp-name {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    color: var(--lp-text);
    line-height: 1.2;
}

.lp-bio {
    font-size: 0.95rem;
    text-align: center;
    color: var(--lp-text-muted);
    line-height: 1.6;
    max-width: 360px;
}

/* Links */
.lp-links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.lp-link-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--lp-card);
    border: 1px solid var(--lp-card-border);
    border-radius: var(--lp-radius);
    color: var(--lp-text);
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: background .2s, transform .15s, box-shadow .2s;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

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

.lp-link-btn:hover {
    background: var(--lp-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--lp-shadow);
}

.lp-link-btn:active {
    transform: translateY(0);
}

.lp-link-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--lp-accent);
    flex-shrink: 0;
}

.lp-link-label {
    flex: 1;
    text-align: center;
}

.lp-link-arrow {
    color: var(--lp-accent);
    opacity: 0.7;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Neon theme special */
.lp-theme-neon .lp-link-btn {
    box-shadow: 0 0 0 1px var(--lp-card-border), 0 0 8px rgba(0,255,200,0.1);
}
.lp-theme-neon .lp-link-btn:hover {
    box-shadow: 0 0 0 1px var(--lp-card-border), 0 0 20px rgba(0,255,200,0.3);
}
.lp-theme-neon .lp-name {
    text-shadow: 0 0 20px rgba(0,255,200,0.5);
}

/* Paper theme */
.lp-theme-paper .lp-link-btn {
    box-shadow: 2px 4px 8px rgba(61,43,31,0.1);
}
.lp-theme-paper .lp-link-btn:hover {
    box-shadow: 3px 6px 16px rgba(61,43,31,0.18);
}

/* Glass theme */
.lp-theme-glass .lp-link-btn {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Footer */
.lp-footer {
    margin-top: 24px;
    padding-top: 16px;
}

.lp-footer-brand {
    color: var(--lp-text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    opacity: 0.8;
    transition: opacity .2s;
}
.lp-footer-brand:hover { opacity: 1; }

/* ── Auth shortcode ── */
.lp-auth-wrap {
    max-width: 420px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.1);
    overflow: hidden;
}
.lp-auth-tabs {
    display: flex;
    background: #f5f5f5;
}
.lp-tab {
    flex: 1;
    padding: 14px;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    transition: background .2s, color .2s;
}
.lp-tab.active {
    background: #fff;
    color: #333;
    box-shadow: 0 2px 0 #667eea inset;
}
.lp-tab-content { display: none; padding: 28px; }
.lp-tab-content.active { display: block; }
.lp-tab-content h2 { margin-bottom: 20px; font-size: 1.3rem; color: #333; }
.lp-field { margin-bottom: 16px; }
.lp-field label { display: block; font-size: 0.85rem; font-weight: 600; color: #555; margin-bottom: 6px; }
.lp-field input { width: 100%; padding: 12px 14px; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 0.95rem; outline: none; transition: border-color .2s; }
.lp-field input:focus { border-color: #667eea; }
.lp-slug-wrap { display: flex; align-items: center; border: 1.5px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.lp-slug-prefix { padding: 12px; background: #f5f5f5; color: #888; font-size: 0.8rem; white-space: nowrap; border-right: 1px solid #e0e0e0; }
.lp-slug-wrap input { border: none; flex: 1; }
.lp-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; transition: opacity .2s, transform .15s; }
.lp-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.lp-error { color: #e53935; font-size: 0.85rem; margin-bottom: 10px; min-height: 20px; }
.lp-auth-logged { padding: 16px; background: #f0f0f0; border-radius: 8px; }

@media (max-width: 480px) {
    body.lp-public { padding: 24px 12px 40px; }
    .lp-name { font-size: 1.35rem; }
    .lp-link-btn { padding: 14px 16px; }
}

/* ── PIX ── */
.lp-pix-btn {
    cursor: pointer;
    position: relative;
}
.lp-pix-btn .lp-link-icon {
    color: #00b386;
}
.lp-pix-btn:hover {
    background: var(--lp-card-hover);
}
/* Shimmer verde ao clicar */
.lp-pix-btn.lp-pix-copied::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--lp-radius);
    background: rgba(0,179,134,0.18);
    animation: lp-pix-flash .5s ease forwards;
    pointer-events: none;
}
@keyframes lp-pix-flash {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* ── Toast PIX — invisível e fora do fluxo até ser ativado ── */
.lp-pix-toast {
    position: fixed !important;
    bottom: 28px !important;
    left: 50% !important;
    /* Escondido por padrão: fora da viewport e invisível */
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(40px) !important;
    transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s !important;
    /* Layout */
    display: flex !important;
    align-items: center;
    gap: 12px;
    background: #0d2b22;
    border: 1.5px solid #00b386;
    border-radius: 16px;
    padding: 14px 20px;
    box-shadow: 0 8px 32px rgba(0,179,134,0.3);
    z-index: 99999 !important;
    max-width: calc(100vw - 48px);
    width: 340px;
}
/* Ativado via JS: add class lp-pix-toast-show */
.lp-pix-toast.lp-pix-toast-show {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) !important;
    transition: opacity .28s ease, transform .28s ease, visibility 0s linear 0s !important;
}
.lp-pix-toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}
.lp-pix-toast-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.lp-pix-toast-body strong {
    color: #00e6aa;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}
#lp-pix-key-display {
    color: rgba(255,255,255,0.7);
    font-size: 0.76rem;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lp-pix-toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 4px;
    flex-shrink: 0;
    line-height: 1;
    transition: color .2s;
}
.lp-pix-toast-close:hover { color: #fff; }

/* ── PIX SVG icon ── */
.lp-pix-svg {
    display: block;
    flex-shrink: 0;
    fill: var(--lp-accent);
    color: var(--lp-accent);
}
.lp-pix-btn .lp-link-icon .lp-pix-svg {
    fill: var(--lp-accent);
}

/* ── Botão Salvar Contato ── */
.lp-save-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 20px;
    margin-top: 8px;
    background: transparent;
    border: 2px solid var(--lp-accent);
    border-radius: var(--lp-radius);
    color: var(--lp-accent);
    font-family: var(--lp-font, 'Inter', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s, transform .15s, box-shadow .2s;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.lp-save-contact-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--lp-accent);
    opacity: 0;
    transition: opacity .2s;
}

.lp-save-contact-btn:hover {
    color: var(--lp-bg, #fff);
    transform: translateY(-2px);
    box-shadow: var(--lp-shadow);
}

.lp-save-contact-btn:hover::before {
    opacity: 1;
}

.lp-save-contact-btn svg,
.lp-save-contact-btn span {
    position: relative;
    z-index: 1;
}

.lp-save-contact-btn:hover svg,
.lp-save-contact-btn:hover {
    position: relative;
    z-index: 1;
}

/* Garantir texto e ícone acima do ::before */
.lp-save-contact-btn > * {
    position: relative;
    z-index: 1;
}

.lp-save-contact-btn:active {
    transform: translateY(0);
}

/* Tema minimal — fundo claro, texto escuro */
.lp-theme-minimal .lp-save-contact-btn {
    border-color: var(--lp-text);
    color: var(--lp-text);
}
.lp-theme-minimal .lp-save-contact-btn:hover {
    background: var(--lp-text);
    color: #fff;
}

/* Tema paper — estilo manuscrito */
.lp-theme-paper .lp-save-contact-btn {
    border-style: dashed;
}

/* ══════════════════════════════════════
   SPLASH SCREEN
   ══════════════════════════════════════ */
#lp-splash {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    background: var(--lp-bg);
    opacity: 1;
    transition: opacity .5s ease;
}
#lp-splash.lp-splash-out {
    opacity: 0;
    pointer-events: none;
}
.lp-splash-text {
    font-family: var(--lp-font, 'Inter', sans-serif);
    font-size: clamp(1.6rem, 6vw, 2.8rem);
    font-weight: 800;
    color: var(--lp-text);
    letter-spacing: -.02em;
    text-align: center;
    padding: 0 24px;
}
.lp-splash-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(16px);
    animation: lp-char-in .4s forwards;
}
.lp-splash-bar {
    width: 120px;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}
.lp-splash-bar-fill {
    height: 100%;
    width: 0;
    background: var(--lp-accent);
    border-radius: 2px;
    animation: lp-bar-fill 1.2s ease forwards;
}
@keyframes lp-char-in {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes lp-bar-fill {
    to { width: 100%; }
}

/* ══════════════════════════════════════
   BACKGROUND IMAGE + OVERLAY
   ══════════════════════════════════════ */
body.lp-has-bg {
    background-size: cover !important;
    background-position: center center !important;
    background-attachment: fixed !important;
}
.lp-bg-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ══════════════════════════════════════
   ANIMAÇÕES DO AVATAR
   ══════════════════════════════════════ */

/* fade */
.lp-anim-avatar-fade .lp-avatar-wrap {
    opacity: 0;
    animation: lp-fade-in .7s ease .3s forwards;
}

/* fade-zoom */
.lp-anim-avatar-fade-zoom .lp-avatar-wrap {
    opacity: 0;
    transform: scale(.85);
    animation: lp-fade-zoom .6s ease .3s forwards;
}

/* bounce */
.lp-anim-avatar-bounce .lp-avatar-wrap {
    opacity: 0;
    transform: scale(.5);
    animation: lp-bounce .7s cubic-bezier(.34,1.56,.64,1) .3s forwards;
}

/* pulse contínuo */
.lp-anim-avatar-pulse .lp-avatar {
    animation: lp-pulse 2.4s ease-in-out .5s infinite;
}
.lp-anim-avatar-pulse .lp-avatar-placeholder {
    animation: lp-pulse 2.4s ease-in-out .5s infinite;
}

@keyframes lp-fade-in   { to { opacity:1; } }
@keyframes lp-fade-zoom { to { opacity:1; transform:scale(1); } }
@keyframes lp-bounce    { to { opacity:1; transform:scale(1); } }
@keyframes lp-pulse {
    0%,100% { transform: scale(1);    box-shadow: var(--lp-shadow); }
    50%      { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(255,255,255,0.12), var(--lp-shadow); }
}

/* Nome e bio surgem após avatar */
.lp-anim-avatar-fade .lp-name,
.lp-anim-avatar-fade .lp-bio,
.lp-anim-avatar-fade-zoom .lp-name,
.lp-anim-avatar-fade-zoom .lp-bio,
.lp-anim-avatar-bounce .lp-name,
.lp-anim-avatar-bounce .lp-bio {
    opacity: 0;
    animation: lp-fade-in .5s ease .8s forwards;
}

/* ══════════════════════════════════════
   ANIMAÇÕES DOS BOTÕES
   ══════════════════════════════════════ */

/* fade-seq: cada botão tem delay incremental (via JS) */
.lp-anim-btn-fade-seq .lp-link-btn {
    opacity: 0;
    animation: lp-fade-in .4s ease forwards;
}

/* slide-up */
.lp-anim-btn-slide-up .lp-link-btn {
    opacity: 0;
    transform: translateY(24px);
    animation: lp-slide-up .45s ease forwards;
}
@keyframes lp-slide-up { to { opacity:1; transform:translateY(0); } }

/* bounce */
.lp-anim-btn-bounce .lp-link-btn {
    opacity: 0;
    transform: scale(.85);
    animation: lp-btn-bounce .4s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes lp-btn-bounce { to { opacity:1; transform:scale(1); } }

/* ── Hover e ripple dos botões ── */
.lp-link-btn {
    transition: background .2s, transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s !important;
    overflow: hidden;
    position: relative;
}
.lp-link-btn:hover {
    transform: translateY(-3px) !important;
}
.lp-link-btn:active {
    transform: translateY(0) scale(.98) !important;
}
.lp-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transform: scale(0);
    animation: lp-ripple-anim .5s linear;
    pointer-events: none;
}
@keyframes lp-ripple-anim {
    to { transform: scale(4); opacity: 0; }
}
