/**
 * Captain-edit surfaces — component styles (AC-112).
 *
 * Plugin-owned so the modal, request-link forms and buttons don't depend on the
 * theme (the current theme is slated for replacement; the plugin outlives it).
 * Colours use theme.json preset tokens (orange = brand
 * var(--wp--preset--color--ic-orange) = #FF6D00); preset vars are always present
 * on the front end via WordPress global styles, so no theme CSS dependency.
 *
 * Extracted from inline styles previously living in captain-edit.php:
 *   - the wp_footer modal <style> block (this file, below)
 *   - inline button style= attrs        → unified to .btn.invictus-orange-bg in the theme (AC-114)
 *   - JS STYLE_OK/STYLE_ERR cssText      → .ic-alert component (AC-112 commit 2)
 */

/*
 * Request-link modal.
 *
 * The #icCaptainLinkModal scoping + !important are deliberate: style.min.css
 * styles a global ".modal" for an image-lightbox gallery (header absolute, body
 * unpadded), which otherwise hijacks this Bootstrap modal. Scoping every rule to
 * the id and forcing it beats the gallery without touching the theme. The proper
 * fix (de-scoping the gallery's .modal grab) is out of scope — the theme is being
 * replaced.
 */
#icCaptainLinkModal .modal-content {
	background-color: var(--wp--preset--color--ic-bg-medium) !important;
	color: var(--wp--preset--color--ic-text-primary);
	border: 1px solid #3a3b3d; /* divider grey — no preset equivalent */
	border-radius: 8px;
	font-family: inherit;
}
#icCaptainLinkModal .modal-header {
	position: static !important;
	background: transparent;
	border-bottom: 1px solid #3a3b3d;
	padding: 1.25rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
#icCaptainLinkModal .modal-title {
	color: var(--wp--preset--color--ic-orange);
	text-transform: uppercase;
	font-weight: 700;
	font-size: 1.1rem;
	letter-spacing: 0.02em;
	margin: 0;
	line-height: 1.2;
}
#icCaptainLinkModal .btn-close {
	margin: 0 !important;
	/* The theme paints .btn-close with an orange background-color; with the
	 * white-ing filter below that yields a white square + an invisible white X.
	 * Clear it so only Bootstrap's X shows, filtered white on the dark modal. */
	background-color: transparent !important;
	opacity: 0.7;
	filter: brightness(0) invert(1);
}
#icCaptainLinkModal .btn-close:hover { opacity: 1; }
#icCaptainLinkModal .modal-body {
	padding: 1.5rem !important;
}
#icCaptainLinkModal .modal-body > p {
	color: var(--wp--preset--color--ic-text-muted);
	margin-bottom: 1.25rem;
	line-height: 1.5;
}
#icCaptainLinkModal .form-label {
	color: var(--wp--preset--color--ic-text-primary);
	font-weight: 600;
	margin-bottom: 0.5rem;
}
#icCaptainLinkModal .modal-footer {
	border-top: 1px solid #3a3b3d;
	padding: 1rem 1.5rem;
}

/*
 * Inline status messages for the AJAX request-link forms (modal + expired-link
 * prefill). Same .ic-alert component the server-rendered edit-page alerts use;
 * plugin-owned here so these surfaces don't depend on the theme. The JS toggles
 * the modifier class instead of writing inline cssText. Success/error greens and
 * reds have no preset equivalent — semantic one-offs kept as literals.
 */
.ic-alert {
	padding: .85rem 1rem;
	border: 1px solid transparent;
	border-radius: 6px;
	font-weight: 600;
	margin-top: 1rem;
}
.ic-alert--success { background: #1c3a1c; color: #c8f7c8; border-color: #3a7a3a; }
.ic-alert--error   { background: #5b1a1a; color: #ffdada; border-color: #a33; }

/* Expired-link prefill form (locked /uredi-hipodrom/ state). */
.ic-captain-link-form { max-width: 420px; }

/*
 * Link-sent state — once the e-mail is on its way, collapse the form to just the
 * confirmation message (.ic-alert stays). Added to the form on success by the JS.
 */
.ic-link-sent label,
.ic-link-sent input,
.ic-link-sent button,
.ic-link-sent .modal-body > p,
.ic-link-sent .modal-footer { display: none; }
