/* =========================================================
   ATC Subscribe Form — Public Styles
   Author: Bharatnivas | Company: ATC
   ========================================================= */

/* --- Reset & Base --- */
.atc-sf-wrapper *,
.atc-sf-wrapper *::before,
.atc-sf-wrapper *::after {
	box-sizing: border-box;
}

.atc-sf-wrapper {
	width: 100%;
}

/* --- Form Card --- */
.atc-sf-form {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 36px 40px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 15px;
	color: #1e293b;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
	transition: box-shadow .2s ease;
	position: relative;
}

.atc-sf-form:focus-within {
	box-shadow: 0 8px 32px rgba(37, 99, 235, .12);
}

/* --- Fields --- */
.atc-sf-field {
	margin-bottom: 20px;
}

.atc-sf-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: .9em;
	letter-spacing: .01em;
}

.atc-sf-req {
	color: #ef4444;
	margin-left: 2px;
}

.atc-sf-form input[type="text"],
.atc-sf-form input[type="email"],
.atc-sf-form input[type="tel"],
.atc-sf-form select {
	width: 100%;
	padding: 12px 16px;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	font-size: 1em;
	color: inherit;
	background: #f8fafc;
	transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
}

.atc-sf-form input[type="text"]:focus,
.atc-sf-form input[type="email"]:focus,
.atc-sf-form input[type="tel"]:focus,
.atc-sf-form select:focus {
	border-color: #2563eb;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.atc-sf-form input[type="text"].atc-sf-invalid,
.atc-sf-form input[type="email"].atc-sf-invalid,
.atc-sf-form input[type="tel"].atc-sf-invalid,
.atc-sf-form select.atc-sf-invalid {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

/* --- Select arrow --- */
.atc-sf-form select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 40px;
	cursor: pointer;
}

/* --- Checkbox / GDPR --- */
.atc-sf-field--checkbox .atc-sf-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-weight: 500;
	font-size: .9em;
	margin-bottom: 0;
}

.atc-sf-field--checkbox input[type="checkbox"] {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	margin-top: 1px;
	cursor: pointer;
	border-radius: 4px;
}

/* --- Submit Button --- */
.atc-sf-field--submit {
	margin-top: 8px;
	margin-bottom: 0;
}

.atc-sf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 28px;
	background-color: #2563eb;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 1em;
	font-weight: 700;
	letter-spacing: .03em;
	cursor: pointer;
	transition: background-color .2s ease, transform .1s ease, box-shadow .2s ease;
	outline: none;
	position: relative;
}

.atc-sf-btn:hover {
	filter: brightness(1.1);
	box-shadow: 0 6px 20px rgba(37, 99, 235, .35);
	transform: translateY(-1px);
}

.atc-sf-btn:active {
	transform: translateY(0);
}

.atc-sf-btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .4);
}

.atc-sf-btn:disabled {
	opacity: .75;
	cursor: not-allowed;
	transform: none;
}

/* --- Loading spinner --- */
.atc-sf-btn-loading {
	display: none;
	animation: atc-spin 1s linear infinite;
}

.atc-sf-btn.is-loading .atc-sf-btn-text {
	display: none;
}

.atc-sf-btn.is-loading .atc-sf-btn-loading {
	display: inline-flex;
}

@keyframes atc-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

/* --- Response messages --- */
.atc-sf-response {
	margin-top: 16px;
	padding: 14px 18px;
	border-radius: 8px;
	font-size: .9em;
	font-weight: 600;
	display: none;
	animation: atc-fade-in .3s ease;
}

.atc-sf-response.is-success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
	display: block;
}

.atc-sf-response.is-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
	display: block;
}

@keyframes atc-fade-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* --- Honeypot --- */
.atc-sf-hp {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	opacity: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
}

/* --- Error fallback --- */
.atc-sf-error {
	color: #991b1b;
	font-style: italic;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 768px) {
	.atc-sf-form {
		padding: 24px 20px;
	}
}

@media (max-width: 480px) {
	.atc-sf-form {
		padding: 20px 16px;
		border-radius: 6px;
	}

	.atc-sf-btn {
		padding: 13px 20px;
	}
}

/* =========================================================
   Dark Mode
   ========================================================= */
@media (prefers-color-scheme: dark) {
	.atc-sf-form {
		background: #1e293b;
		border-color: #334155;
		color: #e2e8f0;
	}

	.atc-sf-form input[type="text"],
	.atc-sf-form input[type="email"],
	.atc-sf-form input[type="tel"],
	.atc-sf-form select {
		background: #0f172a;
		border-color: #334155;
		color: #e2e8f0;
	}

	.atc-sf-form input:focus,
	.atc-sf-form select:focus {
		background: #1e293b;
	}
}
