/* =====================================================
   Gainovo Acceso Directo
   Premium fintech dark UI
   Convivencia con notificaciones de compras
===================================================== */

[hidden] {
    display: none !important;
}

.gad-root {
    --gad-bg: var(--gds-bg-1, #0a1a3a);
    --gad-bg-2: var(--gds-bg-2, #0d1f42);
    --gad-card: var(--gds-gradient-card, linear-gradient(145deg, #0F2B5C, #0a1a3a));
    --gad-border: var(--gds-border, rgba(255, 255, 255, 0.08));
    --gad-border-hover: var(--gds-border-hover, rgba(255, 255, 255, 0.15));
    --gad-blue: var(--gds-accent, #167BFF);
    --gad-blue-dark: var(--gds-accent-dark, #0F52AA);
    --gad-blue-soft: var(--gds-accent-light, #7db6ff);
    --gad-green: var(--gds-success, #20c997);
    --gad-yellow: var(--gds-warning, #ffc107);
    --gad-whatsapp: #25D366;
    --gad-whatsapp-dark: #075E54;
    --gad-text: var(--gds-text-1, #ffffff);
    --gad-text-75: var(--gds-text-2, rgba(255, 255, 255, 0.75));
    --gad-text-60: var(--gds-text-3, rgba(255, 255, 255, 0.6));
    --gad-text-45: var(--gds-text-4, rgba(255, 255, 255, 0.45));
    --gad-radius: var(--gds-radius-md, 16px);
    --gad-radius-lg: var(--gds-radius-xl, 22px);
    --gad-shadow: var(--gds-shadow-lg, 0 20px 50px rgba(0, 0, 0, 0.4));
    --gad-font: var(--gds-font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    --gad-notif-offset: 96px;

    font-family: var(--gad-font);
    color: var(--gad-text);
}

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

.gad-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    line-height: 1;
}

/* =====================================================
   Floating trigger
===================================================== */

.gad-fab-wrap {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gad-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gad-blue-dark), var(--gad-blue));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(15, 82, 170, 0.35);
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.35s ease;
}

.gad-fab-wrap.visible .gad-fab {
    opacity: 1;
    transform: translateY(0);
}

.gad-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 82, 170, 0.45);
}

.gad-fab-icon {
    display: inline-flex;
}

.gad-fab-icon svg {
    width: 18px;
    height: 18px;
}

.gad-fab-label {
    white-space: nowrap;
}

.gad-fab-dismiss {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--gad-border-hover);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.25s ease;
}

.gad-fab-dismiss:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* =====================================================
   Overlay / modal
===================================================== */

.gad-overlay {
    position: fixed;
    inset: 0;
    z-index: 99997;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 12, 30, 0.72);
    backdrop-filter: blur(8px);
}

.gad-modal {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 30px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--gad-card);
    box-shadow: var(--gad-shadow);
    animation: gadFadeUp 0.3s ease;
}

.gad-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gad-border);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
}

.gad-close:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--gad-border-hover);
}

/* =====================================================
   Page mode
===================================================== */

.gad-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px;
}

.gad-page-card {
    padding: 34px;
    border-radius: 24px;
    border: 1px solid var(--gad-border);
    background: var(--gad-card);
    box-shadow: var(--gad-shadow);
    text-align: center;
}

.gad-page-header {
    margin-bottom: 24px;
}

.gad-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 20px;
    color: var(--gad-blue-soft);
    background: rgba(22, 123, 255, 0.12);
    border: 1px solid rgba(22, 123, 255, 0.22);
}

.gad-page-title {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
}

.gad-page-sub {
    margin: 0 auto;
    max-width: 52ch;
    color: var(--gad-text-75);
    font-size: 15px;
    line-height: 1.5;
}

/* =====================================================
   Views
===================================================== */

.gad-view {
    text-align: center;
}

.gad-title {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
}

.gad-sub {
    margin: 0 auto 18px;
    max-width: 52ch;
    color: var(--gad-text-75);
    font-size: 15px;
    line-height: 1.55;
}

.gad-device-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.gad-badge-android {
    color: var(--gad-green);
    background: rgba(32, 201, 151, 0.14);
    border: 1px solid rgba(32, 201, 151, 0.22);
}

.gad-badge-ios {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.22);
}

/* =====================================================
   Buttons
===================================================== */

.gad-btn-primary,
.gad-btn-ghost,
.gad-btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.gad-btn-primary:focus-visible,
.gad-btn-ghost:focus-visible,
.gad-btn-whatsapp:focus-visible,
.gad-close:focus-visible,
.gad-fab:focus-visible,
.gad-fab-dismiss:focus-visible {
    outline: 3px solid rgba(22, 123, 255, 0.35);
    outline-offset: 2px;
}

.gad-btn-primary {
    padding: 13px 22px;
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, var(--gad-blue-dark), var(--gad-blue));
    box-shadow: 0 8px 25px rgba(15, 82, 170, 0.28);
}

.gad-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 82, 170, 0.38);
}

.gad-btn-lg {
    width: 100%;
    max-width: 380px;
    padding: 16px 28px;
    font-size: 16px;
    border-radius: 14px;
}

.gad-btn-ghost {
    padding: 12px 18px;
    color: var(--gad-text-75);
    background: transparent;
    border: 1px solid var(--gad-border);
}

.gad-btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--gad-border-hover);
}

.gad-btn-whatsapp {
    padding: 13px 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--gad-whatsapp-dark), var(--gad-whatsapp));
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.22);
}

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

/* =====================================================
   QR / URL
===================================================== */

.gad-qr {
    width: 252px;
    height: 252px;
    margin: 18px auto;
    padding: 16px;
    border-radius: 22px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.gad-qr img,
.gad-qr canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.gad-qr-fallback {
    font-size: 13px;
    color: #0a1a3a;
    text-align: center;
    word-break: break-word;
}

.gad-url-row {
    display: flex;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto 16px;
}

.gad-url-row input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--gad-border);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
}

.gad-url-row input:focus {
    outline: none;
    border-color: rgba(22, 123, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(22, 123, 255, 0.12);
}

.gad-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* =====================================================
   Steps / cards
===================================================== */

.gad-info-card {
    margin: 0 auto;
    max-width: 480px;
    padding: 18px;
    text-align: left;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--gad-border);
}

.gad-warning {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.28);
}

.gad-steps {
    margin: 14px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
    color: var(--gad-text-75);
}

.gad-steps-ios {
    display: grid;
    gap: 12px;
    max-width: 420px;
    margin: 0 auto 18px;
    text-align: left;
}

.gad-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--gad-border);
}

.gad-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    color: var(--gad-blue-soft);
    background: rgba(22, 123, 255, 0.16);
    border: 1px solid rgba(22, 123, 255, 0.22);
}

.gad-step-icon svg {
    width: 20px;
    height: 20px;
}

.gad-ios-step strong {
    display: block;
    margin-bottom: 3px;
    color: #fff;
}

.gad-ios-step small {
    display: block;
    color: var(--gad-text-60);
    line-height: 1.4;
}

.gad-note {
    margin: 12px 0 0;
    color: var(--gad-text-45);
    font-size: 13px;
}

.gad-status {
    min-height: 20px;
    margin-top: 12px;
    color: var(--gad-blue-soft);
    font-size: 13px;
}

/* =====================================================
   Success
===================================================== */

.gad-success-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    border-radius: 50%;
    color: var(--gad-green);
    background: rgba(32, 201, 151, 0.16);
    border: 1px solid rgba(32, 201, 151, 0.35);
    animation: gadPop 0.45s ease;
}

/* =====================================================
   Animations
===================================================== */

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

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

@keyframes gadPop {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =====================================================
   Mobile premium bottom sheet
===================================================== */

@media (max-width: 640px) {
    .gad-fab-wrap {
        left: auto;
        right: 14px;
        width: auto;
        bottom: calc(18px + env(safe-area-inset-bottom));
        transition: bottom 0.35s ease;
    }

    .gad-fab {
        width: auto;
        min-width: 0;
        padding: 13px 20px;
        border-radius: 999px;
    }

    .gad-fab-dismiss {
        position: absolute;
        top: -8px;
        right: -8px;
    }

    /* Convivencia con notificación de compras */
    body.gnv-notif-visible .gad-fab-wrap {
        bottom: calc(var(--gad-notif-offset, 96px) + env(safe-area-inset-bottom));
    }

    .gad-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .gad-modal {
        width: 100%;
        max-height: 88vh;
        border-radius: 26px 26px 0 0;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        animation: gadSlideUp 0.3s ease;
    }

    .gad-page-card {
        padding: 24px 18px;
    }

    .gad-page-title {
        font-size: 24px;
    }

    .gad-title {
        font-size: 22px;
    }

    .gad-url-row {
        flex-direction: column;
    }

    .gad-actions {
        flex-direction: column;
    }

    .gad-actions a,
    .gad-actions button {
        width: 100%;
    }
}

/* =====================================================
   Convivencia con notificaciones de compras
===================================================== */

body.gad-modal-open .gainovo-investment-notification,
body.gad-install-page .gainovo-investment-notification {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(12px) !important;
}

/* =====================================================
   Accesibilidad
===================================================== */

@media (prefers-reduced-motion: reduce) {
    .gad-fab,
    .gad-fab-wrap,
    .gad-modal,
    .gad-success-check,
    .gad-btn-primary,
    .gad-btn-ghost,
    .gad-btn-whatsapp {
        transition: none;
        animation: none;
    }
}