/* Payment Modal - CSS Variables for Consistency */
:root {
    --modal-primary-green: #70866e;
    --modal-primary-gold: #f3ead0;
    --modal-secondary-gold: #c9b887;
    --modal-dark-text: #333333;
    --modal-light-gray: #888;
}

/* Payment Modal Overlay */
.payment-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(112, 134, 110, 0.75);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Content */
.payment-modal-content {
    background: #f3ead0;
    border-radius: 24px;
    border: 3px solid #70866e;
    box-shadow: 0 16px 48px rgba(112, 134, 110, 0.25), 0 2px 8px rgba(0,0,0,0.1);
    max-width: 420px;
    width: 95%;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    position: relative;
    text-align: center;
    animation: modalPop 0.35s;
}

@keyframes modalPop {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: none;
    border: none;
    font-size: 1.7rem;
    color: #888;
    cursor: pointer;
    transition: color 0.18s;
}
.close-modal:hover {
    color: #70866e;
}

.payment-modal-header {
    margin-bottom: 1rem;
}
.premium-crown {
    font-size: 1.8em;
    color: #c9b887;
    margin-bottom: 0.4rem;
}
.payment-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #70866e;
    margin-bottom: 0.3rem;
}
.payment-subtitle {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.payment-features ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.8rem 0;
}
.payment-features li {
    font-size: 0.95rem;
    color: #70866e;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.payment-features i {
    color: #c9b887;
    font-size: 1em;
}

.payment-plan {
    margin-bottom: 1rem;
}
.payment-plan-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.2rem;
}
.plan-card {
    background: linear-gradient(135deg, #f3ead0 0%, #c9b887 100%);
    border-radius: 12px;
    padding: 0.8rem 0.8rem;
    box-shadow: 0 2px 8px rgba(112, 134, 110, 0.15);
    color: #70866e;
    font-weight: 600;
    margin: 0 auto;
    max-width: 260px;
    border: 2px solid #c9b887;
    position: relative;
    flex: 1 1 0;
    cursor: pointer;
    transition: box-shadow 0.18s, border 0.18s, transform 0.18s;
}
.plan-card.selected {
    border: 3px solid #70866e;
    box-shadow: 0 4px 16px rgba(112, 134, 110, 0.25);
    transform: translateY(-2px);
}
.plan-check {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #70866e;
    opacity: 0;
    font-size: 1.2em;
    transition: opacity 0.18s;
}
.plan-card.selected .plan-check {
    opacity: 1;
}
.plan-label {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    display: block;
}
.plan-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #70866e;
    margin-bottom: 0.15rem;
    display: block;
}
.plan-desc {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.15rem;
    display: block;
}

.payment-action {
    margin-bottom: 0.8rem;
}
.btn-pay {
    background: #70866e;
    color: #f3ead0;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid #70866e;
    border-radius: 30px;
    padding: 0.7em 1.8em;
    box-shadow: 0 4px 12px rgba(112, 134, 110, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.7em;
    justify-content: center;
    width: 100%;
}
.btn-pay:hover {
    background: transparent;
    color: #70866e;
    box-shadow: 0 8px 20px rgba(112, 134, 110, 0.35);
    transform: translateY(-2px);
}

.payment-progress {
    margin: 0.8rem auto 0.5rem auto;
    width: 80%;
    text-align: left;
}
.progress-bar {
    background: #eee;
    border-radius: 8px;
    height: 6px;
    width: 100%;
    margin-bottom: 0.3rem;
    overflow: hidden;
}
.progress-fill {
    background: linear-gradient(90deg, #70866e 0%, #c9b887 100%);
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s;
}
.progress-label {
    font-size: 0.98rem;
    color: #70866e;
    display: flex;
    align-items: center;
    gap: 0.4em;
    font-weight: 500;
}

.payment-secure {
    color: #888;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 0.5em;
    justify-content: center;
}

.payment-footer {
    font-size: 0.92rem;
    color: #888;
    margin-top: 1.2rem;
}
.payment-footer a {
    color: #70866e;
    text-decoration: underline;
    font-weight: 500;
}
.payment-footer a:hover {
    color: #c9b887;
}

/* Card Form Styles */
.payment-form {
    margin-top: 0.8rem;
    text-align: left;
}
.form-group {
    margin-bottom: 0.7rem;
}
.form-group label {
    display: block;
    font-size: 1rem;
    color: #70866e;
    margin-bottom: 0.3rem;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 0.7em 1em;
    border-radius: 8px;
    border: 2px solid #c9b887;
    font-size: 1.08rem;
    background: #fff;
    color: #333;
    transition: border 0.3s, box-shadow 0.3s;
}
.form-control:focus {
    border-color: #70866e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(112, 134, 110, 0.1);
}
.form-row {
    display: flex;
    gap: 1rem;
}
.form-row .form-group {
    flex: 1;
}

/* Make modal wider for Canva-style */
.payment-modal-wide {
    max-width: 550px;
    min-width: 340px;
    padding: 1.8rem 2rem 1.5rem 2rem;
}

/* Processing Animation */
.processing-animation {
    margin-bottom: 1.2rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Plan Card Hover Enhancement */
.plan-card:hover {
    box-shadow: 0 6px 20px rgba(112, 134, 110, 0.2);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 600px) {
    .payment-modal-content {
        padding: 1.2rem 0.5rem;
        max-width: 98vw;
    }
    .plan-card {
        padding: 1rem 0.5rem;
    }
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
}
@media (max-width: 900px) {
    .payment-modal-wide {
        max-width: 98vw;
        padding: 1.2rem 0.5rem;
    }
    .payment-plan-options {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ============================================================
   Payment Method Tabs (Card / Google Pay / Apple Pay)
   ============================================================ */
.payment-method-tabs {
    display: flex;
    gap: 0.6rem;
    margin: 1.2rem 0 1rem;
    justify-content: center;
}

.pm-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1;
    padding: 0.65rem 0.5rem;
    border: 2px solid rgba(201, 184, 135, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #c9b887;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    min-width: 0;
}

.pm-tab i {
    font-size: 1.15rem;
}

.pm-tab small {
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(201, 184, 135, 0.65);
}

.pm-tab img {
    height: 22px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.75;
}

.pm-tab:hover {
    border-color: rgba(201, 184, 135, 0.65);
    background: rgba(201, 184, 135, 0.08);
    transform: translateY(-2px);
}

.pm-tab.active {
    border-color: #c9b887;
    background: rgba(201, 184, 135, 0.14);
    color: #70866e;
}

.pm-tab.active img {
    opacity: 1;
    filter: brightness(0) invert(1) sepia(1) saturate(2) hue-rotate(5deg);
}

/* Payment panels */
.pm-panel {
    animation: fadeInPanel 0.25s ease;
}

@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stripe Payment Request Button wrapper */
.stripe-pr-wrap {
    min-height: 52px;
    margin: 1.2rem 0 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wallet-loading {
    color: rgba(201, 184, 135, 0.7);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wallet-pay-info {
    text-align: center;
    margin-bottom: 0.5rem;
}

.wallet-pay-info p {
    color: rgba(201, 184, 135, 0.8);
    font-size: 0.9rem;
    margin: 0.2rem 0;
}

.wallet-amount {
    font-size: 1rem !important;
}

.wallet-amount strong {
    color: #70866e;
    font-size: 1.2rem;
}

.wallet-unavailable {
    text-align: center;
    padding: 1rem;
    color: rgba(201, 184, 135, 0.7);
    font-size: 0.9rem;
}

.wallet-unavailable i {
    font-size: 1.8rem;
    color: rgba(201, 184, 135, 0.5);
    display: block;
    margin-bottom: 0.5rem;
}

@media (max-width: 500px) {
    .payment-method-tabs {
        gap: 0.4rem;
    }
    .pm-tab {
        padding: 0.5rem 0.3rem;
        font-size: 0.72rem;
    }
    .pm-tab img {
        height: 18px;
    }
}