/**
 * FinPal CTA Button Component
 *
 * A premium purple gradient button with multiple layers of glow effects,
 * shimmer animation on hover, and disabled state support.
 *
 * Primary CTA Button Usage:
 * <button class="finpal-cta-btn">
 *     <span class="finpal-cta-text">Get Early Access Now</span>
 * </button>
 *
 * Secondary Button Usage:
 * <button class="finpal-cta-btn finpal-cta-secondary">
 *     <span class="finpal-cta-text">Read an Article</span>
 * </button>
 *
 * With emoji icon:
 * <button class="finpal-cta-btn">
 *     <span class="finpal-cta-icon">🚀</span>
 *     <span class="finpal-cta-text">Get Early Access Now</span>
 * </button>
 *
 * With loading state:
 * <button class="finpal-cta-btn">
 *     <span class="finpal-cta-text">Get Early Access Now</span>
 *     <span class="finpal-cta-loading" style="display: none;">Processing...</span>
 * </button>
 *
 * Features:
 * - Primary (solid gradient) and Secondary (outline) variants
 * - Purple gradient background with multiple shadow layers (primary)
 * - Glassmorphic outline with subtle background (secondary)
 * - Optional emoji icon (unaffected by shimmer overlay)
 * - Shimmer sweep animation on hover
 * - Lift effect with enhanced glow on hover
 * - Press-down effect on active
 * - Disabled state with reduced opacity
 * - Fully responsive and touch-optimized
 */

/* Main button */
.finpal-cta-btn {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 50%, #6b21a8 100%);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.2) inset,
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 8px 24px rgba(168, 85, 247, 0.4),
        0 16px 48px rgba(168, 85, 247, 0.2);
    min-height: 58px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

/* Shimmer sweep effect */
.finpal-cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.finpal-cta-btn:hover::before {
    left: 100%;
}

/* Hover state - lift and enhanced glow */
.finpal-cta-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.25) inset,
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 12px 32px rgba(168, 85, 247, 0.5),
        0 20px 60px rgba(168, 85, 247, 0.3),
        0 0 80px rgba(168, 85, 247, 0.2);
    background: linear-gradient(135deg, #b366ff 0%, #8b2dd1 50%, #7422b8 100%);
}

/* Active state - press down */
.finpal-cta-btn:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.2) inset,
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 6px 20px rgba(168, 85, 247, 0.4),
        0 12px 40px rgba(168, 85, 247, 0.2);
    transition: all 0.1s;
}

/* Disabled state */
.finpal-cta-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Optional emoji icon (not affected by shimmer) */
.finpal-cta-icon {
    position: relative;
    z-index: 2;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Button text */
.finpal-cta-text {
    position: relative;
    z-index: 1;
}

/* Loading text (hidden by default) */
.finpal-cta-loading {
    position: relative;
    z-index: 1;
    display: none;
}

/* ========================================
   SECONDARY BUTTON VARIANT
   ======================================== */

/* Secondary button - glassmorphic purple style */
.finpal-cta-btn.finpal-cta-secondary {
    background: rgba(168, 85, 247, 0.18);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #ffffff;
    font-weight: 600;
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.15) inset,
        0 2px 8px rgba(0, 0, 0, 0.25),
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 -1px 4px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    margin: 0 auto;
}

/* Secondary shimmer - subtle purple */
.finpal-cta-btn.finpal-cta-secondary::before {
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.12), transparent);
}

/* Secondary hover - enhanced glassmorphic glow */
.finpal-cta-btn.finpal-cta-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.12) inset,
        0 4px 16px rgba(168, 85, 247, 0.15),
        0 0 24px rgba(168, 85, 247, 0.1);
}

/* Secondary active - minimal press */
.finpal-cta-btn.finpal-cta-secondary:active:not(:disabled) {
    transform: translateY(0);
    background: rgba(168, 85, 247, 0.15);
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.1) inset,
        0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Secondary disabled */
.finpal-cta-btn.finpal-cta-secondary:disabled {
    opacity: 0.4;
    border-color: rgba(168, 85, 247, 0.15);
}

/* Responsive adjustments */
/* Tablets (641-768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .finpal-cta-btn {
        min-height: 54px;
        padding: 1.125rem 1.25rem;
        font-size: 1.0625rem;
    }

    .finpal-cta-icon {
        font-size: 1.125rem;
    }

    .finpal-cta-btn.finpal-cta-secondary {
        max-width: 350px;
    }
}

/* Large mobile (481-640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .finpal-cta-btn {
        min-height: 52px;
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }

    .finpal-cta-icon {
        font-size: 1.125rem;
    }

    .finpal-cta-btn.finpal-cta-secondary {
        max-width: 320px;
    }
}

/* Small mobile (≤480px) */
@media (max-width: 480px) {
    .finpal-cta-btn {
        min-height: 48px;
        padding: 0.875rem 1.125rem;
        font-size: 1rem;
    }

    .finpal-cta-icon {
        font-size: 1rem;
    }

    .finpal-cta-btn.finpal-cta-secondary {
        max-width: 280px;
    }
}
