/**
 * FaucetPay Digital Goods — Frontend Styles
 *
 * FILE: /assets/css/frontend.css
 *
 * @package FaucetPayDigitalGoods
 */

/* -----------------------------------------------------------------------
   Reset / base
----------------------------------------------------------------------- */
.fpdg-product-card,
.fpdg-checkout-wrapper,
.fpdg-success-wrapper,
.fpdg-error-wrapper,
.fpdg-pending-wrapper {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a2e;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* -----------------------------------------------------------------------
   Product card (shortcode)
----------------------------------------------------------------------- */
.fpdg-product-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 28px;
    max-width: 500px;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    margin: 24px 0;
}

.fpdg-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.fpdg-product-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
}

.fpdg-product-price {
    background: #4f46e5;
    color: #fff;
    border-radius: 6px;
    padding: 4px 12px;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

.fpdg-product-description {
    margin-bottom: 20px;
    color: #444;
    font-size: 0.95rem;
}

/* -----------------------------------------------------------------------
   Form elements
----------------------------------------------------------------------- */
.fpdg-label {
    display: block;
    font-weight: 600;
    margin: 14px 0 6px;
    font-size: 0.9rem;
    color: #333;
}

.fpdg-select,
.fpdg-input,
.fpdg-currency-select,
.fpdg-email-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 7px;
    font-size: 0.95rem;
    background: #fafafa;
    transition: border-color .2s;
    color: #1a1a2e;
}

.fpdg-select:focus,
.fpdg-input:focus,
.fpdg-currency-select:focus,
.fpdg-email-input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #fff;
}

/* -----------------------------------------------------------------------
   Buttons
----------------------------------------------------------------------- */
.fpdg-buy-btn,
.fpdg-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .2s, opacity .2s, transform .1s;
    text-decoration: none;
}

.fpdg-buy-btn,
.fpdg-btn-primary {
    background: #4f46e5;
    color: #fff;
}

.fpdg-buy-btn:hover:not(:disabled),
.fpdg-btn-primary:hover {
    background: #4338ca;
}

.fpdg-buy-btn:active:not(:disabled),
.fpdg-btn-primary:active {
    transform: translateY(1px);
}

.fpdg-buy-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.fpdg-btn-download {
    background: #059669;
    color: #fff;
    font-size: 1.1rem;
    padding: 14px 32px;
}

.fpdg-btn-download:hover {
    background: #047857;
    color: #fff;
    text-decoration: none;
}

.fpdg-btn-secondary {
    background: #6b7280;
    color: #fff;
}

.fpdg-btn-secondary:hover {
    background: #4b5563;
    color: #fff;
    text-decoration: none;
}

/* -----------------------------------------------------------------------
   Price preview
----------------------------------------------------------------------- */
.fpdg-price-preview {
    margin: 10px 0;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    font-size: 0.95rem;
}

.fpdg-crypto-amount {
    font-weight: 700;
    color: #059669;
}

/* -----------------------------------------------------------------------
   Status / alerts
----------------------------------------------------------------------- */
.fpdg-status-msg {
    margin-top: 12px;
    font-size: 0.9rem;
}

.fpdg-alert {
    padding: 12px 16px;
    border-radius: 7px;
    margin: 14px 0;
    font-size: 0.9rem;
}

.fpdg-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.fpdg-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.fpdg-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #065f46;
}

.fpdg-error {
    color: #991b1b;
    font-style: italic;
}

/* -----------------------------------------------------------------------
   Checkout page
----------------------------------------------------------------------- */
.fpdg-checkout-wrapper {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 16px;
}

.fpdg-page-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: #1a1a2e;
}

.fpdg-checkout-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}

.fpdg-checkout-product-info {
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.fpdg-checkout-product-info h2 {
    margin: 0 0 8px;
    font-size: 1.3rem;
}

.fpdg-usd-price {
    color: #555;
    font-size: 1rem;
    margin: 0;
}

.fpdg-price-block {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    padding: 12px 16px;
    margin: 14px 0;
}

.fpdg-rate-note {
    display: block;
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 4px;
}

.fpdg-payment-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.fpdg-payment-summary p {
    margin: 4px 0;
}

.fpdg-qr-block {
    text-align: center;
    margin: 16px 0;
}

.fpdg-qr-block img {
    max-width: 180px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
}

/* -----------------------------------------------------------------------
   Spinner
----------------------------------------------------------------------- */
.fpdg-spinner-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.fpdg-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: fpdg-spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes fpdg-spin {
    to { transform: rotate(360deg); }
}

/* -----------------------------------------------------------------------
   Success page
----------------------------------------------------------------------- */
.fpdg-success-wrapper {
    max-width: 560px;
    margin: 60px auto;
    padding: 0 16px;
    text-align: center;
}

.fpdg-success-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.fpdg-success-icon {
    width: 64px;
    height: 64px;
    background: #059669;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
}

.fpdg-success-title {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #065f46;
}

.fpdg-success-subtitle {
    color: #555;
    margin-bottom: 28px;
}

.fpdg-download-section {
    margin: 24px 0;
}

.fpdg-download-meta {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
    text-align: left;
    font-size: 0.9rem;
}

.fpdg-download-meta p { margin: 4px 0; }

.fpdg-download-warning {
    font-size: 0.82rem;
    color: #b45309;
    margin-top: 12px;
}

.fpdg-order-ref {
    margin-top: 24px;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* -----------------------------------------------------------------------
   Error / pending pages
----------------------------------------------------------------------- */
.fpdg-error-wrapper,
.fpdg-pending-wrapper {
    max-width: 520px;
    margin: 60px auto;
    padding: 0 16px;
    text-align: center;
}

.fpdg-error-box,
.fpdg-pending-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.fpdg-error-icon {
    width: 64px;
    height: 64px;
    background: #dc2626;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
}

.fpdg-error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #991b1b;
    margin: 0 0 12px;
}

.fpdg-error-msg {
    color: #555;
    margin-bottom: 24px;
}

.fpdg-pending-box .fpdg-spinner {
    margin: 0 auto 20px;
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* -----------------------------------------------------------------------
   Pending page
----------------------------------------------------------------------- */
.fpdg-pending-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 20px;
    margin: 16px auto;
    text-align: left;
    max-width: 420px;
    font-size: 0.9rem;
}

.fpdg-pending-details p {
    margin: 4px 0;
}

.fpdg-polling-msg {
    color: #4f46e5;
    font-weight: 600;
    font-size: 0.95rem;
}

.fpdg-pending-note {
    font-size: 0.82rem;
    color: #9ca3af;
    margin-top: 16px;
}

/* -----------------------------------------------------------------------
   Checkout: security note + rate disclaimer
----------------------------------------------------------------------- */
.fpdg-secure-note {
    margin-top: 12px;
    font-size: 0.82rem;
    color: #6b7280;
    text-align: center;
}

.fpdg-rate-disclaimer {
    font-size: 0.8rem;
    color: #92400e;
    margin-top: 4px;
    font-style: italic;
}

/* -----------------------------------------------------------------------
   Product card: enforced currency display
----------------------------------------------------------------------- */
.fpdg-enforced-currency {
    font-size: 0.9rem;
    color: #374151;
    margin: 12px 0 8px;
}

/* -----------------------------------------------------------------------
   Responsive
----------------------------------------------------------------------- */
@media (max-width: 600px) {
    .fpdg-checkout-box,
    .fpdg-success-box,
    .fpdg-error-box,
    .fpdg-pending-box {
        padding: 24px 18px;
    }

    .fpdg-product-header {
        flex-direction: column;
    }

    .fpdg-btn-download {
        width: 100%;
        text-align: center;
    }
}
