/**
 * Freekey Billing Custom Checkout Styles
 */

:root {
	--freekey-primary-color: #0055ff;
	--freekey-dark-bg: #001a4d;
	--freekey-darker-bg: #000d27;
	--freekey-light-text: #ffffff;
	--freekey-placeholder-text: #8b9dc3;
	--freekey-border-color: #1a3a6d;
	--freekey-success-color: #10b981;
	--freekey-error-color: #ef4444;
	--freekey-input-bg: #ffffff;
	--freekey-form-border: #e5e7eb;
	--freekey-transition: all 0.3s ease;
}

.freekey-checkout-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.freekey-checkout-wrapper {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	background: linear-gradient(135deg, var(--freekey-dark-bg) 0%, var(--freekey-darker-bg) 100%);
	padding: 40px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	color: var(--freekey-light-text);
	position: relative;
}

/* Left Section - Form */
.freekey-checkout-left {
	display: flex;
	flex-direction: column;
	gap: 30px;
}

.freekey-checkout-form {
	display: flex;
	flex-direction: column;
	gap: 30px;
}

.freekey-checkout-section {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--freekey-border-color);
	border-radius: 8px;
	padding: 24px;
	backdrop-filter: blur(10px);
}

.freekey-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.freekey-section-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0;
	color: var(--freekey-light-text);
}

.freekey-checkmark,
.freekey-checkmark-card {
	width: 24px;
	height: 24px;
	background: var(--freekey-success-color);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 14px;
	font-weight: 700;
}

.freekey-checkmark {
	opacity: 0.7;
}

/* Form Groups */
.freekey-form-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.freekey-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.freekey-form-col {
	margin-bottom: 0;
}

.freekey-form-label {
	font-size: 14px;
	font-weight: 500;
	color: var(--freekey-light-text);
	display: flex;
	align-items: center;
	gap: 4px;
}

.freekey-required {
	color: #ff6b6b;
}

.freekey-form-input {
	padding: 12px 14px;
	border: 1px solid var(--freekey-form-border);
	border-radius: 6px;
	background: var(--freekey-input-bg);
	color: #1f2937;
	font-size: 14px;
	transition: var(--freekey-transition);
	font-family: inherit;
}

.freekey-form-input::placeholder {
	color: var(--freekey-placeholder-text);
}

.freekey-form-input:focus {
	outline: none;
	border-color: var(--freekey-primary-color);
	box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.1);
}

.freekey-form-input.error {
	border-color: var(--freekey-error-color);
	background-color: rgba(239, 68, 68, 0.1);
}

.freekey-select-input {
	cursor: pointer;
	appearance: none;
	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='%231f2937' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
}

/* Saved Cards */
.freekey-saved-cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 16px;
}

.freekey-card-option {
	display: flex;
	cursor: pointer;
}

.freekey-card-radio {
	margin-top: 12px;
	cursor: pointer;
	accent-color: var(--freekey-primary-color);
}

.freekey-card-display {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	border: 2px solid var(--freekey-form-border);
	border-radius: 6px;
	transition: var(--freekey-transition);
	margin-left: 8px;
}

.freekey-card-option input[type="radio"]:checked ~ .freekey-card-display {
	border-color: var(--freekey-primary-color);
	background: rgba(0, 85, 255, 0.05);
}

.freekey-card-icon {
	width: 48px;
	height: 32px;
	background: linear-gradient(135deg, #1434cb 0%, #0055ff 100%);
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 11px;
	font-weight: 600;
	flex-shrink: 0;
}

.freekey-card-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.freekey-card-details p {
	font-size: 13px;
	margin: 0;
	color: #1f2937;
}

.freekey-card-number {
	font-weight: 600;
	color: #1f2937;
}

.freekey-card-expiry {
	color: #6b7280;
	font-size: 12px;
}

.freekey-checkmark-card {
	flex-shrink: 0;
	opacity: 0;
	transform: scale(0.8);
	transition: var(--freekey-transition);
}

.freekey-card-option input[type="radio"]:checked ~ .freekey-card-display .freekey-checkmark-card {
	opacity: 1;
	transform: scale(1);
}

.freekey-add-new-card-link p {
	margin: 0;
	text-align: center;
}

.freekey-add-new-card-link a {
	color: var(--freekey-primary-color);
	text-decoration: none;
	font-size: 14px;
	cursor: pointer;
	transition: var(--freekey-transition);
}

.freekey-add-new-card-link a:hover {
	text-decoration: underline;
}

/* WooCommerce Payment Methods */
#payment.freekey-payment-methods {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

#payment.error {
	border: 2px solid var(--freekey-error-color);
	padding: 12px;
	border-radius: 6px;
	background: rgba(239, 68, 68, 0.1);
}

.freekey-payment-option {
	display: flex;
	align-items: flex-start;
	cursor: pointer;
	padding: 0;
	margin: 0;
}

.freekey-payment-input {
	margin-top: 12px;
	margin-right: 12px;
	cursor: pointer;
	accent-color: var(--freekey-primary-color);
	flex-shrink: 0;
}

.freekey-payment-method-display {
	flex: 1;
	padding: 14px;
	border: 2px solid var(--freekey-form-border);
	border-radius: 6px;
	transition: var(--freekey-transition);
	background: var(--freekey-input-bg);
}

.freekey-payment-option input[type="radio"]:checked ~ .freekey-payment-method-display {
	border-color: var(--freekey-primary-color);
	background: rgba(0, 85, 255, 0.05);
}

.freekey-payment-method-title {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
	margin: 0 0 4px 0;
}

.freekey-payment-method-desc {
	font-size: 13px;
	color: #6b7280;
	margin: 0;
	line-height: 1.4;
}

.freekey-checkmark-payment {
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	opacity: 0;
	transform: scale(0.8);
	transition: var(--freekey-transition);
	color: var(--freekey-success-color);
	font-weight: 700;
	font-size: 14px;
	margin-left: 12px;
	margin-top: 12px;
}

.freekey-payment-option input[type="radio"]:checked ~ .freekey-payment-method-display ~ .freekey-checkmark-payment {
	opacity: 1;
	transform: scale(1);
}

/* Payment Gateway Fields */
#freekey-payment-fields {
	margin-bottom: 20px;
}

.freekey-payment-fields {
	padding: 16px;
	background: rgba(255, 255, 255, 0.03);
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	margin-top: 12px;
}

.freekey-payment-fields input,
.freekey-payment-fields select,
.freekey-payment-fields textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--freekey-form-border);
	border-radius: 4px;
	font-size: 13px;
	margin-bottom: 12px;
	background: var(--freekey-input-bg);
	color: #1f2937;
}

.freekey-payment-fields input:last-child,
.freekey-payment-fields select:last-child,
.freekey-payment-fields textarea:last-child {
	margin-bottom: 0;
}

/* New Card Form */
.freekey-new-card-form {
	display: none;
	margin-top: 16px;
	padding: 16px;
	background: rgba(255, 255, 255, 0.03);
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.freekey-new-card-form.active {
	display: block;
}

.freekey-card-input {
	font-family: 'Courier New', monospace;
	letter-spacing: 1px;
}

.freekey-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 14px;
	color: var(--freekey-light-text);
	margin-top: 12px;
}

.freekey-checkbox {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: var(--freekey-primary-color);
}

/* Right Section - Order Summary */
.freekey-checkout-right {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.freekey-selected-plan {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--freekey-border-color);
	border-radius: 8px;
	padding: 28px;
	backdrop-filter: blur(10px);
	position: sticky;
	top: 20px;
}

.freekey-plan-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 16px 0;
	color: var(--freekey-light-text);
}

.freekey-plan-details {
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.freekey-plan-name-detail {
	font-size: 16px;
	font-weight: 500;
	margin: 0;
	color: var(--freekey-light-text);
	line-height: 1.4;
}

.freekey-plan-name-detail small {
	display: block;
	font-size: 13px;
	color: var(--freekey-placeholder-text);
	margin-top: 6px;
	font-weight: 400;
}

/* Order Summary */
.freekey-order-summary {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.freekey-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	font-size: 14px;
}

.freekey-summary-label {
	color: var(--freekey-placeholder-text);
	font-weight: 500;
}

.freekey-summary-value {
	color: var(--freekey-light-text);
	font-weight: 600;
}

.freekey-discount-row {
	color: var(--freekey-success-color);
	padding: 10px 0;
	background: rgba(16, 185, 129, 0.1);
	padding: 8px 12px;
	margin: 0 -8px;
	border-radius: 4px;
	padding-left: 12px;
	padding-right: 12px;
}

.freekey-discount-value {
	color: var(--freekey-success-color);
	font-weight: 600;
}

/* Coupon Section */
.freekey-coupon-section {
	padding: 12px 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.freekey-coupon-link {
	color: var(--freekey-primary-color);
	text-decoration: none;
	font-size: 13px;
	cursor: pointer;
	transition: var(--freekey-transition);
	width: fit-content;
	order: 2;
}

.freekey-coupon-link:hover {
	text-decoration: underline;
}

.freekey-coupon-input-wrapper {
	display: flex;
	gap: 8px;
	order: 1;
}

.freekey-coupon-input {
	flex: 1;
	padding: 10px 12px;
	font-size: 13px;
}

.freekey-apply-coupon-btn {
	padding: 10px 16px;
	background: var(--freekey-primary-color);
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	transition: var(--freekey-transition);
	white-space: nowrap;
}

.freekey-apply-coupon-btn:hover {
	background: #0044cc;
	transform: translateY(-2px);
	box-shadow: 0 8px 16px rgba(0, 85, 255, 0.3);
}

/* Summary Separator */
.freekey-summary-separator {
	height: 1px;
	background: rgba(255, 255, 255, 0.15);
	margin: 8px 0;
}

/* Total Row */
.freekey-total-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 0;
	font-size: 18px;
	font-weight: 700;
	border-top: 2px solid rgba(255, 255, 255, 0.15);
	border-bottom: 2px solid rgba(255, 255, 255, 0.15);
	margin: 8px 0;
}

.freekey-total-value {
	color: var(--freekey-light-text);
	font-size: 20px;
}

/* Complete Purchase Button */
.freekey-complete-purchase-btn {
	width: 100%;
	padding: 14px 24px;
	background: linear-gradient(135deg, #0055ff 0%, #003dcc 100%);
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: var(--freekey-transition);
	margin: 20px 0;
	box-shadow: 0 8px 24px rgba(0, 85, 255, 0.3);
}

.freekey-complete-purchase-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 32px rgba(0, 85, 255, 0.4);
	background: linear-gradient(135deg, #0055ff 0%, #0033b3 100%);
}

.freekey-complete-purchase-btn:active {
	transform: translateY(0);
}

.freekey-complete-purchase-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* Security Badge */
.freekey-security-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	background: rgba(16, 185, 129, 0.1);
	border-radius: 6px;
	justify-content: center;
	text-align: center;
	font-size: 12px;
	color: var(--freekey-placeholder-text);
	margin-top: 12px;
}

.freekey-lock-icon {
	color: var(--freekey-success-color);
	flex-shrink: 0;
}

.freekey-security-badge p {
	margin: 0;
}

/* Loading Overlay */
.freekey-checkout-loading {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 13, 39, 0.8);
	backdrop-filter: blur(2px);
	border-radius: 12px;
	z-index: 1000;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
}

.freekey-checkout-loading.active {
	display: flex;
}

.freekey-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid rgba(255, 255, 255, 0.2);
	border-top-color: var(--freekey-primary-color);
	border-radius: 50%;
	animation: freekey-spin 0.8s linear infinite;
}

@keyframes freekey-spin {
	to {
		transform: rotate(360deg);
	}
}

.freekey-checkout-loading p {
	color: var(--freekey-light-text);
	font-size: 14px;
	margin: 0;
	font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
	.freekey-checkout-wrapper {
		grid-template-columns: 1fr;
		gap: 20px;
		padding: 24px;
	}

	.freekey-checkout-section {
		padding: 16px;
	}

	.freekey-form-row {
		grid-template-columns: 1fr;
	}

	.freekey-selected-plan {
		position: static;
		margin-top: 20px;
	}

	.freekey-summary-row {
		font-size: 13px;
	}

	.freekey-total-row {
		font-size: 16px;
	}

	.freekey-total-value {
		font-size: 18px;
	}

	.freekey-complete-purchase-btn {
		padding: 12px 20px;
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.freekey-checkout-container {
		padding: 12px;
	}

	.freekey-checkout-wrapper {
		padding: 16px;
		border-radius: 8px;
	}

	.freekey-section-title {
		font-size: 16px;
	}

	.freekey-form-label {
		font-size: 13px;
	}

	.freekey-form-input {
		padding: 10px 12px;
		font-size: 13px;
	}

	.freekey-card-display {
		padding: 12px;
		gap: 8px;
	}

	.freekey-card-icon {
		width: 40px;
		height: 28px;
		font-size: 10px;
	}

	.freekey-plan-title {
		font-size: 16px;
	}

	.freekey-plan-name-detail {
		font-size: 14px;
	}
}
