/*
 * Styles for the [iwai_stripe_account] shortcode + its in-page
 * Stripe Elements card-update widget.
 */

/* ----- Account shortcode (subscriptions + payment history + legacy) ----- */

.iwai-stripe-account {
	margin: 20px 0;
}

.iwai-stripe-subscriptions,
.iwai-stripe-invoices,
.iwai-stripe-one-time {
	margin-bottom: 40px;
}

.iwai-stripe-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
}

.iwai-stripe-table th,
.iwai-stripe-table td {
	padding: 10px;
	text-align: left;
	border-bottom: 1px solid #ddd;
}

.iwai-stripe-table th {
	background-color: #f5f5f5;
	font-weight: bold;
}

.iwai-stripe-table tr:hover {
	background-color: #f9f9f9;
}

.iwai-stripe-empty {
	color: #666;
	margin-top: 10px;
}

.iwai-stripe-invoice-link {
	color: #007cba;
	text-decoration: none;
}

.iwai-stripe-invoice-link:hover {
	text-decoration: underline;
}

/* ----- Status badges (used by both shortcodes) ----- */

.iwai-stripe-status-active,
.iwai-stripe-status-paid,
.iwai-stripe-status-succeeded {
	color: #28a745;
	font-weight: 500;
}

.iwai-stripe-status-canceling,
.iwai-stripe-status-uncollectible,
.iwai-stripe-status-void {
	color: #dc3545;
	font-weight: 500;
}

.iwai-stripe-status-open,
.iwai-stripe-status-requires_payment_method,
.iwai-stripe-status-requires_confirmation,
.iwai-stripe-status-processing {
	color: #ffc107;
}

.iwai-stripe-status-requires_action {
	color: #17a2b8;
}

.iwai-stripe-status-draft,
.iwai-stripe-status-canceled {
	color: #6c757d;
}

@media ( max-width: 768px ) {
	.iwai-stripe-table {
		font-size: 14px;
	}
	.iwai-stripe-table th,
	.iwai-stripe-table td {
		padding: 8px 5px;
	}
}

/* ----- In-plugin card update (Stripe Elements) ----- */
.iwai-stripe-card {
	margin: 0 0 16px 0;
	padding: 10px 12px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	font-size: 14px;
}
.iwai-stripe-card-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.iwai-stripe-card-display {
	color: #333;
}
.iwai-stripe-card-display-empty {
	color: #6b7280;
	font-style: italic;
}
.iwai-stripe-card-shared {
	display: block;
	color: #6b7280;
	font-size: 12px;
	margin-top: 4px;
}
.iwai-stripe-card-update-btn,
.iwai-stripe-card-submit,
.iwai-stripe-card-cancel {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 4px;
	border: 1px solid #2563eb;
	background: #2563eb;
	color: #fff;
	font-size: 13px;
	cursor: pointer;
	line-height: 1.2;
}
.iwai-stripe-card-cancel {
	background: #fff;
	color: #374151;
	border-color: #d1d5db;
	margin-left: 6px;
}
.iwai-stripe-card-form {
	margin-top: 10px;
}
.iwai-stripe-card-element {
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	margin-bottom: 8px;
}
.iwai-stripe-card-errors {
	color: #b91c1c;
	font-size: 13px;
	min-height: 1.2em;
	margin-bottom: 6px;
}

/* ----- Refunded payment row ----- */
.iwai-stripe-refunded-row {
	background: #fafafa;
}
.iwai-stripe-amount-strike {
	text-decoration: line-through;
	color: #6b7280;
}
.iwai-stripe-amount-net {
	color: #6b7280;
	font-size: 12px;
}
.iwai-stripe-status-refunded {
	color: #b45309;
	font-size: 12px;
	font-weight: 500;
}

/* ----- Per-program total row ----- */
.iwai-stripe-total-row td {
	border-top: 2px solid #d1d5db;
	padding-top: 10px;
	background: #f9fafb;
}
.iwai-stripe-total-note {
	color: #6b7280;
	font-size: 12px;
	font-weight: normal;
	margin-left: 6px;
}

/* ----- Per-program Account Status block ----- */
.iwai-stripe-account-status {
	margin: 8px 0 14px 0;
}

/* Loud past-due banner inside the Account Status block. Renders ONLY
 * when {slug}_payment_status meta = "overdue" (or, as a fallback, the
 * Stripe subscription itself is past_due / unpaid). Visual goal: read
 * as a real alert — left bar, warm red background, bold lead, on top
 * of (not in line with) the structured bullets. */
.iwai-stripe-past-due-banner {
	margin: 0 0 12px 0;
	padding: 12px 16px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-left: 4px solid #dc2626;
	border-radius: 4px;
	color: #7f1d1d;
	font-size: 15px;
	line-height: 1.5;
}
.iwai-stripe-past-due-banner strong {
	display: inline;
	margin-right: 6px;
	color: #991b1b;
}

/* Calm "your payment plan is paused" sabbatical banner. Same shape as
 * the past-due banner but neutral-blue palette so a paused account
 * doesn't read like a warning. */
.iwai-stripe-sabbatical-banner {
	margin: 0 0 12px 0;
	padding: 12px 16px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-left: 4px solid #2563eb;
	border-radius: 4px;
	color: #1e3a8a;
	font-size: 15px;
	line-height: 1.5;
}
.iwai-stripe-sabbatical-banner strong {
	display: inline;
	margin-right: 6px;
	color: #1e40af;
}
.iwai-stripe-status-paused {
	color: #1d4ed8;
	font-weight: 500;
}
.iwai-stripe-account-status h4 {
	margin: 0 0 6px 0;
	font-size: 15px;
}
.iwai-stripe-account-status ul {
	margin: 0 0 10px 22px;
	padding: 0;
	list-style: disc;
}
.iwai-stripe-account-status ul li {
	margin-bottom: 3px;
}
.iwai-stripe-lifetime-note {
	margin: 0;
	color: #4b5563;
	font-size: 13px;
}

/* ----- Payoff offer block ----- */
.iwai-stripe-payoff-offer {
	margin: 10px 0 16px 0;
	padding: 16px 18px;
	background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
	border: 1px solid #6ee7b7;
	border-radius: 6px;
}
.iwai-stripe-payoff-offer-header h4 {
	margin: 0 0 4px 0;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #047857;
}
.iwai-stripe-payoff-pitch {
	margin: 0 0 12px 0;
	font-size: 17px;
	font-weight: 600;
	color: #064e3b;
}
.iwai-stripe-payoff-breakdown {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 14px;
	margin: 0 0 14px 0;
	font-size: 14px;
}
.iwai-stripe-payoff-breakdown dt {
	color: #065f46;
	font-weight: 600;
}
.iwai-stripe-payoff-breakdown dd {
	margin: 0;
	color: #064e3b;
}
.iwai-stripe-payoff-savings strong {
	color: #047857;
	font-size: 15px;
}
.iwai-stripe-payoff-btn {
	display: inline-block;
	padding: 10px 18px;
	background: #047857;
	border: 1px solid #047857;
	color: #fff;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.iwai-stripe-payoff-btn:hover {
	background: #065f46;
}
.iwai-stripe-payoff-btn:disabled {
	background: #9ca3af;
	border-color: #9ca3af;
	cursor: wait;
}
.iwai-stripe-payoff-fineprint {
	margin: 10px 0 0 0;
	color: #4b5563;
	font-size: 12px;
}
.iwai-stripe-payoff-error {
	margin-top: 8px;
	padding: 6px 10px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 4px;
	color: #991b1b;
	font-size: 13px;
}
.iwai-stripe-payoff-success {
	margin: 0 0 16px 0;
	padding: 12px 16px;
	background: #ecfdf5;
	border-left: 4px solid #10b981;
	border-radius: 4px;
	color: #064e3b;
}

/* ----- Admin-only: user-edit / profile screen polish -----
 * The renderer is shared with the public shortcode, so it lays out fine
 * on the front-end. In wp-admin the same markup sits inside a
 * .form-table cell, which makes the program blocks blur together with
 * no visual separation. These rules apply only on the user-edit / your-
 * profile screens (body class is added by core) so they don't bleed
 * into the public account page. */
.user-edit-php .iwai-stripe-account,
.profile-php   .iwai-stripe-account {
	margin: 0;
}
.user-edit-php .iwai-stripe-program,
.profile-php   .iwai-stripe-program {
	padding: 14px 16px;
	margin: 0 0 16px 0;
	background: #fff;
	border: 1px solid #dcdcde;
	border-left: 4px solid #2271b1;
	border-radius: 4px;
}
.user-edit-php .iwai-stripe-program:last-child,
.profile-php   .iwai-stripe-program:last-child {
	margin-bottom: 0;
}
.user-edit-php .iwai-stripe-program > h3,
.profile-php   .iwai-stripe-program > h3 {
	margin: 0 0 8px 0;
	padding: 0;
	font-size: 15px;
	color: #1d2327;
}
.user-edit-php .iwai-stripe-program .iwai-stripe-table,
.profile-php   .iwai-stripe-program .iwai-stripe-table {
	margin-top: 10px;
	font-size: 13px;
}
.user-edit-php .iwai-stripe-program .iwai-stripe-table th,
.user-edit-php .iwai-stripe-program .iwai-stripe-table td,
.profile-php   .iwai-stripe-program .iwai-stripe-table th,
.profile-php   .iwai-stripe-program .iwai-stripe-table td {
	padding: 6px 8px;
}
/* Legacy transactions: tone down to match the other sections. */
.user-edit-php .iwai-stripe-account > .iwai-stripe-one-time,
.profile-php   .iwai-stripe-account > .iwai-stripe-one-time {
	margin-top: 4px;
	margin-bottom: 0;
	padding: 14px 16px;
	background: #fafafa;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}
.user-edit-php .iwai-stripe-account > .iwai-stripe-one-time h3,
.profile-php   .iwai-stripe-account > .iwai-stripe-one-time h3 {
	margin: 0 0 6px 0;
	font-size: 14px;
	color: #50575e;
}
