/* Self33 Checkout
 *
 * Purchase card design system.
 *   --s33-green:   conversion CTA (Pix-adjacent green, high contrast on white)
 *   --s33-ink:     primary text   --s33-muted: secondary text
 */

:root {
	--s33-green: #00a650;
	--s33-green-dark: #008f45;
	--s33-green-deep: #007a3b;
	--s33-ink: #0f172a;
	--s33-muted: #64748b;
}

.s33-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	text-align: left;
}

/* Inside the course sidebar: isolate the payment section with an
 * edge-to-edge seam matching the container's own 2px frame.
 * (.jws-courses-info has padding: 22px 28px.)
 *
 * The seam lives on LearnDash's status segment — the DIRECT child of the
 * padded container with auto width, so the negative margins genuinely
 * stretch it edge to edge. (.s33-card itself has width:100%, which only
 * shifts under negative margins instead of expanding.) */
.jws-courses-info > .ld-course-status-seg-action {
	margin: 4px -28px 26px;
	padding: 0 28px 24px;
	border-bottom: 2px solid var(--body3, #ebebeb);
}

/* Icons ------------------------------------------------------------------ */

.s33-i {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.s33-i-pix {
	color: #32bcad; /* Pix brand teal */
}

.s33-i-mp {
	width: 22px;
	height: 22px;
	color: #009ee3; /* Mercado Pago brand blue */
}

/* CTA button --------------------------------------------------------------- */

.s33-buy {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 17px 24px;
	border: 0;
	border-radius: 14px;
	/* A solid green base color always sits under the gradient: gradients
	 * can't transition, and swapping them via the `background` shorthand
	 * exposes a transparent background-color mid-transition (white blink). */
	background-color: var(--s33-green-dark);
	background-image: linear-gradient(180deg, var(--s33-green) 0%, var(--s33-green-dark) 100%);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.25) inset,
		0 8px 20px -6px rgba(0, 166, 80, 0.55);
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.2;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition:
		transform 0.15s ease,
		box-shadow 0.2s ease,
		background-color 0.2s ease;
}

.s33-buy:hover {
	background-image: linear-gradient(180deg, #00b558 0%, var(--s33-green-dark) 100%);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.25) inset,
		0 10px 24px -6px rgba(0, 166, 80, 0.65);
	transform: translateY(-1px);
	color: #fff;
}

.s33-buy:active {
	transform: translateY(0);
	background-color: var(--s33-green-deep);
	background-image: none;
}

.s33-buy:focus-visible {
	outline: 3px solid rgba(0, 166, 80, 0.4);
	outline-offset: 2px;
}

.s33-buy[disabled] {
	cursor: wait;
	background-color: var(--s33-green-dark);
	background-image: none;
	box-shadow: none;
	opacity: 0.9;
	transform: none;
}

.s33-buy-label,
.s33-buy-loading {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

/* Our display rules above would override the UA's [hidden] { display:none } —
 * restore it explicitly everywhere our components live. (.s33-card[hidden]
 * covers the auth forms themselves: login/forgot swap via [hidden].) */
.s33-card[hidden],
.s33-card [hidden],
.s33-modal [hidden] {
	display: none !important;
}

.s33-buy .s33-i-arrow {
	width: 20px;
	height: 20px;
	transition: transform 0.2s ease;
}

.s33-buy:hover .s33-i-arrow {
	transform: translateX(4px);
}

/* Loading spinner ----------------------------------------------------------- */

.s33-spin {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: s33-spin 0.8s linear infinite;
}

/* Trust list ---------------------------------------------------------------- */

.s33-trust {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.s33-trust li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: var(--s33-muted);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.45;
}

.s33-trust .s33-i {
	margin-top: 1px;
}

.s33-i-bolt {
	color: #f59e0b; /* amber bolt: "instant" */
}

.s33-trust strong {
	color: var(--s33-ink);
	font-weight: 600;
}

/* Secure seal ---------------------------------------------------------------- */

.s33-secure {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 12px;
	border-top: 1px solid #eef0f4;
	color: var(--s33-muted);
	font-size: 12px;
	line-height: 1;
}

.s33-secure > .s33-i {
	width: 13px;
	height: 13px;
}

.s33-secure strong {
	color: var(--s33-ink);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.01em;
}

/* Logo + wordmark never separate. */
.s33-mp-brand {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

/* Error / feedback ------------------------------------------------------------ */

.s33-buy-error {
	margin: 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fef2f2;
	color: #b91c1c;
	font-size: 13.5px;
	line-height: 1.4;
	text-align: center;
}

.s33-buy-feedback {
	margin: 0;
	color: var(--s33-green-deep);
	font-size: 13.5px;
	font-weight: 600;
	text-align: center;
}

.s33-buy-feedback:empty {
	display: none;
}

/* Free form / auth forms (login, forgot, reset, relink) ----------------------- */

.s33-checkout-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.s33-checkout-form input,
.s33-magic-form input[type='email'],
.s33-magic-form input[type='password'] {
	width: 100%;
	padding: 14px 16px;
	border: 1.5px solid #e2e8f0;
	border-radius: 12px;
	font-size: 15px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.s33-checkout-form input:focus,
.s33-magic-form input[type='email']:focus,
.s33-magic-form input[type='password']:focus {
	border-color: #00a650;
	box-shadow: 0 0 0 3px rgba(0, 166, 80, 0.15);
	outline: none;
}

.s33-magic-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 420px;
}

.s33-magic-hint {
	margin: 0;
	color: var(--s33-muted, #64748b);
	font-size: 14.5px;
	line-height: 1.5;
}

.s33-magic-hint strong {
	color: var(--s33-ink, #0f172a);
}

.s33-magic-feedback {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #007a3b;
	text-align: center;
}

.s33-magic-feedback.is-error {
	color: #b91c1c;
}

.s33-magic-feedback:empty {
	display: none;
}

/* Links under the login button (forgot password / back to login). */

.s33-login-links {
	margin: 2px 0 0;
	font-size: 14px;
	text-align: center;
}

.s33-login-links a,
.s33-linklike {
	padding: 0;
	border: 0;
	background: none;
	color: var(--s33-muted);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	transition: color 0.15s ease;
}

.s33-login-links a:hover,
.s33-linklike:hover {
	color: var(--s33-ink);
}

/* The theme's username/password popup is fully replaced by our modal —
 * make sure no stray code path can ever show it. */
.jws-form-login-popup {
	display: none !important;
}

/* WooCommerce is decommissioned: hide any leftover shop links the theme
 * renders (e.g. the offcanvas "Comprar" item). */
a[href$='/shop'],
a[href*='/shop/'],
a[href*='?add-to-cart='] {
	display: none !important;
}

/* Login modal ----------------------------------------------------------------- */

.s33-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.s33-modal[hidden] {
	display: none;
}

.s33-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.s33-modal-card {
	position: relative;
	width: 100%;
	max-width: 440px;
	padding: 36px 32px 32px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
	animation: s33-modal-in 0.22s ease;
}

.s33-modal-card .s33-magic-form {
	max-width: none;
}

.s33-modal-title {
	margin: 0 0 14px;
	font-size: 24px;
	font-weight: 700;
	color: #0f172a;
	text-align: center;
}

.s33-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #94a3b8;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.s33-modal-close:hover {
	background: #f1f5f9;
	color: #0f172a;
}

@keyframes s33-modal-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Checkout modal ----------------------------------------------------------------- */

.s33-checkout-modal .s33-modal-card {
	max-width: 480px;
	padding: 32px;
}

.s33-checkout-meta {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}

.s33-chip {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: #f0fdf4;
	color: #007a3b;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.s33-chip-free {
	background: #eff6ff;
	color: #1d4ed8;
}

.s33-checkout-title {
	margin: 0 0 8px;
	font-size: 22px;
	line-height: 1.25;
	text-align: left;
}

.s33-checkout-desc {
	margin: 0 0 18px;
	color: #64748b;
	font-size: 14.5px;
	line-height: 1.55;
}

.s33-checkout-note {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 5px;
	margin: 16px 0 0;
	padding-top: 14px;
	border-top: 1px solid #eef0f4;
	color: #64748b;
	font-size: 12.5px;
	line-height: 1.5;
	text-align: center;
}

.s33-checkout-note .s33-i {
	width: 13px;
	height: 13px;
}

.s33-checkout-note .s33-i-mp {
	width: 18px;
	height: 18px;
}

.s33-checkout-note strong {
	color: #0f172a;
}

.s33-checkout-success {
	padding: 8px 0;
	text-align: center;
}

.s33-checkout-success h4 {
	margin: 0 0 8px;
	font-size: 19px;
	color: #0f172a;
}

.s33-checkout-success p {
	margin: 0;
	color: #64748b;
	font-size: 14.5px;
	line-height: 1.55;
}

.s33-checkout-success strong {
	color: #007a3b;
	word-break: break-all;
}

.s33-field-error {
	display: block;
	margin: -4px 0 0;
	color: #b91c1c;
	font-size: 12.5px;
	line-height: 1.4;
}

.s33-checkout-form input.s33-input-invalid {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.s33-email-hint {
	margin: -2px 0 0;
	padding: 8px 12px;
	border-radius: 8px;
	background: #eff6ff;
	color: #1e40af;
	font-size: 13px;
	line-height: 1.5;
}

.s33-email-hint a {
	color: #1d4ed8;
	font-weight: 700;
	text-decoration: underline;
}

.s33-checkout-form input[readonly] {
	background: #f8fafc;
	color: #64748b;
	cursor: not-allowed;
}

/* Login page -------------------------------------------------------------------- */

.s33-login-page {
	max-width: 460px;
	margin: 40px auto 80px;
	padding: 0 20px;
}

/* Return page ------------------------------------------------------------------ */

.s33-return {
	max-width: 560px;
	margin: 0 auto;
	/* Generous top padding: the theme's header overlays page content. */
	padding: 110px 24px 100px;
	text-align: center;
}

.s33-return .s33-spinner {
	width: 44px;
	height: 44px;
	margin: 0 auto 20px;
	border: 4px solid rgba(0, 166, 80, 0.18);
	border-top-color: #00a650;
	border-radius: 50%;
	animation: s33-spin 0.9s linear infinite;
}

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