/**
 * Secure Step Mailer — Public Subscription Form Styles
 *
 * Responsive, clean, theme-agnostic design.
 * All selectors are scoped under .ssm-subscribe-form-wrapper
 * to avoid collisions with theme styles.
 */

/* =========================================================================
   Box Model Reset
   ========================================================================= */

.ssm-subscribe-form-wrapper *,
.ssm-subscribe-form-wrapper *::before,
.ssm-subscribe-form-wrapper *::after {
	box-sizing: border-box;
}

/* =========================================================================
   Wrapper / Container
   ========================================================================= */

.ssm-subscribe-form-wrapper {
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	color: #1d2327;
}

/* =========================================================================
   Stage Layout
   ========================================================================= */

.ssm-subscribe-form {
	width: 100%;
}

.ssm-stage[hidden] {
	display: none !important;
}

.ssm-stage-card {
	padding: 24px;
	background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
	border: 1px solid #d0d7de;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.ssm-stage-title {
	margin: 0 0 12px;
	font-size: 1.35rem;
	line-height: 1.4;
}

.ssm-stage-text {
	margin: 0 0 18px;
	color: #3c434a;
}

/* =========================================================================
   Field Wrapper
   ========================================================================= */

.ssm-field {
	margin-bottom: 16px;
}

.ssm-field:last-child {
	margin-bottom: 0;
}

/* =========================================================================
   Labels
   ========================================================================= */

.ssm-field label,
.ssm-consent-label {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	color: #1d2327;
	margin-bottom: 6px;
	cursor: default;
}

.ssm-required {
	color: #d63638;
	margin-left: 3px;
	font-weight: 700;
}

/* =========================================================================
   Text / Email Inputs
   ========================================================================= */

.ssm-field input[type="email"],
.ssm-field input[type="text"] {
	display: block;
	width: 100%;
	padding: 10px 14px;
	font-size: 1rem;
	font-family: inherit;
	color: #1d2327;
	background-color: #fff;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	line-height: 1.5;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ssm-field input[type="email"]:focus,
.ssm-field input[type="text"]:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.2);
	outline: none;
}

.ssm-field input[type="email"]::placeholder,
.ssm-field input[type="text"]::placeholder {
	color: #a7aaad;
}

/* =========================================================================
   Consent Checkbox Field
   ========================================================================= */

.ssm-consent-field {
	margin-bottom: 18px;
}

.ssm-consent-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-weight: 400;
	font-size: 0.88rem;
	color: #3c434a;
	cursor: pointer;
	line-height: 1.5;
}

.ssm-consent-label input[type="checkbox"] {
	flex-shrink: 0;
	margin-top: 3px;
	width: 16px;
	height: 16px;
	accent-color: #2271b1;
	cursor: pointer;
}

.ssm-consent-text a {
	color: #2271b1;
	text-decoration: underline;
}

.ssm-consent-text a:hover {
	color: #135e96;
}

/* =========================================================================
   Honeypot Field — Must remain visually hidden
   ========================================================================= */

.ssm-hp {
	display: none !important;
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	visibility: hidden !important;
}

/* =========================================================================
   Actions / Buttons
   ========================================================================= */

.ssm-submit-field {
	margin-top: 20px;
}

.ssm-submit-btn,
.ssm-primary-btn,
.ssm-secondary-btn {
	display: inline-block;
	padding: 12px 24px;
	font-size: 1rem;
	font-family: inherit;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease,
		box-shadow 0.2s ease, border-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ssm-submit-btn,
.ssm-primary-btn {
	color: #fff;
	background-color: #2271b1;
	border: none;
}

.ssm-submit-btn {
	width: 100%;
}

.ssm-submit-btn:hover,
.ssm-primary-btn:hover {
	background-color: #135e96;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.ssm-submit-btn:focus,
.ssm-primary-btn:focus,
.ssm-secondary-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.35);
}

.ssm-submit-btn:active,
.ssm-primary-btn:active,
.ssm-secondary-btn:active {
	transform: translateY(1px);
	box-shadow: none;
}

.ssm-submit-btn:disabled,
.ssm-primary-btn:disabled,
.ssm-secondary-btn:disabled {
	background-color: #a7aaad;
	border-color: #a7aaad;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.ssm-secondary-btn {
	color: #1d2327;
	background-color: #fff;
	border: 1px solid #8c8f94;
}

.ssm-secondary-btn:hover {
	background-color: #f6f7f7;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.ssm-action-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.ssm-action-row > * {
	flex: 1 1 220px;
}

/* =========================================================================
   Confirmation / Completion
   ========================================================================= */

.ssm-confirm-summary {
	margin: 0 0 20px;
	padding: 0;
	border-top: 1px solid #dcdcde;
	border-bottom: 1px solid #dcdcde;
}

.ssm-confirm-row {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 12px;
	padding: 14px 0;
	align-items: start;
}

.ssm-confirm-row + .ssm-confirm-row {
	border-top: 1px solid #ebecee;
}

.ssm-confirm-row dt {
	font-weight: 700;
	color: #1d2327;
}

.ssm-confirm-row dd {
	margin: 0;
	word-break: break-word;
}

.ssm-complete-card {
	text-align: center;
}

.ssm-complete-message {
	margin: 0 0 12px;
	font-size: 1.1rem;
	font-weight: 700;
	color: #1a4d23;
}

.ssm-close-tab-note {
	margin: 16px 0 0;
	font-size: 0.88rem;
	color: #646970;
}

/* =========================================================================
   Response / Feedback Message Area
   ========================================================================= */

.ssm-response {
	display: block;
	width: 100%;
	margin-bottom: 16px;
	padding: 0;
	font-size: 0.9rem;
	line-height: 1.5;
	border-radius: 4px;
	min-height: 0;
}

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

.ssm-response.ssm-success {
	padding: 12px 16px;
	background-color: #edfaef;
	border: 1px solid #8bd49a;
	border-left: 4px solid #00a32a;
	color: #1a4d23;
}

.ssm-response.ssm-error {
	padding: 12px 16px;
	background-color: #fdf2f2;
	border: 1px solid #f5a3a4;
	border-left: 4px solid #d63638;
	color: #5c1a1c;
}

.ssm-response:not(.ssm-success):not(.ssm-error):not(:empty) {
	padding: 10px 14px;
	background-color: #f6f7f7;
	border: 1px solid #c3c4c7;
	color: #646970;
}

/* =========================================================================
   Responsive Layout
   ========================================================================= */

@media screen and (max-width: 480px) {
	.ssm-subscribe-form-wrapper {
		font-size: 0.95rem;
	}

	.ssm-field input[type="email"],
	.ssm-field input[type="text"] {
		font-size: 0.95rem;
		padding: 9px 12px;
	}

	.ssm-submit-btn,
	.ssm-primary-btn,
	.ssm-secondary-btn {
		font-size: 0.95rem;
		padding: 11px 20px;
	}

	.ssm-stage-card {
		padding: 20px;
	}

	.ssm-confirm-row {
		grid-template-columns: 1fr;
		gap: 4px;
	}
}

/* =========================================================================
   High Contrast / Accessibility
   ========================================================================= */

@media (prefers-contrast: high) {
	.ssm-field input[type="email"],
	.ssm-field input[type="text"] {
		border-color: #1d2327;
		border-width: 2px;
	}

	.ssm-submit-btn,
	.ssm-primary-btn,
	.ssm-secondary-btn {
		border-width: 2px;
	}

	.ssm-response.ssm-success,
	.ssm-response.ssm-error {
		border-width: 2px;
	}
}

/* =========================================================================
   Reduced Motion
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
	.ssm-field input[type="email"],
	.ssm-field input[type="text"],
	.ssm-submit-btn,
	.ssm-primary-btn,
	.ssm-secondary-btn {
		transition: none;
	}
}
