/**
 * Frontend Forms, Modals & Cart Integration Styling
 *
 * @package DigitalCardAndBand
 * @author  Farhan
 */

/* Modal Backdrop & Container */
.dcb-modal-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.dcb-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.7);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	animation: dcbFadeIn 0.25s ease-out;
}

.dcb-modal-window {
	position: relative;
	z-index: 2;
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
	width: 100%;
	max-width: 560px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 32px 36px;
	box-sizing: border-box;
	animation: dcbScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dcb-modal-window.dcb-modal-sm {
	max-width: 420px;
}

@keyframes dcbFadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes dcbScaleUp {
	from {
		opacity: 0;
		transform: scale(0.94) translateY(12px);
	}

	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

/* Close Button */
.dcb-modal-close-btn {
	position: absolute;
	top: 18px;
	right: 20px;
	background: #f1f5f9;
	border: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 34px;
	text-align: center;
	color: #64748b;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dcb-modal-close-btn:hover {
	background: #e2e8f0;
	color: #0f172a;
	transform: rotate(90deg);
}

/* Modal Header */
.dcb-modal-header {
	margin-bottom: 22px;
}

.dcb-modal-badge {
	display: inline-block;
	background: #e0f2fe;
	color: #0369a1;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	padding: 4px 10px;
	border-radius: 20px;
	margin-bottom: 8px;
}

.dcb-modal-title {
	font-size: 22px;
	font-weight: 800;
	color: #0f172a;
	margin: 0 0 6px 0;
	letter-spacing: -0.3px;
}

.dcb-modal-desc {
	font-size: 13.5px;
	color: #64748b;
	margin: 0;
	line-height: 1.5;
}

/* Tab Switching */
.dcb-auth-switch-tabs {
	display: flex;
	background: #f1f5f9;
	border-radius: 10px;
	padding: 4px;
	margin-bottom: 22px;
	gap: 4px;
}

.dcb-switch-tab {
	flex: 1;
	background: transparent;
	border: none;
	padding: 9px 12px;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s;
}

.dcb-switch-tab.active {
	background: #ffffff;
	color: #0f172a;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Logged-in notification banner */
.dcb-logged-in-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 13px;
	color: #334155;
	margin-bottom: 18px;
}

.dcb-user-avatar {
	font-size: 16px;
}

/* Form Layout */
.dcb-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.dcb-form-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.dcb-form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.dcb-col-12 {
	width: 100%;
}

.dcb-col-6 {
	width: calc(50% - 8px);
}

@media (max-width: 520px) {
	.dcb-col-6 {
		width: 100%;
	}
}

.dcb-form-group label {
	font-size: 13px;
	font-weight: 600;
	color: #334155;
}

.dcb-req {
	color: #ef4444;
}

.dcb-input-wrap input,
.dcb-input-wrap textarea,
.dcb-input-wrap select {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid #cbd5e1;
	border-radius: 10px;
	font-size: 14px;
	color: #0f172a;
	background: #ffffff;
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.dcb-input-wrap input:focus,
.dcb-input-wrap textarea:focus,
.dcb-input-wrap select:focus {
	outline: none;
	border-color: #0284c7;
	box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.dcb-field-hint {
	font-size: 12px;
	color: #64748b;
	margin-top: 3px;
}

/* Logo Upload Dropzone */
.dcb-logo-upload-dropzone {
	position: relative;
	border: 2px dashed #cbd5e1;
	border-radius: 12px;
	padding: 18px;
	text-align: center;
	background: #f8fafc;
	transition: all 0.2s;
	cursor: pointer;
}

.dcb-logo-upload-dropzone:hover,
.dcb-logo-upload-dropzone.dragover {
	border-color: #0284c7;
	background: #f0f9ff;
}

.dcb-file-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.dcb-dropzone-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	pointer-events: none;
}

.dcb-upload-icon {
	font-size: 26px;
	color: #0284c7;
}

.dcb-dropzone-text {
	font-size: 13.5px;
	font-weight: 600;
	color: #0f172a;
}

.dcb-dropzone-subtext {
	font-size: 11.5px;
	color: #64748b;
}

.dcb-logo-preview-box {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #ffffff;
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
	margin-top: 6px;
	text-align: left;
}

.dcb-logo-preview-box img {
	width: 50px;
	height: 50px;
	object-fit: contain;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	padding: 2px;
}

.dcb-preview-meta {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dcb-btn-remove-logo {
	background: transparent;
	border: none;
	color: #ef4444;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	text-align: left;
}

.dcb-btn-remove-logo:hover {
	text-decoration: underline;
}

/* Submit Buttons */
.dcb-btn-submit {
	width: 100%;
	padding: 13px 20px;
	background: #0284c7;
	color: #ffffff;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.dcb-btn-submit:hover {
	background: #0369a1;
	box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
	transform: translateY(-1px);
}

.dcb-btn-submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

/* Spinner */
.dcb-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: dcbSpin 0.7s linear infinite;
	display: inline-block;
}

@keyframes dcbSpin {
	to {
		transform: rotate(360deg);
	}
}

/* Alerts */
.dcb-form-alert {
	padding: 11px 14px;
	border-radius: 8px;
	font-size: 13.5px;
	line-height: 1.4;
}

.dcb-form-alert.dcb-alert-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.dcb-form-alert.dcb-alert-success {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

/* Cart Item Badges */
.dcb-cart-type-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

.dcb-badge-card {
	background: #e0f2fe;
	color: #0369a1;
}

.dcb-badge-band {
	background: #dcfce7;
	color: #15803d;
}

.dcb-cart-profile-link {
	color: #0284c7;
	text-decoration: underline;
	word-break: break-all;
}

/* Inline Product Personalizer on Single Product Page */
.dcb-product-personalizer-wrapper {
	margin: 28px 0;
	padding: 24px;
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 18px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
	box-sizing: border-box;
}

.dcb-personalizer-header {
	margin-bottom: 20px;
}

.dcb-personalizer-badge {
	display: inline-block;
	background: #e0f2fe;
	color: #0369a1;
	font-size: 11.5px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 20px;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.dcb-personalizer-title {
	font-size: 20px;
	font-weight: 800;
	color: #0f172a;
	margin: 0 0 6px 0;
}

.dcb-personalizer-subtitle {
	font-size: 13.5px;
	color: #64748b;
	margin: 0;
	line-height: 1.5;
}

.dcb-inline-preview-box {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 24px 16px;
	text-align: center;
	margin-bottom: 22px;
}

.dcb-inline-preview-label {
	font-size: 12.5px;
	font-weight: 600;
	color: #0284c7;
	margin-bottom: 14px;
}

.dcb-inline-card-stage {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 250px;
}

.dcb-inline-tabs-nav {
	display: flex;
	gap: 8px;
	background: #f1f5f9;
	padding: 4px;
	border-radius: 10px;
	margin-bottom: 20px;
}

.dcb-inline-tab-btn {
	flex: 1;
	padding: 9px 12px;
	background: transparent;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	color: #64748b;
	cursor: pointer;
	transition: all 0.2s;
}

.dcb-inline-tab-btn.active {
	background: #ffffff;
	color: #0f172a;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.dcb-ctrl-section-inline {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 16px;
}

.dcb-section-label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 12px;
	border-bottom: 1px solid #e2e8f0;
	padding-bottom: 6px;
}

.dcb-inline-action-bar {
	margin-top: 20px;
}

.dcb-btn-inline-submit {
	width: 100%;
	padding: 14px 24px;
	background: #0284c7;
	color: #ffffff;
	border: none;
	border-radius: 12px;
	font-size: 15.5px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.dcb-btn-inline-submit:hover {
	background: #0369a1;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4);
}

/* Cart Customizer Section */
.dcb-cart-customizer-container {
	margin: 35px 0 25px 0;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 20px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
	padding: 32px 30px;
	box-sizing: border-box;
	clear: both;
}

.dcb-cart-customizer-header {
	margin-bottom: 24px;
	border-bottom: 1px solid #f1f5f9;
	padding-bottom: 18px;
}

.dcb-cart-customizer-badge {
	display: inline-block;
	background: #e0f2fe;
	color: #0369a1;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	padding: 4px 10px;
	border-radius: 20px;
	margin-bottom: 8px;
}

.dcb-cart-customizer-title {
	font-size: 22px;
	font-weight: 800;
	color: #0f172a;
	margin: 0 0 6px 0;
}

.dcb-cart-customizer-subtitle {
	font-size: 13.5px;
	color: #64748b;
	margin: 0;
	line-height: 1.5;
}

.dcb-cart-customizer-grid {
	display: grid;
	grid-template-columns: 1fr 1.15fr;
	gap: 36px;
	align-items: flex-start;
}

@media (max-width: 900px) {
	.dcb-cart-customizer-grid {
		grid-template-columns: 1fr;
	}
}

.dcb-cart-preview-box {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 24px 16px;
	text-align: center;
	position: sticky;
	top: 20px;
}

.dcb-cart-preview-label {
	font-size: 13px;
	font-weight: 700;
	color: #0284c7;
	margin-bottom: 16px;
}

.dcb-cart-card-stage {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 250px;
}

.dcb-cart-stage-hint {
	margin-top: 14px;
	color: #64748b;
	font-size: 12px;
}

.dcb-cart-section {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 16px;
}

.dcb-cart-section-title {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 12px;
	border-bottom: 1px solid #e2e8f0;
	padding-bottom: 6px;
}

.dcb-btn-save-cart-design {
	width: 100%;
	padding: 14px 24px;
	background: #0284c7;
	color: #ffffff;
	border: none;
	border-radius: 12px;
	font-size: 15.5px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.dcb-btn-save-cart-design:hover {
	background: #0369a1;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4);
}

.dcb-cart-customize-link:hover {
	background: #0369a1 !important;
	color: #ffffff !important;
}

.dcb-badge-card {
	background: #eff6ff;
	color: #1d4ed8;
	border: 1px solid #bfdbfe;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 12px;
}

.dcb-badge-band {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 12px;
}