/*
 * GWClub shared frontend notice standard.
 *
 * Owner: GWClub Core.
 * Purpose: Provide one consistent visual language for persistent inline page notices.
 * Scope: Frontend/customer-facing shortcode and dashboard notices only.
 * Notes: Toasties remain owned by Form Builder. Field-level validation and modal-local
 * feedback stay local to their own components.
 */

:root {
	/* GWClub Core shortcode UI registry.
	 * Owner: GWClub Core.
	 * Purpose: Give plugin shortcodes one shared theme-aware visual baseline for
	 * typography, controls, tables, chips and small action buttons.
	 * Plugins should consume these tokens before adding plugin-specific styling.
	 */
	--gwclub-shortcode-font-family: var(--wp--preset--font-family--body, inherit);
	--gwclub-shortcode-font-size: var(--wp--preset--font-size--small, 14px);
	--gwclub-shortcode-line-height: 1.45;
	--gwclub-shortcode-label-size: var(--gwclub-shortcode-font-size);
	--gwclub-shortcode-label-weight: 700;
	--gwclub-shortcode-help-size: var(--gwclub-shortcode-font-size);
	--gwclub-shortcode-control-size: var(--gwclub-shortcode-font-size);
	--gwclub-shortcode-chip-size: 12px;
	--gwclub-shortcode-table-size: var(--gwclub-shortcode-font-size);
	--gwclub-shortcode-control-radius: 8px;
	--gwclub-shortcode-card-radius: 8px;
	--gwclub-shortcode-chip-radius: 999px;
	--gwclub-shortcode-control-pad-y: 8px;
	--gwclub-shortcode-control-pad-x: 10px;
	--gwclub-shortcode-cell-pad-y: 9px;
	--gwclub-shortcode-cell-pad-x: 11px;
	--gwclub-shortcode-text: var(--gwclub-text, var(--wp--preset--color--text, #1F2A24));
	--gwclub-shortcode-primary: var(--gwclub-primary, var(--wp--preset--color--primary));
	--gwclub-shortcode-primary-dark: var(--gwclub-primary-dark, var(--wp--preset--color--primary-dark, var(--gwclub-shortcode-primary)));
	--gwclub-shortcode-bg: var(--gwclub-bg, var(--wp--preset--color--background, #F6F6F4));
	--gwclub-shortcode-surface: var(--gwclub-surface, var(--wp--preset--color--surface, #FFFFFF));
	--gwclub-shortcode-border: var(--gwclub-border, var(--wp--preset--color--border, rgba(0,0,0,.14)));
	--gwclub-shortcode-soft-bg: color-mix(in srgb, var(--gwclub-shortcode-bg) 82%, var(--gwclub-shortcode-surface));
	--gwclub-shortcode-soft-border: color-mix(in srgb, var(--gwclub-shortcode-primary) 42%, var(--gwclub-shortcode-border));
	--gwclub-shortcode-row-hover-bg: color-mix(in srgb, var(--gwclub-shortcode-bg) 46%, var(--gwclub-shortcode-surface));
	--gwclub-shortcode-focus-outline: color-mix(in srgb, var(--gwclub-shortcode-primary) 70%, transparent);
	--gwclub-notice-green: #226035;
	--gwclub-notice-green-dark: #164624;
	--gwclub-notice-green-soft: #f0f7f2;
	--gwclub-notice-border: #bfd7c7;
	--gwclub-notice-text: #223127;
	--gwclub-notice-muted: #4b5b50;
	--gwclub-notice-warning: #8a4b18;
	--gwclub-notice-warning-bg: #fff7ed;
	--gwclub-notice-warning-border: #f2c48a;
	--gwclub-notice-error: #9f2d24;
	--gwclub-notice-error-bg: #fff1f0;
	--gwclub-notice-error-border: #e8aaa3;
}

.gwclub-shortcode-ui {
	box-sizing: border-box;
	width: 100%;
	/* Resolve colour tokens at the component level so active page/body presets win over root defaults. */
	--gwclub-shortcode-text: var(--gwclub-text, var(--wp--preset--color--text, #1F2A24));
	--gwclub-shortcode-primary: var(--gwclub-primary, var(--wp--preset--color--primary));
	--gwclub-shortcode-primary-dark: var(--gwclub-primary-dark, var(--wp--preset--color--primary-dark, var(--gwclub-shortcode-primary)));
	--gwclub-shortcode-bg: var(--gwclub-bg, var(--wp--preset--color--background, #F6F6F4));
	--gwclub-shortcode-surface: var(--gwclub-surface, var(--wp--preset--color--surface, #FFFFFF));
	--gwclub-shortcode-border: var(--gwclub-border, var(--wp--preset--color--border, rgba(0,0,0,.14)));
	--gwclub-shortcode-soft-bg: color-mix(in srgb, var(--gwclub-shortcode-bg) 82%, var(--gwclub-shortcode-surface));
	--gwclub-shortcode-soft-border: color-mix(in srgb, var(--gwclub-shortcode-primary) 42%, var(--gwclub-shortcode-border));
	--gwclub-shortcode-row-hover-bg: color-mix(in srgb, var(--gwclub-shortcode-bg) 46%, var(--gwclub-shortcode-surface));
	--gwclub-shortcode-focus-outline: color-mix(in srgb, var(--gwclub-shortcode-primary) 70%, transparent);

	font-family: var(--gwclub-shortcode-font-family);
	font-size: var(--gwclub-shortcode-font-size);
	line-height: var(--gwclub-shortcode-line-height);
	color: var(--gwclub-shortcode-text);
}

.gwclub-shortcode-ui *,
.gwclub-shortcode-ui *::before,
.gwclub-shortcode-ui *::after {
	box-sizing: border-box;
}

.gwclub-shortcode-control,
.gwclub-shortcode-ui select,
.gwclub-shortcode-ui input[type="text"],
.gwclub-shortcode-ui input[type="email"],
.gwclub-shortcode-ui input[type="search"],
.gwclub-shortcode-ui input[type="number"],
.gwclub-shortcode-ui input[type="date"] {
	border: 1px solid var(--gwclub-shortcode-border);
	border-radius: var(--gwclub-shortcode-control-radius);
	background: var(--gwclub-shortcode-surface);
	color: var(--gwclub-shortcode-text);
	font-family: inherit;
	font-size: var(--gwclub-shortcode-control-size);
	line-height: 1.35;
}

.gwclub-shortcode-ui select:focus,
.gwclub-shortcode-ui input:focus,
.gwclub-shortcode-ui textarea:focus {
	outline: 2px solid var(--gwclub-shortcode-focus-outline);
	outline-offset: 2px;
	border-color: var(--gwclub-shortcode-primary);
}

.gwclub-shortcode-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--gwclub-shortcode-surface);
	color: var(--gwclub-shortcode-text);
	font-size: var(--gwclub-shortcode-table-size);
	line-height: var(--gwclub-shortcode-line-height);
}

.gwclub-shortcode-table th,
.gwclub-shortcode-table td {
	padding: var(--gwclub-shortcode-cell-pad-y) var(--gwclub-shortcode-cell-pad-x);
	border-bottom: 1px solid var(--gwclub-shortcode-border);
	text-align: left;
	vertical-align: middle;
}

.gwclub-shortcode-table th {
	font-weight: 700;
	color: var(--gwclub-shortcode-primary);
	border-bottom-color: var(--gwclub-shortcode-primary);
	background: var(--gwclub-shortcode-soft-bg);
}

.gwclub-shortcode-chip {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--gwclub-shortcode-soft-border);
	border-radius: var(--gwclub-shortcode-chip-radius);
	padding: 2px 8px;
	font-size: var(--gwclub-shortcode-chip-size);
	line-height: 1.35;
	color: var(--gwclub-shortcode-primary-dark);
	background: var(--gwclub-shortcode-soft-bg);
}

.gwclub-shortcode-action-link {
	display: inline-block;
	padding: 6px 10px;
	border: 1px solid var(--gwclub-shortcode-primary);
	border-radius: 6px;
	background: var(--gwclub-shortcode-surface);
	color: var(--gwclub-shortcode-primary-dark);
	font-size: var(--gwclub-shortcode-font-size);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.gwclub-shortcode-action-link:hover,
.gwclub-shortcode-action-link:focus {
	background: var(--gwclub-shortcode-primary);
	border-color: var(--gwclub-shortcode-primary);
	color: var(--wp--preset--color--white, #FFFFFF);
	box-shadow: none;
}

.gwclub-notice,
.gwclub-competition-entry-page-notice,
.gwclub-competition-results-notice,
.gwclub-award-showcase-notice,
.gwclub-award-teaser-notice,
.gwclub-award-night-control-notice,
.gwclub-judge-competitions-notice,
.gwclub-judge-control-notice,
.gwclub-documents-notice,
.gwclub-document-preview-empty,
.gwclub-login-message,
.gwclub-member-register--notice,
.gwclub-committee-board--notice,
.gwclub-committee-board__notice,
.gwclub-dashboard-empty,
.gwclub-competition-results-empty,
.gwclub-competition-voting-empty,
.gwclub-judge-competitions-empty,
.gwclub-judge-control-empty,
.gwclub-judge-empty-state,
.gwclub-award-night-control__empty,
.gwclub-award-showcase--empty,
.gwclub-award-teaser--empty,
.gwclub-committee-board__empty,
.gwclub-my-awards-entries-notice,
.gwclub-my-awards-entries__empty,
.gwclub-qr-code-manager__empty,
.gwclub-history-empty {
	box-sizing: border-box;
	display: block;
	width: 100%;
	margin: 14px 0;
	padding: 14px 16px;
	border: 1px solid var(--gwclub-notice-border);
	border-left: 5px solid var(--gwclub-notice-green);
	border-radius: 10px;
	background: var(--gwclub-notice-green-soft);
	color: var(--gwclub-notice-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	text-align: left;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}


.gwclub-notice--center {
	text-align: center;
}

.gwclub-notice--center.gwclub-notice--empty {
	justify-content: center;
}

.gwclub-notice--success,
.gwclub-judge-control-notice--success,
.gwclub-login-success {
	border-color: var(--gwclub-notice-border);
	border-left-color: var(--gwclub-notice-green);
	background: var(--gwclub-notice-green-soft);
	color: var(--gwclub-notice-green-dark);
}

.gwclub-notice--warning,
.gwclub-documents-notice--warning,
.gwclub-competition-voting-test-notice,
.gwclub-judge-submit-warning {
	box-sizing: border-box;
	display: block;
	width: 100%;
	margin: 14px 0;
	padding: 14px 16px;
	border: 1px solid var(--gwclub-notice-warning-border);
	border-left: 5px solid var(--gwclub-notice-warning);
	border-radius: 10px;
	background: var(--gwclub-notice-warning-bg);
	color: var(--gwclub-notice-warning);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	text-align: left;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

.gwclub-notice--error,
.gwclub-documents-notice.is-error,
.gwclub-judge-control-notice--error,
.gwclub-login-error {
	border-color: var(--gwclub-notice-error-border);
	border-left-color: var(--gwclub-notice-error);
	background: var(--gwclub-notice-error-bg);
	color: var(--gwclub-notice-error);
}

.gwclub-notice--empty,
.gwclub-dashboard-empty,
.gwclub-competition-results-empty,
.gwclub-competition-voting-empty,
.gwclub-judge-competitions-empty,
.gwclub-judge-control-empty,
.gwclub-judge-empty-state,
.gwclub-award-night-control__empty,
.gwclub-award-showcase--empty,
.gwclub-award-teaser--empty,
.gwclub-committee-board__empty,
.gwclub-my-awards-entries__empty,
.gwclub-qr-code-manager__empty,
.gwclub-history-empty {
	border-left-color: var(--gwclub-notice-green);
	background: #f7faf8;
	color: var(--gwclub-notice-muted);
	font-weight: 600;
}

.gwclub-notice a,
.gwclub-competition-entry-page-notice a,
.gwclub-competition-results-notice a,
.gwclub-documents-notice a,
.gwclub-login-message a,
.gwclub-member-register--notice a,
.gwclub-committee-board--notice a,
.gwclub-committee-board__notice a {
	color: var(--gwclub-notice-green-dark);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (max-width: 700px) {
	.gwclub-notice,
	.gwclub-competition-entry-page-notice,
	.gwclub-competition-results-notice,
	.gwclub-award-showcase-notice,
	.gwclub-award-teaser-notice,
	.gwclub-award-night-control-notice,
	.gwclub-judge-competitions-notice,
	.gwclub-judge-control-notice,
	.gwclub-documents-notice,
	.gwclub-document-preview-empty,
	.gwclub-login-message,
	.gwclub-member-register--notice,
	.gwclub-committee-board--notice,
	.gwclub-committee-board__notice,
	.gwclub-dashboard-empty,
	.gwclub-competition-results-empty,
	.gwclub-competition-voting-empty,
	.gwclub-judge-competitions-empty,
	.gwclub-judge-control-empty,
	.gwclub-judge-empty-state,
	.gwclub-award-night-control__empty,
	.gwclub-award-showcase--empty,
	.gwclub-award-teaser--empty,
	.gwclub-committee-board__empty,
	.gwclub-my-awards-entries-notice,
	.gwclub-my-awards-entries__empty,
	.gwclub-qr-code-manager__empty,
	.gwclub-history-empty {
		padding: 13px 14px;
		font-size: 14px;
	}
}

/* Public document empty state: keep visible and centred on desktop and mobile. */
.gwclub-documents-empty-state.gwclub-notice {
	display: block !important;
	width: 100%;
	text-align: center;
}

@media (max-width: 700px) {
	.gwclub-documents-empty-state.gwclub-notice {
		display: block !important;
		margin: 12px 0;
		text-align: center;
	}
}


/* GWClub shared frontend confirmation modal.
 * Owner: GWClub Core.
 * Purpose: Replace customer-facing browser confirm prompts with one branded suite modal.
 */
.gwclub-confirm {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(16, 30, 22, 0.48);
	box-sizing: border-box;
}

.gwclub-confirm__dialog {
	box-sizing: border-box;
	width: min(560px, 100%);
	padding: 26px 28px 24px;
	border: 2px solid #226035;
	border-radius: 12px;
	background: #ffffff;
	box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22), inset 0 0 0 3px rgba(34, 96, 53, 0.12);
	color: #1f2933;
	outline: none;
}

.gwclub-confirm__dialog--warning {
	border-color: #8a4b18;
	box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22), inset 0 0 0 3px rgba(138, 75, 24, 0.12);
}

.gwclub-confirm__dialog--danger {
	border-color: #9f2d24;
	box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22), inset 0 0 0 3px rgba(159, 45, 36, 0.12);
}

.gwclub-confirm__title {
	margin: 0 0 12px;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.2;
	color: #1f2933;
}

.gwclub-confirm__message {
	margin: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.55;
	color: #344054;
}

.gwclub-confirm__actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	align-items: center;
	margin-top: 24px;
}

.gwclub-confirm__button {
	box-sizing: border-box;
	min-width: 130px;
	padding: 12px 18px;
	border: 2px solid #226035;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.01em;
	cursor: pointer;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.gwclub-confirm__button--cancel {
	background: #ffffff;
	color: #226035;
}

.gwclub-confirm__button--confirm,
.gwclub-confirm__button--standard {
	background: #226035;
	color: #ffffff;
}

.gwclub-confirm__button--warning {
	border-color: #8a4b18;
	background: #8a4b18;
	color: #ffffff;
}

.gwclub-confirm__button--danger {
	border-color: #9f2d24;
	background: #9f2d24;
	color: #ffffff;
}

.gwclub-confirm__button:focus,
.gwclub-confirm__button:hover {
	filter: brightness(0.96);
	outline: 2px solid rgba(34, 96, 53, 0.3);
	outline-offset: 2px;
}

@media (max-width: 700px) {
	.gwclub-confirm {
		align-items: flex-start;
		padding: 72px 16px 18px;
	}

	.gwclub-confirm__dialog {
		padding: 22px 20px 20px;
	}

	.gwclub-confirm__title {
		font-size: 23px;
	}

	.gwclub-confirm__actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.gwclub-confirm__button {
		width: 100%;
	}
}

/*
 * GWClub shared inline back-link standard.
 * Owner: GWClub Core.
 * Purpose: Keep return links visually consistent across nested workspaces.
 */
.gwclub-inline-back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0 0 1rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gwclub-notice-green, #226035);
	font-size: 0.98rem;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
}

.gwclub-inline-back-link:hover,
.gwclub-inline-back-link:focus {
	color: var(--gwclub-notice-green-dark, #164624);
	text-decoration: underline;
	outline: none;
}


/*
 * GWClub Session Guard toast standard.
 * Owner: GWClub Core.
 * Purpose: Replace raw WordPress/session/security errors with clear club-facing feedback.
 */
.gwclub-session-guard-toast-layer {
	position: fixed;
	left: 50%;
	top: 24px;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	width: min(94vw, 860px);
	transform: translateX(-50%);
	pointer-events: none;
}

.gwclub-session-guard-toast {
	box-sizing: border-box;
	width: 100%;
	max-width: 860px;
	padding: 18px 28px;
	border: 4px solid rgba(0,0,0,0.22);
	outline: 2px solid rgba(255,255,255,0.88);
	outline-offset: -8px;
	background: var(--gwclub-notice-error, #9f2d24);
	box-shadow: 0 12px 34px rgba(0,0,0,0.24);
	color: #fff;
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.45;
	text-align: center;
	text-transform: none;
	opacity: 0;
	transform: translateY(-8px) scale(0.98);
	transition: opacity 0.22s ease, transform 0.22s ease;
	pointer-events: auto;
	cursor: pointer;
}

.gwclub-session-guard-toast.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.gwclub-session-guard-toast--stale_page,
.gwclub-session-guard-toast--network_error {
	background: var(--gwclub-notice-warning, #8a4b18);
}

@media (max-width: 640px) {
	.gwclub-session-guard-toast-layer {
		top: 12px;
		width: calc(100vw - 24px);
	}

	.gwclub-session-guard-toast {
		padding: 16px 18px;
		font-size: 14px;
	}
}
