/* ============================================================
   Deal Modification Request and Deal Sign (participant-facing).
   Both pages render through pages/_participant_task.html, so each is one
   raised work surface: the template pads it top and bottom and the page
   pads its own content inline. Their outcomes sit in a focus column. Colour comes from the surface it sits on.
   Structure in @layer layout, paint in @layer design.
   ============================================================ */

@layer layout {
	:is(.deal-sign, .deal-modify) {
		padding-inline: var(--t-space-5);

		& p {
			margin: 0;
		}

		& header {
			display: grid;
			gap: var(--t-space-4);

			& > a[rel="prev"] {
				justify-self: start;
			}
		}

		& h2 {
			margin: 0;
			font-size: var(--t-font-size-lg);
		}

		& form {
			display: grid;
			gap: var(--t-space-5);
		}

		& .review-note {
			font-size: var(--t-font-size-sm);
			text-align: center;
		}

		/* A callout that also offers a way out holds the message and a link. */
		& .callout {
			display: grid;
			gap: var(--t-space-3);
			justify-items: start;
		}
	}

	.deal-sign .agreement-clauses {
		display: grid;
		gap: var(--t-space-3);

		& ul {
			display: grid;
			gap: var(--t-space-2);
			margin: 0;
			padding-inline-start: var(--t-space-5);
		}
	}

	.deal-modify {
		/* One reason per row on a recessed fill: radio, icon, label. The fill
		   is a visible edge, so the row is padded. */
		& .reason-list {
			display: grid;
			gap: var(--t-space-3);

			& .choice {
				padding: var(--t-space-3) var(--t-space-4);
				border-radius: var(--t-radius-md);
				font-weight: var(--t-font-weight-semibold);
			}

			& .choice span {
				display: inline-flex;
				align-items: center;
				gap: var(--t-space-3);
			}

			& svg {
				flex-shrink: 0;
				inline-size: 2rem;
				block-size: 2rem;
			}
		}

		& .modify-details label {
			display: flex;
			flex-wrap: wrap;
			align-items: baseline;
			gap: var(--t-space-2);
		}

		& .requirement {
			font-weight: normal;
		}
	}
}

@layer design {
	:is(.deal-sign, .deal-modify) :is(.intro, .review-note, .fallback) {
		color: var(--c-surface-text-color-muted);
	}

	.deal-modify .requirement {
		&.field-valid {
			color: var(--c-surface-text-color-muted);
		}

		&.field-required {
			color: var(--c-surface-text-color-error);
		}
	}

	/* The approval-text page (deal_approval_text.html) still uses this link. */
	.deal-modify__back { font-size: var(--mea-text-sm); font-weight: var(--mea-w-semibold);
	                     color: var(--t-link); text-decoration: none; cursor: pointer; }
	.deal-modify__back:hover { color: var(--t-link-hover); text-decoration: underline; }
}
