/* ==========================================================================
   Lusofonia Protected Gallery — Frontend Styles
   v1.4.0 — com modal OTP premium, botões de download e sistema de apoio
   ========================================================================== */

/* ---------------------------------------------------------------
 * Galeria: grid de fotos
 * ------------------------------------------------------------- */

.lpg-gallery {
    display: grid;
    grid-template-columns: repeat(var(--lpg-columns, 3), 1fr);
    gap: 12px;
    margin: 16px 0;
}

.lpg-photo {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #eee;
}

.lpg-protected-img {
    display: block;
    width: 100%;
    height: auto;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.lpg-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    transition: background 0.2s ease;
}

.lpg-overlay span {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lpg-placeholder-blur {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 8px;
}

/* ---------------------------------------------------------------
 * Gate: formulário de email
 * ------------------------------------------------------------- */

.lpg-gate {
    max-width: 420px;
    margin: 16px auto;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.lpg-gate-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.lpg-email-input {
    flex: 1 1 220px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.lpg-submit-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #222;
    color: #fff;
    cursor: pointer;
}

.lpg-gate-message {
    width: 100%;
    margin: 6px 0 0;
    font-size: 13px;
    color: #555;
}

/* ---------------------------------------------------------------
 * Botão de download individual (floating sobre a foto)
 * ------------------------------------------------------------- */

.lpg-download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #1A1A2E;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.lpg-photo:hover .lpg-download-btn {
    opacity: 1;
    transform: translateY(0);
}

.lpg-download-btn:hover {
    background: #1A1A2E;
    color: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.lpg-download-btn:active {
    transform: scale(0.92);
}

/* ---------------------------------------------------------------
 * Botão "Baixar Todas as Fotos"
 * ------------------------------------------------------------- */

.lpg-download-all-wrap {
    text-align: center;
    margin: 24px 0;
}

.lpg-download-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1A1A2E 0%, #2D2D44 100%);
    color: #FAF8F5;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(26, 26, 46, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lpg-download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(26, 26, 46, 0.35);
}

.lpg-download-all-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ---------------------------------------------------------------
 * Modal OTP — Overlay
 * ------------------------------------------------------------- */

.lpg-otp-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 30, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: lpg-fadeIn 0.3s ease;
    padding: 20px;
}

/* ---------------------------------------------------------------
 * Modal OTP — Card (branco pérola, sombra flutuante)
 * ------------------------------------------------------------- */

.lpg-otp-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 40px 36px 36px;
    background: #FAF8F5;
    border-radius: 20px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.08);
    text-align: center;
    animation: lpg-slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Botão fechar */
.lpg-otp-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(26, 26, 46, 0.06);
    color: #666;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.lpg-otp-close:hover {
    background: rgba(26, 26, 46, 0.12);
    color: #1A1A2E;
    transform: rotate(90deg);
}

/* Ícone do cadeado */
.lpg-otp-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0ece6 0%, #e8e2da 100%);
    color: #1A1A2E;
}

/* Título */
.lpg-otp-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1A1A2E;
    letter-spacing: -0.3px;
}

/* Subtítulo */
.lpg-otp-subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    color: #6B6B80;
    line-height: 1.5;
}

/* ---------------------------------------------------------------
 * Modal OTP — Input
 * ------------------------------------------------------------- */

.lpg-otp-input-wrap {
    margin-bottom: 20px;
}

.lpg-otp-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #E0DDD8;
    border-radius: 14px;
    background: #FFFFFF;
    font-size: 18px;
    font-weight: 600;
    color: #1A1A2E;
    text-align: center;
    letter-spacing: 3px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.lpg-otp-input:focus {
    border-color: #1A1A2E;
    box-shadow: 0 0 0 4px rgba(26, 26, 46, 0.08);
}

.lpg-otp-input.lpg-otp-input-error {
    border-color: #E74C3C;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
    animation: lpg-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.lpg-otp-input.lpg-otp-input-success {
    border-color: #27AE60;
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

/* ---------------------------------------------------------------
 * Modal OTP — Botão de submissão
 * ------------------------------------------------------------- */

.lpg-otp-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #1A1A2E 0%, #2D2D44 100%);
    color: #FAF8F5;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lpg-otp-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(26, 26, 46, 0.3);
}

.lpg-otp-submit:active {
    transform: scale(0.97);
    animation: lpg-pulse 0.3s ease;
}

.lpg-otp-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ---------------------------------------------------------------
 * Modal OTP — Mensagem de erro / info
 * ------------------------------------------------------------- */

.lpg-otp-message {
    margin: 14px 0 0;
    font-size: 13px;
    min-height: 20px;
    color: #6B6B80;
    transition: color 0.3s;
}

.lpg-otp-message.lpg-otp-msg-error {
    color: #E74C3C;
    font-weight: 500;
}

/* ---------------------------------------------------------------
 * Modal OTP — Estado de sucesso (checkmark animado)
 * ------------------------------------------------------------- */

.lpg-otp-success {
    padding: 20px 0 0;
}

.lpg-otp-success-text {
    margin: 16px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: #27AE60;
}

/* Checkmark SVG animado */
.lpg-checkmark {
    display: block;
    margin: 0 auto;
}

.lpg-checkmark-circle {
    stroke: #27AE60;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: lpg-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.lpg-checkmark-check {
    stroke: #27AE60;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: lpg-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

/* ---------------------------------------------------------------
 * Spinner de loading
 * ------------------------------------------------------------- */

.lpg-spinner {
    animation: lpg-spin 0.8s linear infinite;
}

/* ---------------------------------------------------------------
 * Animações (keyframes)
 * ------------------------------------------------------------- */

@keyframes lpg-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lpg-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes lpg-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

@keyframes lpg-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes lpg-stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes lpg-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes lpg-fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ---------------------------------------------------------------
 * Responsividade
 * ------------------------------------------------------------- */

@media (max-width: 600px) {
    .lpg-otp-card {
        padding: 32px 24px 28px;
        border-radius: 16px;
    }

    .lpg-otp-input {
        font-size: 16px;
        padding: 14px 16px;
    }

    .lpg-otp-submit {
        font-size: 15px;
        padding: 14px 20px;
    }

    .lpg-download-all-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }

    .lpg-download-btn {
        opacity: 1;
        transform: translateY(0);
        width: 36px;
        height: 36px;
        bottom: 8px;
        right: 8px;
    }
}

/* ---------------------------------------------------------------
 * FAB — Botão flutuante "Apoiar & Desbloquear Downloads"
 * Visível quando o visitante confirmou o email mas ainda não comprou.
 * ------------------------------------------------------------- */

.lpg-support-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 24px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #0d0d1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow:
        0 8px 32px rgba(255, 165, 0, 0.40),
        0 2px 8px rgba(0, 0, 0, 0.20);
    animation: lpg-fab-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both,
               lpg-fab-pulse 3s ease-in-out 1.5s infinite;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.lpg-support-fab:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 14px 40px rgba(255, 165, 0, 0.55),
        0 4px 12px rgba(0, 0, 0, 0.25);
    animation-play-state: paused;
}

.lpg-support-fab:active {
    transform: scale(0.97);
}

.lpg-support-fab-icon {
    font-size: 18px;
    line-height: 1;
}

@keyframes lpg-fab-in {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lpg-fab-pulse {
    0%,  100% { box-shadow: 0 8px 32px rgba(255, 165, 0, 0.40), 0 2px 8px rgba(0,0,0,0.20); }
    50%        { box-shadow: 0 8px 48px rgba(255, 165, 0, 0.65), 0 2px 8px rgba(0,0,0,0.20); }
}

/* ---------------------------------------------------------------
 * Modal de apoio — Overlay
 * ------------------------------------------------------------- */

.lpg-support-overlay {
    position: fixed;
    inset: 0;
    z-index: 99997;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(10, 10, 18, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: lpg-fadeIn 0.3s ease;
    padding: 20px;
}

@media (min-width: 640px) {
    .lpg-support-overlay {
        align-items: center;
    }
}

/* ---------------------------------------------------------------
 * Modal de apoio — Card
 * ------------------------------------------------------------- */

.lpg-support-card {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: linear-gradient(145deg, #13132a, #1e1e3a);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 24px 24px 0 0;
    padding: 32px 28px 36px;
    box-shadow: 0 -8px 60px rgba(0, 0, 0, 0.50);
    animation: lpg-slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
    .lpg-support-card {
        border-radius: 24px;
        animation: lpg-slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

.lpg-support-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    font-size: 20px;
    line-height: 1;
}

.lpg-support-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: rotate(90deg);
}

.lpg-support-header {
    text-align: center;
    margin-bottom: 28px;
}

.lpg-support-header-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
    display: block;
}

.lpg-support-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lpg-support-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------------------------------------------------------------
 * Tier cards (3 em linha)
 * ------------------------------------------------------------- */

.lpg-tier-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 500px) {
    .lpg-tier-cards {
        grid-template-columns: 1fr;
    }
}

.lpg-tier-card {
    position: relative;
    border-radius: 16px;
    padding: 20px 16px 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    text-align: center;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.lpg-tier-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.22);
}

/* Card do meio em destaque */
.lpg-tier-card-featured {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.30);
    transform: scale(1.03);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.15);
}

.lpg-tier-card-featured:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: rgba(255, 215, 0, 0.50);
    box-shadow: 0 16px 48px rgba(255, 215, 0, 0.25);
}

.lpg-tier-card-featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #0d0d1a;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lpg-tier-card-emoji {
    font-size: 28px;
    line-height: 1;
}

.lpg-tier-card-label {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lpg-tier-card-price {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lpg-tier-card-price small {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
}

.lpg-tier-card-featured .lpg-tier-card-price { color: #FFD700; }

.lpg-tier-card-perk {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lpg-tier-card-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lpg-tier-card:hover .lpg-tier-card-btn {
    background: rgba(255, 255, 255, 0.18);
}

.lpg-tier-card-featured .lpg-tier-card-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #0d0d1a;
    border-color: transparent;
}

.lpg-support-note {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    margin: 0;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
