/**
 * MCOD Recurring Mercado Pago COL — Checkout Styles.
 *
 * Modern minimalist design with animated card preview.
 * Colors are driven by --mcodpr-color CSS custom property set via wp_add_inline_style().
 *
 * @package MCODPR
 * @since   1.0.0
 */

/* =========================================
   CSS Custom Properties (overrideable)
   ========================================= */
:root {
	--mcodpr-color: #009ee3;
	/* Base accent — overridden via PHP inline style */
	--mcodpr-color-dark: #007ab5;
	--mcodpr-color-light: #e8f6fd;
	--mcodpr-radius: 12px;
	--mcodpr-radius-sm: 6px;
	--mcodpr-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
	--mcodpr-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--mcodpr-text: #1e293b;
	--mcodpr-text-muted: #64748b;
	--mcodpr-border: #e2e8f0;
	--mcodpr-bg: #f8fafc;
}

/* =========================================
   Test Mode Badge
   ========================================= */
.mcodpr-test-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: linear-gradient(135deg, #f59e0b, #d97706);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding: 4px 12px;
	border-radius: 20px;
	margin-bottom: 12px;
	font-family: var(--mcodpr-font);
}

.mcodpr-test-info {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-left: 3px solid #f59e0b;
	padding: 10px 14px;
	margin-bottom: 16px;
	font-size: 12px;
	line-height: 1.6;
	color: #92400e;
	border-radius: 0 var(--mcodpr-radius-sm) var(--mcodpr-radius-sm) 0;
	font-family: var(--mcodpr-font);
}

/* =========================================
   Redirect Info (subscription flow)
   ========================================= */
.mcodpr-redirect-info {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: var(--mcodpr-color-light);
	border: 1px solid var(--mcodpr-color);
	border-radius: var(--mcodpr-radius-sm);
	padding: 14px 16px;
	color: var(--mcodpr-text);
	font-size: 14px;
	line-height: 1.6;
	font-family: var(--mcodpr-font);
}

.mcodpr-redirect-icon {
	font-size: 16px;
	flex-shrink: 0;
	margin-top: 1px;
}

/* =========================================
   Main Wrapper
   ========================================= */
.mcodpr-secure-fields-form {
	background: #ffffff;
	border: 1px solid var(--mcodpr-border);
	border-radius: var(--mcodpr-radius);
	padding: 24px;
	margin-top: 8px;
	margin-bottom: 16px;
	box-shadow: var(--mcodpr-shadow);
	font-family: var(--mcodpr-font);
}

/* =========================================
   3D Card Preview
   ========================================= */
.mcodpr-card-scene {
	perspective: 1000px;
	margin: 0 auto 28px;
	width: 100%;
	max-width: 340px;
	height: 200px;
}

.mcodpr-card {
	width: 100%;
	height: 100%;
	position: relative;
	transform-style: preserve-3d;
	transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
	border-radius: 16px;
}

.mcodpr-card.is-flipped {
	transform: rotateY(180deg);
}

/* Front & Back shared */
.mcodpr-card-front,
.mcodpr-card-back {
	position: absolute;
	inset: 0;
	border-radius: 16px;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 6px 20px rgba(0, 0, 0, 0.15);
	color: #ffffff;
}

/* Card gradient — uses brand color */
.mcodpr-card-front {
	background: linear-gradient(135deg, var(--mcodpr-color) 0%, var(--mcodpr-color-dark) 100%);
	padding: 18px 18px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.mcodpr-card-back {
	background: linear-gradient(135deg, var(--mcodpr-color-dark) 0%, #0a0a1a 100%);
	transform: rotateY(180deg);
	padding: 0;
	display: flex;
	flex-direction: column;
}

/* Decorative circles */
.mcodpr-card-front::before,
.mcodpr-card-front::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	opacity: 0.15;
}

.mcodpr-card-front::before {
	width: 200px;
	height: 200px;
	background: #fff;
	top: -60px;
	right: -60px;
}

.mcodpr-card-front::after {
	width: 140px;
	height: 140px;
	background: #fff;
	bottom: -40px;
	left: -30px;
}

/* Chip */
.mcodpr-card-chip {
	width: 40px;
	height: 30px;
	background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
	border-radius: 5px;
	position: relative;
	margin-bottom: 20px;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.mcodpr-card-chip::after {
	content: '';
	position: absolute;
	inset: 5px;
	border-radius: 2px;
	border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Card Number */
.mcodpr-card-number-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 4px;
	flex-wrap: nowrap;
	margin-bottom: 16px;
}

.mcodpr-card-number-group {
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 1.5px;
	font-family: 'Courier New', monospace;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	transition: opacity 0.3s;
	flex-shrink: 1;
	white-space: nowrap;
}

/* Card Bottom Row */
.mcodpr-card-bottom {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
}

.mcodpr-card-label {
	font-size: 9px;
	text-transform: uppercase;
	letter-spacing: 1px;
	opacity: 0.7;
	margin-bottom: 2px;
}

.mcodpr-card-value {
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 1px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 160px;
	transition: opacity 0.3s;
}

/* Card brand logo area */
.mcodpr-card-brand {
	font-size: 22px;
	font-weight: 900;
	letter-spacing: -1px;
	text-shadow: none;
	opacity: 0.9;
	flex-shrink: 0;
}

.mcodpr-card-brand img {
	height: 28px;
	width: auto;
	filter: brightness(0) invert(1);
}

/* Back — magnetic strip */
.mcodpr-card-strip {
	background: #1a1a2e;
	height: 44px;
	margin-top: 24px;
	width: 100%;
}

/* Back — CVV area */
.mcodpr-card-cvv-wrap {
	margin: 16px 24px 0;
}

.mcodpr-card-cvv-label {
	font-size: 9px;
	text-transform: uppercase;
	letter-spacing: 1px;
	opacity: 0.7;
	margin-bottom: 4px;
}

.mcodpr-card-cvv-box {
	background: #fff;
	border-radius: 4px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0 12px;
}

.mcodpr-card-cvv-value {
	color: #1e293b;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 4px;
	font-family: 'Courier New', monospace;
}

/* =========================================
   Form Fields
   ========================================= */
.mcodpr-fields-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.mcodpr-field-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mcodpr-field-group.mcodpr-field-full {
	grid-column: 1 / -1;
}

.mcodpr-field-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--mcodpr-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* MP iFrame containers */
.mcodpr-input-container {
	height: 44px;
	border: 1.5px solid var(--mcodpr-border);
	border-radius: var(--mcodpr-radius-sm);
	background-color: var(--mcodpr-bg);
	padding: 0 12px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mcodpr-input-container:focus-within {
	border-color: var(--mcodpr-color);
	box-shadow: 0 0 0 3px rgba(0, 158, 227, 0.15);
	background: #fff;
}

/* Standard HTML inputs */
.mcodpr-input {
	width: 100%;
	height: 44px;
	border: 1.5px solid var(--mcodpr-border);
	border-radius: var(--mcodpr-radius-sm);
	background: var(--mcodpr-bg);
	padding: 0 12px;
	font-size: 14px;
	color: var(--mcodpr-text);
	font-family: var(--mcodpr-font);
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.mcodpr-input:focus {
	border-color: var(--mcodpr-color);
	box-shadow: 0 0 0 3px rgba(0, 158, 227, 0.15);
	background: #fff;
}

select.mcodpr-input {
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
}

/* =========================================
   Security Footer
   ========================================= */
.mcodpr-security-note {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--mcodpr-border);
	font-size: 11px;
	color: var(--mcodpr-text-muted);
	font-family: var(--mcodpr-font);
}

.mcodpr-security-note svg {
	flex-shrink: 0;
}

/* =========================================
   Shimmer animation on card number update
   ========================================= */
@keyframes mcodpr-shimmer {
	0% {
		opacity: 1;
	}

	50% {
		opacity: 0.4;
	}

	100% {
		opacity: 1;
	}
}

.mcodpr-card-number-group.updating {
	animation: mcodpr-shimmer 0.4s ease;
}

/* =========================================
   License Block Notice
   ========================================= */
.mcodpr-license-block {
	background: #fcf0f1;
	border-left: 4px solid #d63638;
	padding: 15px 20px;
	border-radius: var(--mcodpr-radius-sm);
	margin: 10px 0;
	font-family: var(--mcodpr-font);
}

.mcodpr-license-block p {
	margin: 0;
	color: #d63638;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.5;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 480px) {
	.mcodpr-fields-grid {
		grid-template-columns: 1fr;
	}

	.mcodpr-field-group.mcodpr-field-full {
		grid-column: 1;
	}

	.mcodpr-card-scene {
		max-width: 280px;
		height: 165px;
	}

	.mcodpr-card-number-group {
		font-size: 15px;
	}
}