/* EZFormz - Base Styles (extracted from layout.ts) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
	--primary: #4f46e5;
	--primary-hover: #4338ca;
	--primary-light: #eef2ff;
	--danger: #ef4444;
	--danger-hover: #dc2626;
	--success: #10b981;
	--warning: #f59e0b;
	--gray-50: #f9fafb;
	--gray-100: #f3f4f6;
	--gray-200: #e5e7eb;
	--gray-300: #d1d5db;
	--gray-400: #9ca3af;
	--gray-500: #6b7280;
	--gray-600: #4b5563;
	--gray-700: #374151;
	--gray-800: #1f2937;
	--gray-900: #111827;
	--radius: 8px;
	--radius-lg: 12px;
	--shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
	--shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
	--shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	background: var(--gray-50);
	color: var(--gray-900);
	line-height: 1.6;
	min-height: 100vh;
}

/* Nav */
.nav {
	background: white;
	border-bottom: 1px solid var(--gray-200);
	padding: 0 24px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: sticky;
	top: 0;
	z-index: 100;
}
.nav-brand {
	font-size: 20px;
	font-weight: 700;
	color: var(--primary);
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 8px;
}
.beta-tag {
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: #fef3c7;
	color: #92400e;
	padding: 2px 6px;
	border-radius: 4px;
}
.beta-bar {
	background: #fffbeb;
	border-bottom: 1px solid #fde68a;
	padding: 6px 24px;
	font-size: 12px;
	color: #92400e;
	text-align: center;
	position: relative;
}
.beta-bar a, .beta-bar button:not(.beta-close) { color: #b45309; font-weight: 600; background: none; border: none; cursor: pointer; font-size: inherit; font-family: inherit; text-decoration: underline; padding: 0; }
.beta-close {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: #92400e;
	font-size: 18px;
	padding: 4px;
	line-height: 1;
	opacity: 0.6;
}
.beta-close:hover { opacity: 1; }
/* Hamburger menu button (injected by shared.js, hidden on desktop) */
.nav-hamburger {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: var(--gray-600);
	-webkit-tap-highlight-color: transparent;
}
.nav-hamburger svg { display: block; }
/* Feedback modal */
.fb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center; padding: 24px; }
.fb-overlay.open { display: flex; }
.fb-modal { background: #fff; border-radius: 12px; padding: 28px; width: 100%; max-width: 440px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.fb-modal h3 { font-size: 18px; margin: 0 0 4px; color: var(--gray-800); }
.fb-modal p { font-size: 13px; color: var(--gray-500); margin: 0 0 16px; }
.fb-modal textarea { width: 100%; min-height: 120px; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical; }
.fb-modal textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.fb-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.fb-msg { font-size: 13px; margin-top: 10px; }
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links a {
	color: var(--gray-600);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: color 0.15s;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { font-weight: 600; color: var(--primary); }
.nav-links a.btn { color: white; }
.nav-links a.btn:hover { color: white; }

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: var(--radius);
	font-size: 14px;
	font-weight: 600;
	border: none;
	cursor: pointer;
	transition: all 0.15s;
	text-decoration: none;
	line-height: 1;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: var(--gray-700);
	margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--gray-300);
	border-radius: var(--radius);
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.15s, box-shadow 0.15s;
	background: white;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* Cards */
.card {
	background: white;
	border: 1px solid var(--gray-200);
	border-radius: var(--radius-lg);
	padding: 24px;
	box-shadow: var(--shadow);
}

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 24px; }
.container-md { max-width: 700px; margin: 0 auto; padding: 24px; }

/* Grid */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* Utility */
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--gray-500); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-2 { gap: 16px; }
.gap-1 { gap: 8px; }
.hidden { display: none !important; }

/* Alert / Toast */
.alert {
	padding: 12px 16px;
	border-radius: var(--radius);
	font-size: 14px;
	margin-bottom: 16px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--primary-light); color: #3730a3; border: 1px solid #c7d2fe; }

/* Badge */
.badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}
.badge-active { background: #ecfdf5; color: #065f46; }
.badge-inactive { background: var(--gray-100); color: var(--gray-500); }
.badge-pending { background: #fffbeb; color: #92400e; }
.badge-confirmed { background: #ecfdf5; color: #065f46; }
.badge-shipped { background: var(--primary-light); color: #3730a3; }
.badge-completed { background: #ecfdf5; color: #065f46; }
.badge-cancelled { background: #fef2f2; color: #991b1b; }

/* Loading spinner */
.spinner {
	width: 20px; height: 20px;
	border: 2px solid var(--gray-200);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast Notifications (global) */
.toast-notification {
	position: fixed; bottom: 24px; right: 24px; z-index: 2000;
	padding: 12px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
	color: white; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	opacity: 0; transform: translateY(10px);
	transition: opacity 0.3s, transform 0.3s;
}
.toast-notification.toast-visible { opacity: 1; transform: translateY(0); }
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: var(--primary); }

/* Skeleton loading */
@keyframes shimmer {
	0% { background-position: -400px 0; }
	100% { background-position: 400px 0; }
}
.skeleton {
	background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
	background-size: 800px 100%;
	animation: shimmer 1.5s infinite;
	border-radius: var(--radius);
}
.skeleton-card {
	background: white;
	border: 1px solid var(--gray-200);
	border-radius: var(--radius-lg);
	padding: 20px;
	box-shadow: var(--shadow);
}
.skeleton-line {
	height: 14px;
	margin-bottom: 10px;
}
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.h-6 { height: 24px; }

/* Fade-in animation */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease-out; }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

/* Responsive */
@media (max-width: 640px) {
	.container { padding: 12px; }
	.card { padding: 14px; }
	.grid-2, .grid-3 { grid-template-columns: 1fr; }
	.hide-mobile { display: none; }
	.nav { padding: 0 12px; height: 52px; }
	.nav-brand { font-size: 18px; }
	.nav-hamburger { display: flex; align-items: center; }
	.nav-links {
		display: none;
		position: absolute;
		top: 52px;
		left: 0;
		right: 0;
		background: white;
		border-bottom: 1px solid var(--gray-200);
		flex-direction: column;
		padding: 8px 0;
		box-shadow: var(--shadow-md);
		z-index: 99;
	}
	.nav.open .nav-links { display: flex; }
	.nav-links a { padding: 12px 24px; font-size: 15px; }
	.nav-links a.btn { margin: 8px 24px; text-align: center; justify-content: center; }
	.beta-bar { padding: 6px 36px 6px 12px; font-size: 11px; }
	.btn { min-height: 44px; }
	.form-input, .form-textarea, .form-select { min-height: 44px; font-size: 16px; }
}

/* Onboarding hint */
.onboarding-hint {
	position: fixed; bottom: 24px; right: 24px; z-index: 300;
	background: var(--primary); color: white; border-radius: var(--radius-lg);
	padding: 16px 20px; max-width: 320px; box-shadow: var(--shadow-lg);
	opacity: 0; transform: translateY(12px); transition: all 0.3s ease;
	font-size: 14px; line-height: 1.5;
}
.onboarding-hint.onboarding-visible { opacity: 1; transform: translateY(0); }
.onboarding-hint strong { display: block; margin-bottom: 4px; }
.onboarding-hint p { margin: 0; opacity: 0.9; font-size: 13px; }
.onboarding-close {
	position: absolute; top: 8px; right: 10px; background: none; border: none;
	color: white; font-size: 18px; cursor: pointer; opacity: 0.7; line-height: 1;
}
.onboarding-close:hover { opacity: 1; }

/* QR modal */
.qr-overlay {
	display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
	z-index: 200; align-items: center; justify-content: center; padding: 24px;
}
.qr-overlay.open { display: flex; }
.qr-modal {
	background: white; border-radius: var(--radius-lg); padding: 28px;
	max-width: 360px; width: 100%; text-align: center; box-shadow: var(--shadow-lg);
}
.qr-modal h3 { font-size: 18px; margin-bottom: 16px; }
.qr-modal canvas { margin: 0 auto 16px; display: block; }
.qr-modal .qr-url { font-size: 12px; color: var(--gray-400); word-break: break-all; margin-bottom: 16px; }
