/* ── Stripe Subscriptions Manager – Public Styles ── */

/* House style: flat corners everywhere on the public-facing pages (buttons
   already carry Bootstrap's rounded-0 class directly in markup — this covers
   everything else: cards, badges, tags, notices, inputs, tables — so the
   whole page stays square-cornered without hand-editing every element.
   wp-admin is untouched; this file never loads there. */
.ssm-pricing-table, .ssm-pricing-table *,
.ssm-dashboard, .ssm-dashboard *,
.ssm-checkout-result, .ssm-checkout-result *,
.ssm-payment-history, .ssm-payment-history *,
.ssm-products-coupon, .ssm-products-coupon * {
    border-radius: 0 !important;
}

/* Pricing Table */
.ssm-pricing-table {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    padding: 32px 0;
}

.ssm-plan {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px 28px;
    flex: 1 1 260px;
    max-width: 320px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.ssm-plan:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.ssm-plan--featured {
    border-color: #6366f1;
    box-shadow: 0 8px 30px rgba(99,102,241,0.15);
}

.ssm-plan__badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #6366f1;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.ssm-plan__name {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #111827;
}

.ssm-plan__desc {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0 0 20px;
}

.ssm-plan__price {
    margin-bottom: 16px;
}

.ssm-plan__currency {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    vertical-align: super;
}

.ssm-plan__amount {
    font-size: 2.8rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.ssm-plan__interval {
    display: block;
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 4px;
}

.ssm-plan__trial {
    background: #f0fdf4;
    color: #16a34a;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.ssm-plan__features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}

.ssm-plan__features li {
    padding: 6px 0;
    color: #374151;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ssm-plan__features li::before {
    content: '✓';
    color: #6366f1;
    font-weight: 700;
    flex-shrink: 0;
}

.ssm-plan__action {
    margin-top: auto;
}

/* Buttons */
.ssm-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    transition: all 0.2s;
    width: 100%;
}

.ssm-btn--subscribe {
    background: #6366f1;
    color: #fff !important;
    border-color: #6366f1;
}

.ssm-btn--subscribe:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

.ssm-btn--current {
    background: #f3f4f6;
    color: #9ca3af !important;
    cursor: default;
}

.ssm-btn--portal {
    background: #0f172a;
    color: #fff !important;
    border-color: #0f172a;
    width: auto;
    display: inline-block;
}

.ssm-btn--portal:hover {
    background: #1e293b;
}

.ssm-btn--reactivate {
    background: #16a34a;
    color: #fff !important;
    border-color: #16a34a;
    width: auto;
    display: inline-block;
}

.ssm-btn--reactivate:hover {
    background: #15803d;
    border-color: #15803d;
}

.ssm-btn--outline-primary {
    background: transparent;
    color: #6366f1 !important;
    border: 2px solid #6366f1;
    width: auto;
    display: inline-block;
}

.ssm-btn--outline-primary:hover {
    background: #6366f1;
    color: #fff !important;
}

.ssm-btn--danger {
    background: #ef4444;
    color: #fff !important;
    border-color: #ef4444;
    width: auto;
    display: inline-block;
    margin-left: 12px;
}

.ssm-btn--outline.ssm-btn--danger {
    background: transparent;
    color: #ef4444 !important;
}

.ssm-btn--outline.ssm-btn--danger:hover {
    background: #ef4444;
    color: #fff !important;
}

/* Status badges */
.ssm-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ssm-badge--lg {
    font-size: 0.9rem;
    padding: 5px 14px;
}

.ssm-badge--active   { background: #dcfce7; color: #16a34a; }
.ssm-badge--trialing { background: #e0f2fe; color: #0369a1; }
.ssm-badge--past_due { background: #fef3c7; color: #d97706; }
.ssm-badge--canceled { background: #fee2e2; color: #dc2626; }
.ssm-badge--incomplete { background: #f3f4f6; color: #6b7280; }
.ssm-badge--paused   { background: #f3f4f6; color: #6b7280; }
.ssm-badge--unpaid   { background: #fef3c7; color: #d97706; }

/* Notices */
.ssm-notice {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 0.9rem;
}

.ssm-notice--warning {
    background: #fef9c3;
    border-left: 4px solid #eab308;
    color: #854d0e;
}

.ssm-notice--error {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.ssm-notice--success {
    background: #dcfce7;
    border-left: 4px solid #22c55e;
    color: #14532d;
}

/* User Dashboard */
.ssm-dashboard {
    max-width: 720px;
    margin: 0 auto;
}

.ssm-purchases__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ssm-purchases__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.ssm-purchases__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ssm-purchases__name {
    font-weight: 600;
    color: #111827;
    font-size: 0.92rem;
}

.ssm-purchases__meta {
    color: #6b7280;
    font-size: 0.82rem;
}

.ssm-dashboard__empty {
    text-align: center;
    padding: 60px 20px;
}

.ssm-dashboard__icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.ssm-dashboard__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.ssm-dashboard__header h2 {
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.ssm-dashboard__amount {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    display: block;
}

.ssm-dashboard__interval {
    color: #9ca3af;
    font-size: 0.85rem;
}

.ssm-detail-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.ssm-detail-card h3 {
    margin: 0 0 16px;
    font-size: 1rem;
    color: #374151;
}

.ssm-detail-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.ssm-detail-item__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.ssm-detail-item__value {
    font-size: 0.95rem;
    color: #111827;
    font-weight: 500;
}

.ssm-mono {
    font-family: monospace;
    font-size: 0.82rem !important;
}

.ssm-dashboard__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.ssm-upgrade__hint {
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: #6b7280;
}

.ssm-upgrade__row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.ssm-select {
    flex: 1 1 240px;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #111827;
    background: #fff;
}

.ssm-input {
    flex: 1 1 180px;
    min-width: 160px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #111827;
    background: #fff;
}

.ssm-input:focus,
.ssm-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.ssm-btn--upgrade {
    width: auto;
    flex: 0 0 auto;
    padding: 10px 22px;
}

/* Checkout Result */
.ssm-checkout-result {
    text-align: center;
    padding: 60px 20px;
    max-width: 520px;
    margin: 0 auto;
}

.ssm-checkout-result__icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.ssm-checkout-result h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.ssm-success-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin: 24px 0;
    text-align: left;
}

.ssm-success-summary p {
    margin: 8px 0;
}

/* Payment History */
.ssm-payment-history {
    margin-top: 32px;
}

.ssm-payment-history h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: #111827;
}

.ssm-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ssm-history-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    border-bottom: 2px solid #e5e7eb;
}

.ssm-history-table td {
    padding: 12px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    color: #374151;
}

.ssm-history-row--failed td {
    background: #fff9f9;
}

.ssm-fail-reason {
    color: #dc2626;
    font-size: 0.78rem;
    display: block;
    margin-top: 2px;
}

.ssm-empty {
    color: #9ca3af;
    font-style: italic;
    padding: 20px 0;
}

/* Tags */
.ssm-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ssm-tag--renewal { background: #ede9fe; color: #7c3aed; }
.ssm-tag--new     { background: #e0f2fe; color: #0369a1; }

@media (max-width: 600px) {
    .ssm-history-table th:nth-child(6),
    .ssm-history-table td:nth-child(6) { display: none; }
}

.ssm-products-coupon {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ssm-products-coupon label {
    font-size: 0.85rem;
    color: #6b7280;
}

.ssm-products-coupon input {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 200px;
}
