/**
 * Form2Sheets – Form styles
 *
 * Modern SaaS-style form. Works with any theme.
 *
 * @package Form2Sheets
 */

.f2s-form-wrapper {
	max-width: 600px;
	margin: 0 auto;
}

.f2s-form {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
	padding: 2rem;
}

.f2s-field {
	margin: 0 0 1.25rem;
}

.f2s-field:last-of-type {
	margin-bottom: 1.5rem;
}

.f2s-field label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 500;
	color: #374151;
	font-size: 0.9375rem;
}

.f2s-field .required {
	color: #dc2626;
}

.f2s-phone-inline {
	position: relative;
	display: flex;
	align-items: stretch;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.f2s-phone-inline:focus-within {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.f2s-phone-prefix {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	padding-left: 0.875rem;
	padding-right: 0.5rem;
	font-size: 1rem;
	line-height: 1.5;
	color: #6b7280;
	white-space: nowrap;
	user-select: none;
	pointer-events: none;
}

.f2s-phone-prefix:not(:empty) {
	border-right: 1px solid #e5e7eb;
}
.f2s-phone-inline .f2s-number-input {
	flex: 1;
	min-width: 0;
	border: none;
	box-shadow: none;
	background: transparent;
	padding: 0.65rem 0.875rem;
}
.f2s-phone-inline .f2s-number-input:focus {
	outline: none;
}

.f2s-field-hint {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.8125rem;
	color: #6b7280;
}

.f2s-input,
.f2s-textarea {
	width: 100%;
	padding: 0.65rem 0.875rem;
	font-size: 1rem;
	line-height: 1.5;
	color: #111827;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
}

.f2s-input:hover,
.f2s-textarea:hover {
	border-color: #d1d5db;
}

.f2s-input:focus,
.f2s-textarea:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.f2s-input::placeholder,
.f2s-textarea::placeholder {
	color: #9ca3af;
}

.f2s-textarea {
	resize: vertical;
	min-height: 100px;
}


.f2s-response {
	min-height: 1.5rem;
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.f2s-response:empty {
	display: none;
}

.f2s-response.f2s-success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.f2s-response.f2s-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.f2s-submit {
	margin: 0;
}

.f2s-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	font-weight: 500;
	color: #fff;
	background: #2563eb;
	border: none;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	cursor: pointer;
	transition: background 0.15s ease, box-shadow 0.15s ease;
}

.f2s-button:hover {
	background: #1d4ed8;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.f2s-button:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.f2s-button:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

/* Validation error state */
.f2s-input.f2s-field-error,
.f2s-textarea.f2s-field-error,
.f2s-field-has-error .f2s-phone-inline {
	border-color: #dc2626;
	box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}
.f2s-field-has-error .f2s-phone-inline:focus-within {
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* Submit button loading animation */
.f2s-button .f2s-button-loading {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.f2s-button.is-loading .f2s-button-text {
	display: none;
}

.f2s-button.is-loading .f2s-button-loading {
	display: inline-flex;
}

.f2s-button-loading-spinner {
	width: 1.125rem;
	height: 1.125rem;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: f2s-spin 0.7s linear infinite;
}

@keyframes f2s-spin {
	to {
		transform: rotate(360deg);
	}
}

.f2s-button.is-loading {
	pointer-events: none;
	position: relative;
	overflow: hidden;
}

.f2s-button.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		105deg,
		transparent 0%,
		rgba(255, 255, 255, 0.08) 45%,
		rgba(255, 255, 255, 0.12) 50%,
		rgba(255, 255, 255, 0.08) 55%,
		transparent 100%
	);
	animation: f2s-shine 1.5s ease-in-out infinite;
}

@keyframes f2s-shine {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(100%);
	}
}
