/**
 * Paywall — Frontend Styles
 *
 * All colours are driven by CSS custom properties
 * attached via wp_add_inline_style so the admin
 * colour scheme is respected on the frontend.
 *
 * @package Paywall
 * @since   1.0.0
 */

/* ----------------------------------------------------------------
   Layout
   ---------------------------------------------------------------- */

.pw-wrap {
    position: relative;
}

.pw-teaser {
    position: relative;
}

.pw-gated {
    position: relative;
    overflow: hidden;
    max-height: 360px;
}

/* ----------------------------------------------------------------
   Blur effect
   ---------------------------------------------------------------- */

.pw-blurred {
    filter: blur(var(--pw-blur, 8px));
    -webkit-filter: blur(var(--pw-blur, 8px));
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    line-height: 1.8;
    color: var(--pw-text, #1e293b);
}

/* ----------------------------------------------------------------
   Overlay
   ---------------------------------------------------------------- */

.pw-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
    z-index: 10;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, var(--pw-overlay-opacity, 0.85)) 15%,
        rgba(255, 255, 255, 1) 40%
    );
}

.pw-overlay-inner {
    max-width: 440px;
    width: 100%;
    text-align: center;
    padding: 32px 24px;
}

/* ----------------------------------------------------------------
   Icon
   ---------------------------------------------------------------- */

.pw-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--pw-icon-bg, rgba(37, 99, 235, 0.08));
    color: var(--pw-accent, #2563eb);
    margin-bottom: 20px;
}

.pw-icon svg {
    width: 28px;
    height: 28px;
}

/* ----------------------------------------------------------------
   Typography
   ---------------------------------------------------------------- */

.pw-heading {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--pw-heading, #0f172a);
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.pw-message {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--pw-muted, #64748b);
    margin: 0 0 20px;
}

.pw-price {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pw-text, #1e293b);
    margin: 0 0 20px;
    letter-spacing: 0.01em;
}

/* ----------------------------------------------------------------
   PayPal button container
   ---------------------------------------------------------------- */

.pw-paypal-container {
    max-width: 300px;
    margin: 0 auto 16px;
}

/* ----------------------------------------------------------------
   Status messages
   ---------------------------------------------------------------- */

.pw-status {
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 20px;
    margin-bottom: 12px;
}

.pw-status.is-error {
    color: #dc2626;
}

.pw-status.is-success {
    color: #16a34a;
}

.pw-status.is-loading {
    color: var(--pw-muted, #64748b);
}

/* ----------------------------------------------------------------
   Restore access
   ---------------------------------------------------------------- */

.pw-restore {
    margin-top: 8px;
}

.pw-restore-toggle {
    background: none;
    border: none;
    color: var(--pw-accent, #2563eb);
    font-size: 0.825rem;
    cursor: pointer;
    padding: 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.pw-restore-toggle:hover {
    border-bottom-color: var(--pw-accent-hover, #1d4ed8);
}

.pw-restore-form {
    margin-top: 14px;
}

.pw-restore-hint {
    font-size: 0.8rem;
    color: var(--pw-muted, #64748b);
    margin: 0 0 10px;
}

.pw-restore-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    max-width: 320px;
    margin: 0 auto;
}

.pw-restore-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
    border: 1px solid var(--pw-border, #e2e8f0);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pw-restore-input:focus {
    border-color: var(--pw-accent, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.pw-restore-button {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    background: var(--pw-accent, #2563eb);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.pw-restore-button:hover {
    background: var(--pw-accent-hover, #1d4ed8);
}

.pw-restore-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ----------------------------------------------------------------
   Remaining articles counter
   ---------------------------------------------------------------- */

.pw-counter {
    font-size: 0.85rem;
    color: var(--pw-muted, #64748b);
    text-align: center;
    padding: 16px 0 0;
    margin-top: 24px;
    border-top: 1px solid var(--pw-border, #e2e8f0);
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */

@media (max-width: 600px) {
    .pw-overlay-inner {
        padding: 24px 16px;
    }

    .pw-heading {
        font-size: 1.15rem;
    }
}
