/**
 * Paywall UI Styles
 * Elegant and functional design for payment modal
 */

/* Paywall Modal Backdrop (used inside .paywall-modal) */
.paywall-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}
/* Paywall Modal Wrapper (full-screen centering container) */
.paywall-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

/* Paywall/Auth Modal Content (the white box) */
.paywall-content {
    position: relative;
    z-index: 1;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Paywall Header */
.paywall-header {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 1rem 1rem 0 0;
    text-align: center;
}

.paywall-header h2 {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.paywall-header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Paywall Body */
.paywall-body {
    padding: 2rem;
}

/* Paywall Footer */
.paywall-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

/* Unified Button Styles (used by auth modal + paywall) */
.paywall-button {
    appearance: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    width: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.paywall-button.primary {
    color: #fff;
    background: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%);
    box-shadow: 0 10px 15px -10px rgba(37, 99, 235, 0.6);
}

.paywall-button.primary:hover {
    filter: brightness(0.98);
    transform: translateY(-1px);
}

.paywall-button.primary:active {
    transform: translateY(0);
}

.paywall-button.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.paywall-button.secondary:hover {
    background: #eef2ff;
    border-color: rgba(79, 70, 229, 0.35);
}

/* Pricing Cards Container */
.pricing-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .pricing-cards {
        grid-template-columns: 1fr;
    }
}

/* Pricing Card */
.pricing-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: white;
}

.pricing-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.pricing-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pricing-card.popular {
    border-color: #10b981;
}

.pricing-card.popular::before {
    content: 'BEST VALUE';
    position: absolute;
    top: -12px;
    right: 1rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Pricing Card Content */
.pricing-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.pricing-price {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.pricing-price .currency {
    font-size: 1.25rem;
    vertical-align: super;
}

.pricing-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-features li {
    padding: 0.5rem 0;
    color: #4b5563;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.pricing-features li::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Payment Methods */
.payment-methods {
    text-align: center;
margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.payment-methods h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    text-align: center;
}

.payment-buttons {
display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
}


@media (max-width: 640px) {
    .payment-buttons {
grid-template-columns: 1fr;
    width: 100%;
}
}

/* Payment Button */
.payment-btn {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.payment-btn:hover {
    border-color: #667eea;
    background: #f9fafb;
    transform: translateY(-1px);
}

.payment-btn:active {
    transform: translateY(0);
}

.payment-btn.stripe {
    color: #635bff;
}

.payment-btn.paypal {
    color: #0070ba;
}

.payment-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.payment-btn:disabled:hover {
    border-color: #e5e7eb;
    background: white;
    transform: none;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Security Badge */
.security-badge {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.875rem;
}

.security-badge svg {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: 0.25rem;
    vertical-align: middle;
}

/* Close Button */
.paywall-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
    font-weight: 600;
    line-height: 0; /* prevent glyph baseline drift */
    padding: 0;

    transition: background 0.2s ease, transform 0.2s ease;
}

.paywall-close-icon {
    display: block;
    line-height: 1;
    transform: translateY(-1px); /* optical centering of the × glyph only */
}

.paywall-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.paywall-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Error Message */
.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Success Message */
.success-message {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* PayPal Container */
#paypal-button-container {
    margin-top: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .paywall-modal {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .paywall-header {
        padding: 1.5rem;
    }
    
    .paywall-header h2 {
        font-size: 1.5rem;
    }
    
    .paywall-body {
        padding: 1.5rem;
    }
    
    .pricing-card {
        padding: 1rem;
    }
    
    .pricing-price {
        font-size: 1.5rem;
    }
}


/* Auth modal additions */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    margin: 0 0 1.25rem 0;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem 0.9rem;
    border-radius: 0.6rem;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: #374151;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.auth-tab.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.14) 0%, rgba(79, 70, 229, 0.14) 100%);
    border-color: rgba(37, 99, 235, 0.35);
    color: #1f2937;
}

.auth-tab:hover {
    background: rgba(59, 130, 246, 0.08);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.auth-field label {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
}

.auth-field input {
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.12);
    outline: none;
}

.auth-field input:focus {
    border-color: rgba(59, 130, 246, 0.7);
}

.auth-error {
    display: none;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #991b1b;
    font-weight: 600;
    font-size: 0.92rem;
}

.hidden { display: none; }


/* Admin-only backup button (only injected for admin accounts) */
.admin-backup-button{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10050;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: white;
  color: #1f2937;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  text-decoration: none;
}
.admin-backup-button:hover{
  transform: translateY(-1px);
}


/* Wider modal layout for plan selection / payment method screens */
.paywall-content--wide {
    max-width: 920px;
}

/* Plan selection grid */
.paywall-plans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    padding: 1.75rem;
}

@media (max-width: 720px) {
    .paywall-content--wide { max-width: 640px; }
    .paywall-plans {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }
}

/* Plan card styling */
.plan-card {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem 1.25rem 1.1rem 1.25rem;
    background: #ffffff;
    box-shadow: 0 10px 15px -10px rgba(0,0,0,0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 25px -18px rgba(0,0,0,0.2);
    border-color: #c7d2fe;
}

.plan-card.featured {
    border-color: #93c5fd;
    background: #f8fbff;
}

.plan-badge {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.plan-badge.popular {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.plan-card h3 {
    margin: 0.25rem 0 0.75rem 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #111827;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.price-amount {
    font-size: 2.25rem;
    font-weight: 900;
    color: #1d4ed8;
    line-height: 1;
}

.plan-card.featured .price-amount {
    color: #1e40af;
}

.price-period {
    font-size: 0.95rem;
    color: #6b7280;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.1rem 0;
    display: grid;
    gap: 0.5rem;
    color: #374151;
    font-size: 0.97rem;
}

.plan-features li strong {
    color: #111827;
}

.plan-button {
    width: 100%;
    border: none;
    cursor: pointer;
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    font-weight: 800;
    font-size: 1rem;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 10px 18px -14px rgba(37,99,235,0.6);
    transition: transform 0.12s ease, filter 0.12s ease;
}

.plan-button:hover { transform: translateY(-1px); filter: brightness(1.03); }
.plan-button:active { transform: translateY(0px); }

.plan-button.featured {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

/* Payment method section */
.payment-methods {
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 1.75rem 1.75rem 1.75rem;
    text-align: center;
}

.payment-methods h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
}

.payment-buttons {
display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    max-width: 540px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 720px) {
    .payment-methods { padding: 1.25rem; }
    .payment-buttons {
grid-template-columns: 1fr;
    width: 100%;
}
}

.payment-method-btn {
    width: min(380px, 100%);
    border-radius: 0.9rem;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    padding: 0.9rem 1rem;
    cursor: pointer;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 10px 18px -18px rgba(0,0,0,0.25);
}

.payment-method-btn:hover {
    transform: translateY(-1px);
    border-color: #c7d2fe;
    box-shadow: 0 16px 24px -22px rgba(0,0,0,0.35);
}

.payment-method-btn:active { transform: translateY(0px); }

.stripe-btn {
    border-color: #c7d2fe;
}

.paypal-btn {
    border-color: #bfdbfe;
}

/* Back link inside paywall */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: #374151;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.back-link:hover { text-decoration: underline; }


.back-button {
    margin: 1rem auto 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: #374151;
    font-weight: 800;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
}
.back-button:hover {
    background: #f3f4f6;
}


/* Trust bar (Stripe-style) */
.trust-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin-top: 24px;
  padding: 16px 0 26px 0; /* extra bottom space */
  border-top: 1px solid #e5e7eb;

  font-size: 0.9rem;
  font-weight: 500;
  color: #4b5563;
  letter-spacing: 0.2px;
  flex-wrap: wrap;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}


.trust-icon {
  font-size: 1rem;
  opacity: 0.85;
}



/* Apple Pay + Klarna buttons (route to Stripe Checkout; enable these payment methods in Stripe Dashboard) */

.applepay-btn {
  background: #111827;
  color: #ffffff;
  border: 2px solid rgba(17, 24, 39, 0.25);
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
}

.applepay-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}



.klarna-btn {
  background: #ffffff;
  border: 2px solid rgba(99, 91, 255, 0.35);
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
}

.klarna-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.klarna-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #ffb3d9, #ff7ab6);
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
}


/* Fix Apple Pay to single line */
.applepay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  white-space: nowrap;
}

.applepay-btn svg {
  flex-shrink: 0;
}


/* === PAYMENT BUTTON GRID (2x2 uniform) === */
.payment-buttons {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.payment-method-btn {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  white-space: nowrap;
}

.payment-method-btn svg {
  flex-shrink: 0;
}

/* Force Apple Pay text to never wrap */
.applepay-btn {
  white-space: nowrap;
}

.applepay-btn span,
.applepay-btn div,
.applepay-btn p {
  white-space: nowrap;
}

.applepay-btn {
  font-size: 16px;
  font-weight: 800;
}

/* === CLOSE BUTTON CLICKABILITY FIX === */
.paywall-close {
  z-index: 50;
  pointer-events: auto;
}

/* === HEADER STACKING FIX === */
.paywall-header {
  position: relative;
  z-index: 0;
}

/* Plans header close button positioning */
.paywall-close--header {
  position: absolute;
  top: 16px;
  right: 16px;
}
