/**
 * CCSA Auth — registration and login form styles.
 *
 * @package CCSA
 */

/* ------------------------------------------------
   Reset & base
   ------------------------------------------------ */
.ccsa-auth-form *,
.ccsa-auth-form *::before,
.ccsa-auth-form *::after {
	box-sizing: border-box;
}

.ccsa-auth-form {
	max-width: 580px;
	margin: 2rem auto;
	padding: 2rem;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	color: #333;
	line-height: 1.5;
}

.ccsa-auth-form h2 {
	margin: 0 0 1.5rem;
	font-size: 1.5rem;
	color: #003366;
}

/* ------------------------------------------------
   Field groups
   ------------------------------------------------ */
.ccsa-field-group {
	margin-bottom: 1.25rem;
}

.ccsa-field-group label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	font-size: 0.9375rem;
	color: #333;
}

.ccsa-field-group .ccsa-required {
	color: #c0392b;
	margin-left: 0.15em;
}

/* ------------------------------------------------
   Inputs
   ------------------------------------------------ */
.ccsa-input {
	display: block;
	width: 100%;
	padding: 0.625rem 0.875rem;
	font-size: 0.9375rem;
	line-height: 1.4;
	color: #333;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ccsa-input:focus {
	outline: none;
	border-color: #003366;
	box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.15);
}

.ccsa-input:disabled {
	background: #f5f5f5;
	cursor: not-allowed;
}

/* Select elements */
select.ccsa-input {
	appearance: auto;
}

/* ------------------------------------------------
   Checkbox group
   ------------------------------------------------ */
.ccsa-checkbox-group {
	margin-bottom: 1.25rem;
}

.ccsa-checkbox-group label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.9375rem;
	cursor: pointer;
	line-height: 1.4;
}

.ccsa-checkbox-group input[type="checkbox"] {
	margin-top: 0.2rem;
	flex-shrink: 0;
}

/* ------------------------------------------------
   Password requirements
   ------------------------------------------------ */
.ccsa-password-requirements {
	margin-top: 0.5rem;
	padding: 0.75rem 1rem;
	background: #f9f9f9;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	font-size: 0.8125rem;
	color: #666;
}

.ccsa-password-requirements ul {
	margin: 0.25rem 0 0;
	padding-left: 1.25rem;
	list-style: disc;
}

.ccsa-password-requirements li {
	margin-bottom: 0.15rem;
}

.ccsa-password-requirements li.ccsa-req-met {
	color: #27ae60;
}

.ccsa-password-requirements li.ccsa-req-unmet {
	color: #999;
}

/* ------------------------------------------------
   Submit button
   ------------------------------------------------ */
.ccsa-submit-btn {
	display: block;
	width: 100%;
	padding: 0.75rem 1.5rem;
	margin-top: 1.5rem;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: #003366;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	text-align: center;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.ccsa-submit-btn:hover,
.ccsa-submit-btn:focus {
	background: #002244;
}

.ccsa-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ------------------------------------------------
   Messages
   ------------------------------------------------ */
.ccsa-message {
	padding: 0.875rem 1.25rem;
	margin-bottom: 1.25rem;
	border-radius: 4px;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.ccsa-message:empty {
	display: none;
}

.ccsa-message--error {
	background: #fdf2f2;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

.ccsa-message--success {
	background: #eafaf1;
	border: 1px solid #c3e6cb;
	color: #155724;
}

/* ------------------------------------------------
   Helper text
   ------------------------------------------------ */
.ccsa-auth-form .ccsa-form-help {
	margin: 0.35rem 0 0;
	font-size: 0.8125rem;
	color: #888;
}

/* ------------------------------------------------
   Links
   ------------------------------------------------ */
.ccsa-auth-form a {
	color: #003366;
}

.ccsa-auth-form a:hover {
	color: #002244;
}

/* ------------------------------------------------
   Fieldset & legend (registration form compat)
   ------------------------------------------------ */
.ccsa-auth-form fieldset {
	border: none;
	padding: 0;
	margin: 0 0 1.5rem;
}

.ccsa-auth-form legend {
	font-size: 1.125rem;
	font-weight: 600;
	color: #003366;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #eee;
	width: 100%;
}

/* ------------------------------------------------
   Consent blocks (Terms & POPIA text above checkboxes)
   ------------------------------------------------ */
.ccsa-consent-block {
	margin-bottom: 1.25rem;
	padding: 1rem 1.25rem;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	max-height: 200px;
	overflow-y: auto;
	font-size: 0.8125rem;
	line-height: 1.6;
	color: #475569;
}

.ccsa-consent-block__content h1,
.ccsa-consent-block__content h2,
.ccsa-consent-block__content h3 {
	font-size: 1rem;
	margin: 0.75rem 0 0.5rem;
	color: #1e293b;
}

.ccsa-consent-block__content h1:first-child,
.ccsa-consent-block__content h2:first-child,
.ccsa-consent-block__content h3:first-child {
	margin-top: 0;
}

.ccsa-consent-block__content p {
	margin: 0 0 0.5rem;
}

.ccsa-consent-block__content ul,
.ccsa-consent-block__content ol {
	padding-left: 1.25rem;
	margin: 0.5rem 0;
}

.ccsa-consent-block__content a {
	color: #003366;
}

.ccsa-consent-checkboxes {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #e2e8f0;
}

/* ------------------------------------------------
   Custom checkboxes (no native webkit styling)
   ------------------------------------------------ */
.ccsa-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	font-size: 0.9375rem;
	line-height: 1.4;
	padding: 10px 0;
}

.ccsa-checkbox input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.ccsa-checkbox__box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	min-width: 22px;
	border: 2px solid #cbd5e1;
	border-radius: 4px;
	background: #fff;
	transition: all 0.15s ease;
	margin-top: 1px;
}

.ccsa-checkbox__box::after {
	content: '';
	display: block;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg) scale(0);
	transition: transform 0.15s ease;
}

.ccsa-checkbox input[type="checkbox"]:checked + .ccsa-checkbox__box {
	background: #003366;
	border-color: #003366;
}

.ccsa-checkbox input[type="checkbox"]:checked + .ccsa-checkbox__box::after {
	transform: rotate(45deg) scale(1);
}

.ccsa-checkbox input[type="checkbox"]:focus-visible + .ccsa-checkbox__box {
	box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.2);
}

.ccsa-checkbox__label {
	flex: 1;
	font-weight: 700;
	color: #1e293b;
}

.ccsa-checkbox__label .ccsa-required {
	color: #b91c1c;
	font-weight: 600;
}

/* ------------------------------------------------
   Login form
   ------------------------------------------------ */
.ccsa-login {
	max-width: 480px;
	margin: 2rem auto;
	padding: 2rem;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	color: #333;
	line-height: 1.5;
}

.ccsa-login *,
.ccsa-login *::before,
.ccsa-login *::after {
	box-sizing: border-box;
}

.ccsa-login__title {
	margin: 0 0 1.5rem;
	font-size: 1.5rem;
	color: #003366;
}

.ccsa-login__subtitle {
	margin: -0.75rem 0 1.25rem;
	font-size: 0.9375rem;
	color: #666;
}

.ccsa-login .ccsa-form-row {
	margin-bottom: 1.25rem;
}

.ccsa-login .ccsa-form-label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	font-size: 0.9375rem;
	color: #333;
}

.ccsa-login .ccsa-form-input,
.ccsa-login input[type="email"],
.ccsa-login input[type="password"] {
	display: block;
	width: 100%;
	padding: 0.625rem 0.875rem;
	font-size: 0.9375rem;
	line-height: 1.4;
	color: #333;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ccsa-login .ccsa-form-input:focus,
.ccsa-login input[type="email"]:focus,
.ccsa-login input[type="password"]:focus {
	outline: none;
	border-color: #003366;
	box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.15);
}

.ccsa-login .ccsa-form-help {
	margin: 0.35rem 0 0;
	font-size: 0.8125rem;
	color: #888;
}

.ccsa-login .ccsa-form-row--submit {
	margin-top: 1.5rem;
}

.ccsa-login .ccsa-btn--primary {
	display: block;
	width: 100%;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: #003366;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	text-align: center;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.ccsa-login .ccsa-btn--primary:hover,
.ccsa-login .ccsa-btn--primary:focus {
	background: #002244;
}

.ccsa-login .ccsa-btn--primary:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.ccsa-login .ccsa-form-row--checkbox {
	margin-bottom: 0.5rem;
}

.ccsa-login__links {
	margin-top: 1rem;
	text-align: center;
}

.ccsa-login__link {
	color: #003366;
	font-size: 0.9375rem;
	text-decoration: none;
}

.ccsa-login__link:hover {
	color: #002244;
	text-decoration: underline;
}

.ccsa-login .ccsa-notice {
	padding: 0.875rem 1.25rem;
	margin-bottom: 1.25rem;
	border-radius: 4px;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.ccsa-login .ccsa-notice p {
	margin: 0;
}

.ccsa-login .ccsa-notice--success {
	background: #eafaf1;
	border: 1px solid #c3e6cb;
	color: #155724;
}

.ccsa-login .ccsa-notice--error {
	background: #fdf2f2;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

.ccsa-login .ccsa-notice--info {
	background: #e8f0fe;
	border: 1px solid #b6d4fe;
	color: #084298;
}

.ccsa-login .ccsa-messages:empty {
	display: none;
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */
@media (max-width: 600px) {
	.ccsa-auth-form {
		margin: 1rem;
		padding: 1.25rem;
	}

	.ccsa-login {
		margin: 1rem;
		padding: 1.25rem;
	}
}
