/**
 * Unified Form Styling System
 * Beautiful, modern form elements for both light and dark themes
 */

/* Form Container */
.form-container {
	position: relative;
}

.form-container::before {
	content: '';
	position: absolute;
	inset: -1px;
	background: linear-gradient(135deg, var(--accent1), var(--accent2), var(--accent3));
	border-radius: inherit;
	opacity: 0;
	transition: opacity 0.3s;
	z-index: -1;
	filter: blur(6px);
}

.form-container:focus-within::before {
	opacity: 0.3;
}

/* Form Card with Gradient Border */
.form-card {
	position: relative;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	border: 2px solid var(--glass-border);
	border-radius: 1.5rem;
	transition: all 0.3s ease;
}

[data-theme="light"] .form-card {
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 
		0 10px 40px rgba(0, 0, 0, 0.08),
		0 0 20px rgba(0, 191, 166, 0.05);
	border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .form-card {
	box-shadow: 
		0 10px 40px rgba(0, 0, 0, 0.3),
		0 0 20px rgba(0, 191, 166, 0.1);
}

.form-card:hover {
	border-color: rgba(0, 191, 166, 0.3);
	transform: translateY(-2px);
}

[data-theme="light"] .form-card:hover {
	box-shadow: 
		0 15px 50px rgba(0, 0, 0, 0.12),
		0 0 30px rgba(0, 191, 166, 0.08);
}

/* Form Group */
.form-group {
	position: relative;
	margin-bottom: 1.5rem;
}

.form-group:last-child {
	margin-bottom: 0;
}

/* Labels */
.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--textp);
	margin-bottom: 0.5rem;
}

.form-label-required::after {
	content: ' *';
	color: #EF4444;
}

/* Input Fields with Icons */
.form-input-wrapper {
	position: relative;
}

.form-input-icon {
	position: absolute;
	left: 1rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1.25rem;
	height: 1.25rem;
	color: var(--texts);
	pointer-events: none;
	transition: color 0.3s;
	z-index: 1;
}

.form-input-wrapper:focus-within .form-input-icon {
	color: var(--accent1);
}

/* Input Base Styles */
.form-input,
.form-textarea,
.form-select {
	width: 100%;
	padding: 0.875rem 1rem;
	padding-left: 3rem;
	background: rgba(255, 255, 255, 0.5);
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-radius: 0.75rem;
	color: var(--textp);
	font-size: 0.9375rem;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	outline: none;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .form-select {
	background: rgba(0, 0, 0, 0.2);
	border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-textarea,
[data-theme="light"] .form-select {
	background: rgba(255, 255, 255, 0.9);
	border-color: rgba(0, 0, 0, 0.08);
	color: var(--textp);
}

/* Input Focus States */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
	border-color: var(--accent1);
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 
		0 0 0 4px rgba(0, 191, 166, 0.1),
		0 4px 12px rgba(0, 191, 166, 0.15);
	transform: translateY(-2px);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus,
[data-theme="dark"] .form-select:focus {
	background: rgba(0, 0, 0, 0.3);
	box-shadow: 
		0 0 0 4px rgba(0, 191, 166, 0.2),
		0 4px 12px rgba(0, 191, 166, 0.25);
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-textarea:focus,
[data-theme="light"] .form-select:focus {
	background: rgba(255, 255, 255, 1);
	box-shadow: 
		0 0 0 4px rgba(0, 191, 166, 0.1),
		0 4px 12px rgba(0, 191, 166, 0.15);
}

/* Input Hover States */
.form-input:hover:not(:focus),
.form-textarea:hover:not(:focus),
.form-select:hover:not(:focus) {
	border-color: rgba(0, 191, 166, 0.3);
	box-shadow: 0 2px 8px rgba(0, 191, 166, 0.1);
}

/* Textarea Specific */
.form-textarea {
	padding-left: 1rem;
	min-height: 120px;
	resize: vertical;
}

/* Select Specific */
.form-select {
	padding-left: 3rem;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 1.25rem;
	padding-right: 2.5rem;
}

.form-select-inline {
	width: auto;
	min-width: 160px;
}

@media (max-width: 640px) {
	.form-select-inline {
		width: 100%;
		min-width: 0;
	}
}

/* Input without icon */
.form-input-no-icon,
.form-input-no-icon:focus {
	padding-left: 1rem;
}

/* Checkbox and Radio */
.form-checkbox,
.form-radio {
	width: 1.25rem;
	height: 1.25rem;
	accent-color: var(--accent1);
	cursor: pointer;
	transition: all 0.3s;
}

.form-checkbox:hover,
.form-radio:hover {
	transform: scale(1.1);
}

.form-checkbox-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	font-size: 0.875rem;
	color: var(--textp);
}

/* Button Styles */
.form-submit {
	position: relative;
	padding: 0.875rem 2rem;
	background: linear-gradient(90deg, var(--accent1), var(--accent2));
	color: #000;
	font-weight: 600;
	border: none;
	border-radius: 0.75rem;
	cursor: pointer;
	transition: all 0.3s ease;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0, 191, 166, 0.3);
}

.form-submit::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
	transition: left 0.5s;
}

.form-submit:hover::before {
	left: 100%;
}

.form-submit:hover {
	transform: translateY(-2px) scale(1.02);
	box-shadow: 0 6px 20px rgba(45, 156, 219, 0.4);
}

.form-submit:active {
	transform: translateY(0) scale(0.98);
}

/* Error Messages */
.form-error {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1rem;
	margin-bottom: 1.5rem;
	background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
	border: 2px solid rgba(239, 68, 68, 0.3);
	border-radius: 0.75rem;
	color: #EF4444;
	font-size: 0.875rem;
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.form-error-icon {
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.125rem;
}

.form-error-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

/* Success Messages */
.form-success {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem;
	margin-bottom: 1.5rem;
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
	border: 2px solid rgba(16, 185, 129, 0.3);
	border-radius: 0.75rem;
	color: #10B981;
	font-size: 0.875rem;
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.form-success-icon {
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
}

/* Form Section Headers */
.form-section-header {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--textp);
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid var(--border);
}

/* Form Grid */
.form-grid {
	display: grid;
	gap: 1.5rem;
}

.form-grid-2 {
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Input Help Text */
.form-help {
	font-size: 0.75rem;
	color: var(--texts);
	margin-top: 0.25rem;
}

/* Loading State */
.form-loading {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
}

.form-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1.5rem;
	height: 1.5rem;
	margin: -0.75rem 0 0 -0.75rem;
	border: 3px solid var(--accent1);
	border-top-color: transparent;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* File Input */
.form-file {
	position: relative;
	display: inline-block;
	cursor: pointer;
}

.form-file-input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.form-file-label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.875rem 1.5rem;
	background: var(--glass-bg);
	border: 2px dashed var(--glass-border);
	border-radius: 0.75rem;
	color: var(--textp);
	font-size: 0.875rem;
	transition: all 0.3s;
	cursor: pointer;
}

.form-file-label:hover {
	border-color: var(--accent1);
	background: var(--hover-bg);
}

.form-file-input:focus + .form-file-label {
	border-color: var(--accent1);
	box-shadow: 0 0 0 4px rgba(0, 191, 166, 0.1);
}


