/**
 * Auspian Forms public frontend styles.
 *
 * Keep public styles scoped with the atf- prefix so theme CSS conflicts remain
 * predictable and easy to debug. Phase 08 submits single-step inline forms
 * through AJAX and uses these message/loading states.
 */

.atf-form-shell {
	/* The shortcode wrapper should fit inside any theme content area. */
	box-sizing: border-box;
	max-width: 100%;
	position: relative;
}

.atf-form,
.atf-form *,
.atf-form *::before,
.atf-form *::after {
	/* Keep plugin form controls predictable even when a theme uses different box sizing. */
	box-sizing: border-box;
}

.atf-form-messages {
	/* JS makes this visible after submit, validation, or security responses. */
	display: none;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border: 1px solid #9ec5fe;
	border-radius: 0.375rem;
	background: #e7f1ff;
	color: #052c65;
}

.atf-form-messages--visible {
	display: block;
}

.atf-form-messages[data-atf-message-type="success"] {
	border-color: #a3cfbb;
	background: #d1e7dd;
	color: #0a3622;
}

.atf-form-messages[data-atf-message-type="error"] {
	border-color: #f1aeb5;
	background: #f8d7da;
	color: #58151c;
}

.atf-form--submitting {
	/* Applied while FormData is waiting for admin-ajax.php. */
	opacity: 0.78;
}

.atf-form--submitting [type="submit"],
.atf-form--submitting [data-atf-submit] {
	cursor: progress;
}

.atf-form-message {
	margin: 1rem 0;
	padding: 0.75rem 1rem;
	border-radius: 0.375rem;
}

.atf-form-message--unavailable {
	border: 1px solid #f1aeb5;
	background: #f8d7da;
	color: #58151c;
}

.atf-honeypot {
	/* Bot trap field: hidden from layout but still present in the submitted form. */
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
}

.atf-form-body {
	max-width: 100%;
}

.atf-form-overlay-loader {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.85);
	z-index: 999;
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	backdrop-filter: blur(2px);
	border-radius: inherit;
}

.atf-form-shell.is-busy .atf-form-overlay-loader {
	display: flex;
}

.atf-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid #e2e8f0;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: atf-spin 1s linear infinite;
	margin-bottom: 15px;
}

.atf-spinner-text {
	font-size: 1rem;
	color: #334155;
	font-weight: 500;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

.atf-step-nav {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

/* Phase 12 Popup Styles */
.atf-popup-open {
	overflow: hidden;
}

.atf-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.atf-popup[aria-hidden="false"] {
	display: flex !important;
}

.atf-popup-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.65);
	cursor: pointer;
}

.atf-popup-window {
	position: relative;
	background: #fff;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	margin: 20px;
	z-index: 1;
	animation: atf-fade-in 0.3s ease-out;
}

.atf-popup-position-right_drawer {
	position: absolute;
	right: 0;
	top: 0;
	height: 100vh;
	max-height: 100vh;
	margin: 0;
	border-radius: 0;
	animation: atf-slide-in-right 0.3s ease-out;
}

.atf-popup-position-left_drawer {
	position: absolute;
	left: 0;
	top: 0;
	height: 100vh;
	max-height: 100vh;
	margin: 0;
	border-radius: 0;
	animation: atf-slide-in-left 0.3s ease-out;
}

.atf-popup-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 1.5rem;
	border-bottom: 1px solid #eee;
}

.atf-popup-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
}

.atf-popup-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	color: #666;
}

.atf-popup-close:hover {
	color: #000;
}

.atf-popup-content {
	padding: 1.5rem;
}

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

@keyframes atf-slide-in-right {
	from { opacity: 0; transform: translateX(100%); }
	to { opacity: 1; transform: translateX(0); }
}

@keyframes atf-slide-in-left {
	from { opacity: 0; transform: translateX(-100%); }
	to { opacity: 1; transform: translateX(0); }
}

/* --- Frontend Toast Notifications --- */
.atf-toast-container {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 999999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
}

.atf-toast {
	background: #fff;
	color: #334155;
	padding: 16px 20px;
	border-radius: 8px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
	border-left: 4px solid #3b82f6;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-width: 300px;
	max-width: 400px;
	animation: atf-slide-up 0.3s ease-out;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
}

.atf-toast[data-atf-toast-type="success"] {
	border-left-color: #10b981;
}

.atf-toast[data-atf-toast-type="error"] {
	border-left-color: #ef4444;
}

.atf-toast[data-atf-toast-type="info"] {
	border-left-color: #3b82f6;
}

.atf-toast-close {
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 0;
	font-size: 18px;
	line-height: 1;
}

.atf-toast-close:hover {
	color: #475569;
}

.atf-toast-fade-out {
	animation: atf-fade-out 0.3s ease-in forwards;
}

@keyframes atf-slide-up {
	from { transform: translateY(100%); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

@keyframes atf-fade-out {
	from { transform: translateY(0); opacity: 1; }
	to { transform: translateY(10px); opacity: 0; }
}

/* --- Inline Validation Styles --- */
.atf-field-error {
	display: block;
	width: 100%;
	margin-top: -0.5rem;
	margin-bottom: 1rem;
	font-size: 0.875rem;
	color: #dc2626;
	animation: atf-fade-in 0.2s ease-out;
}

.atf-field-invalid {
	border-color: #dc2626 !important;
}

.atf-field-invalid:focus {
	box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
}

/* --- Premium Default Theme (.atformdef) --- */
.atformdef {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #334155;
	max-width: 600px;
	margin: 0 auto;
}

.atformdef input[type="text"],
.atformdef input[type="email"],
.atformdef input[type="tel"],
.atformdef input[type="number"],
.atformdef input[type="password"],
.atformdef input[type="url"],
.atformdef textarea,
.atformdef select {
	width: 100%;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	border: 1px solid #cbd5e1;
	border-radius: 0.375rem;
	font-size: 1rem;
	color: #0f172a;
	background-color: #fff;
	transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

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

.atformdef button[type="submit"],
.atformdef [data-atf-submit],
.atformdef [data-atf-next],
.atformdef [data-atf-prev] {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	font-weight: 500;
	color: #fff;
	background-color: #2563eb;
	border: 1px solid transparent;
	border-radius: 0.375rem;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out, transform 0.1s ease-in-out;
}

.atformdef button[type="submit"]:hover,
.atformdef [data-atf-submit]:hover,
.atformdef [data-atf-next]:hover,
.atformdef [data-atf-prev]:hover {
	background-color: #1d4ed8;
}

.atformdef button:disabled,
.atformdef input[type="submit"]:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

/* Custom css */

.atform.enquiry-form .enquiry-form-inner { background:#f7f9fc; padding:18px; border-radius:6px; }
.atform.enquiry-form button[data-atf-submit] { background:#1e73be; color:#fff; padding:8px 14px; border-radius:4px; border:none; }

