/*
 * Soccer Academy Calgary UA — form components.
 *
 * One stylesheet for every form the academy owns: the admin login today, the registration
 * request form and the admin CRM screens later. The tokens mirror the Elementor kit, so a
 * form looks like the rest of the site without importing Elementor's CSS.
 *
 * Markup contract:
 *
 *   <div class="sac-card">
 *     <div class="sac-card__head">
 *       <h1 class="sac-card__title">Title</h1>
 *       <p class="sac-card__sub">Optional subtitle</p>
 *     </div>
 *     <form class="sac-form">
 *       <p class="sac-notice sac-notice--error">Something went wrong</p>
 *       <div class="sac-field">
 *         <label class="sac-label" for="x">Label</label>
 *         <input class="sac-input" id="x">
 *         <span class="sac-help">Helper text</span>
 *       </div>
 *       <label class="sac-check"><input type="checkbox"> Remember me</label>
 *       <button class="sac-btn sac-btn--primary">Submit</button>
 *     </form>
 *   </div>
 */

:root {
	--sac-red: #c8102e;
	--sac-red-dark: #8a0c22;
	--sac-dark: #121212;
	--sac-ink: #121212;
	--sac-muted: #5a5a5a;
	--sac-line: #dcdcde;
	--sac-bg: #f6f6f6;
	--sac-radius: 10px;
	--sac-head: "Titillium Web", "Segoe UI", system-ui, sans-serif;
	--sac-body: "Roboto", -apple-system, "Segoe UI", system-ui, sans-serif;
}

/* ---------------------------------------------------------------- card */

.sac-card {
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: var(--sac-radius);
	padding: 40px 38px 36px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}

.sac-card__head {
	margin-bottom: 26px;
}

.sac-card__title {
	margin: 0 0 6px;
	font-family: var(--sac-head);
	font-weight: 700;
	font-size: 26px;
	line-height: 1.2;
	letter-spacing: -0.5px;
	color: var(--sac-ink);
}

.sac-card__sub {
	margin: 0;
	font-family: var(--sac-body);
	font-size: 14px;
	line-height: 1.6;
	color: var(--sac-muted);
}

/* The red rule under a heading, same as the section dividers on the site. */
.sac-card__head::after {
	content: "";
	display: block;
	width: 54px;
	height: 3px;
	margin-top: 18px;
	background: var(--sac-red);
}

/* ---------------------------------------------------------------- fields */

.sac-form {
	font-family: var(--sac-body);
}

.sac-field {
	margin-bottom: 20px;
}

.sac-label {
	display: block;
	margin-bottom: 8px;
	font-family: var(--sac-body);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--sac-ink);
}

.sac-label .sac-label__required {
	color: var(--sac-red);
	margin-left: 2px;
}

.sac-input,
.sac-select,
.sac-textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 13px 15px;
	font-family: var(--sac-body);
	font-size: 15px;
	line-height: 1.4;
	color: var(--sac-ink);
	background: #fff;
	border: 1px solid var(--sac-line);
	border-radius: 4px;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sac-textarea {
	min-height: 120px;
	resize: vertical;
}

.sac-input:focus,
.sac-select:focus,
.sac-textarea:focus {
	outline: none;
	border-color: var(--sac-red);
	box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.14);
}

.sac-input[aria-invalid="true"],
.sac-field--error .sac-input {
	border-color: var(--sac-red);
}

.sac-help {
	display: block;
	margin-top: 7px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--sac-muted);
}

.sac-check {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: var(--sac-muted);
	cursor: pointer;
}

.sac-check input[type="checkbox"] {
	width: 17px;
	height: 17px;
	margin: 0;
	accent-color: var(--sac-red);
	flex: none;
}

/* ---------------------------------------------------------------- buttons */

.sac-btn {
	display: inline-block;
	padding: 15px 34px;
	font-family: var(--sac-body);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	text-decoration: none;
	text-align: center;
	border: 2px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sac-btn--primary {
	background: var(--sac-red);
	border-color: var(--sac-red);
	color: #fff;
}

.sac-btn--primary:hover,
.sac-btn--primary:focus {
	background: var(--sac-red-dark);
	border-color: var(--sac-red-dark);
	color: #fff;
}

.sac-btn--ghost {
	background: transparent;
	border-color: var(--sac-ink);
	color: var(--sac-ink);
}

.sac-btn--ghost:hover,
.sac-btn--ghost:focus {
	background: var(--sac-ink);
	color: #fff;
}

/*
 * Not the full width of the form. On a wide registration card a 100%-wide button is a red bar
 * the length of the page, which reads as a banner rather than something to press — and it
 * sits directly under Cloudflare's 300px widget, so the mismatch is visible. It matches that
 * widget's width now and centres with it, and still stretches on a narrow screen where full
 * width is the right answer.
 */
.sac-btn--block {
	display: block;
	width: 100%;
	max-width: 300px;
	margin-left: auto;
	margin-right: auto;
	/* The width is fixed, so the generous side padding a free-standing button needs only
	   squeezes the label onto two lines. */
	padding-left: 16px;
	padding-right: 16px;
}

/* ---------------------------------------------------------------- notices */

.sac-notice {
	margin: 0 0 20px;
	padding: 13px 16px;
	font-family: var(--sac-body);
	font-size: 14px;
	line-height: 1.5;
	border-radius: 4px;
	border-left: 3px solid var(--sac-line);
	background: var(--sac-bg);
	color: var(--sac-ink);
}

.sac-notice--error {
	border-left-color: var(--sac-red);
	background: #fdf2f4;
}

.sac-notice--ok {
	border-left-color: #2f8f4e;
	background: #f1f8f3;
}

/* ---------------------------------------------------------------- registration request */

.sac-form .sac-reg__section {
	margin: 30px 0 14px;
	font-family: var(--sac-head);
	font-weight: 700;
	font-size: 22px;
	letter-spacing: -0.3px;
	color: var(--sac-ink);
	border-bottom: 1px solid var(--sac-line);
	padding-bottom: 8px;
}

.sac-reg__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 22px;
}

@media (max-width: 640px) {
	.sac-reg__grid {
		grid-template-columns: 1fr;
	}
}

.sac-reg__dob {
	display: grid;
	grid-template-columns: 2fr 1fr 1.2fr;
	gap: 10px;
}

.sac-reg__program {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	margin-bottom: 10px;
	border: 1px solid var(--sac-line);
	border-left: 4px solid var(--sac-line);
	border-radius: 8px;
	font-weight: 500;
}

/* Checked state leaves the left edge alone: that stripe is the programme's own colour and
   means the same thing here as the coloured chips do in the admin. */
.sac-reg__program:has(input:checked) {
	border-top-color: var(--sac-red);
	border-right-color: var(--sac-red);
	border-bottom-color: var(--sac-red);
	background: #fdf5f6;
}

.sac-reg__camp-closed {
	margin: 0 0 10px;
	padding: 12px 14px;
	border: 1px dashed var(--sac-line);
	border-radius: 8px;
	color: var(--sac-muted);
	font-size: 14px;
	line-height: 1.6;
}

.sac-reg__privacy {
	margin: 22px 0 10px;
	font-size: 13.5px;
	line-height: 1.65;
	color: var(--sac-muted);
}

.sac-reg .cf-turnstile {
	margin: 16px 0;
}

/* Honeypot: visually gone, still in the DOM for bots to find. */
.sac-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Registration-form polish: one control height everywhere, native select chrome replaced
   so Month/Day/Year stop clipping, and the choice rows read as one line. */

.sac-form .sac-input,
.sac-form .sac-select {
	height: 48px;
	padding: 0 15px;
}

.sac-form .sac-select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 38px;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="none" stroke="%235a5a5a" stroke-width="2" d="M1 1l5 5 5-5"/></svg>');
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
}

.sac-form .sac-textarea {
	height: auto;
	padding: 13px 15px;
}

.sac-reg__dob .sac-select {
	min-width: 0;
}

.sac-check input[type="radio"] {
	width: 17px;
	height: 17px;
	margin: 0;
	accent-color: var(--sac-red);
	flex: none;
}

/* Yes / No side by side, sized like the inputs they sit between. */
.sac-reg__choices {
	display: flex;
	gap: 26px;
	align-items: center;
	height: 48px;
}

.sac-reg__choices .sac-check {
	font-size: 15px;
	color: var(--sac-ink);
}

/* The accuracy confirmation reads as a small framed statement, not a floating line. */
.sac-reg__confirm {
	align-items: flex-start;
	margin: 14px 0 4px;
	padding: 14px 16px;
	border: 1px solid var(--sac-line);
	border-radius: 8px;
	background: var(--sac-bg);
	color: var(--sac-ink);
	font-size: 14px;
	line-height: 1.6;
}

.sac-reg__confirm input[type="checkbox"] {
	margin-top: 2px;
}

/* The theme uppercases labels inside page content; choice text is a sentence, not a
   heading, so it opts out. */
.sac-form .sac-check,
.sac-form .sac-check span:not(.sac-label__required) {
	text-transform: none;
	letter-spacing: 0;
}

.sac-form .sac-reg__program {
	font-size: 15px;
	color: var(--sac-ink);
}

/* ---------------------------------------------------------------- parent cabinet */

.sac-cabinet .sac-card {
	margin-bottom: 22px;
}

.sac-cabinet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}

.sac-cabinet__head .sac-cabinet__aside {
	margin: 0;
}

.sac-cabinet__note {
	margin: -8px 0 18px;
	color: var(--sac-muted);
	font-size: 15px;
}

.sac-cabinet__aside {
	margin-top: 18px;
	font-size: 14px;
	color: var(--sac-muted);
}

.sac-player__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.sac-player__name {
	margin: 0 0 2px;
	font-family: var(--sac-head);
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.4px;
	color: var(--sac-ink);
}

.sac-player__sub {
	margin: 22px 0 12px;
	font-family: var(--sac-head);
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--sac-muted);
}

/* Status pill: neutral by default, green once the family is fully registered. */
.sac-status {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 20px;
	background: var(--sac-bg);
	border: 1px solid var(--sac-line);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	color: var(--sac-ink);
}

.sac-status--registered {
	background: #eaf6ec;
	border-color: #bfe0c6;
	color: #1c6b2c;
}

.sac-status--declined {
	background: #fdf0f2;
	border-color: #f0c4cc;
	color: var(--sac-red-dark, #8a0c22);
}

/* The four workflow states, side by side on desktop and stacked on a phone. */
.sac-steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	margin-bottom: 6px;
}

@media (max-width: 640px) {
	.sac-steps {
		grid-template-columns: repeat(2, 1fr);
	}
}

.sac-steps__item {
	padding: 12px 14px;
	border: 1px solid var(--sac-line);
	border-radius: 8px;
	background: var(--sac-bg);
}

.sac-steps__label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--sac-muted);
	margin-bottom: 4px;
}

.sac-steps__value {
	font-size: 15px;
	font-weight: 600;
	color: var(--sac-ink);
}

.sac-program-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	margin-bottom: 10px;
	border: 1px solid var(--sac-line);
	border-radius: 8px;
}

.sac-program-row__name {
	font-weight: 600;
	color: var(--sac-ink);
}

.sac-program-row__state,
.sac-program-row form {
	margin-left: auto;
}

.sac-program-row__state {
	font-size: 14px;
	color: var(--sac-muted);
	text-align: right;
}

.sac-program-row .sac-btn {
	padding: 9px 18px;
	font-size: 13px;
}

.sac-btn--outline {
	background: transparent;
	color: var(--sac-red);
	border-color: var(--sac-red);
}

.sac-btn--small {
	padding: 9px 18px;
	font-size: 14px;
}

.sac-btn--outline:hover {
	background: var(--sac-red);
	color: #fff;
}

.sac-details {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 14px;
	border: 1px solid var(--sac-line);
	border-radius: 10px;
	overflow: hidden;
}

.sac-details td {
	/* Room on both sides: the value column used to sit flush against the card's edge. */
	padding: 12px 18px;
	border-bottom: 1px solid var(--sac-line);
	font-size: 15px;
	vertical-align: top;
}

.sac-details tr:last-child td {
	border-bottom: 0;
}

.sac-details td:first-child {
	width: 190px;
	color: var(--sac-muted);
	background: var(--sac-bg);
}

/* Signing invitation inside the family cabinet. */
.sac-sign {
	margin: 18px 0 6px;
	padding: 16px 18px;
	background: var(--sac-bg);
	border-left: 3px solid var(--sac-red);
	border-radius: 8px;
}
.sac-sign--done {
	border-left-color: #00a32a;
	color: var(--sac-muted);
	font-size: 15px;
}
.sac-sign .sac-player__sub { margin-top: 0; }

/* Signed-in parents landing on the public registration page. */
.sac-reg__known {
	border-left: 3px solid var(--sac-red);
}
.sac-reg__choices {
	margin: 10px 0 18px;
	padding-left: 20px;
	color: var(--sac-muted);
	font-size: 15px;
	line-height: 1.6;
}
.sac-reg__choices strong { color: var(--sac-ink); }

/* ---------------------------------------------------------------- sign-in screens */

/* A sign-in form is two fields; at full card width it reads as a wall. */
.sac-auth {
	/* A cap, not a width: on a narrow phone the card must still fit the screen. */
	max-width: 460px;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
}

/* Cloudflare's widget is a fixed-width block, so it has to be centred by its container. */
.sac-form .cf-turnstile,
.sac-reg .cf-turnstile {
	display: flex;
	justify-content: center;
	margin: 18px 0;
}

.sac-cabinet__aside--stack {
	margin-top: 20px;
	text-align: center;
	line-height: 1.7;
}
.sac-cabinet__aside--stack p {
	margin: 0 0 4px;
}

/*
 * The theme paints its own colours onto <button> and <a>, and it wins on specificity in
 * places we do not control — most visibly in the cabinet, where "Request to join" came out
 * as red text on a red button, readable only on hover. Naming the element as well as the
 * class was not enough, so these four declarations are marked important: they are the leaf
 * of the cascade, a button's own label, and nothing downstream should be overriding them.
 */
a.sac-btn,
button.sac-btn,
input.sac-btn {
	text-decoration: none !important;
}

a.sac-btn--primary,
button.sac-btn--primary,
input.sac-btn--primary,
a.sac-btn--primary:hover,
button.sac-btn--primary:hover,
a.sac-btn--primary:focus,
button.sac-btn--primary:focus {
	color: #fff !important;
	background: var(--sac-red);
	border-color: var(--sac-red);
}

a.sac-btn--primary:hover,
button.sac-btn--primary:hover,
a.sac-btn--primary:focus,
button.sac-btn--primary:focus {
	background: var(--sac-red-dark);
	border-color: var(--sac-red-dark);
}

a.sac-btn--outline,
button.sac-btn--outline {
	color: var(--sac-red) !important;
	background: transparent;
}

a.sac-btn--outline:hover,
button.sac-btn--outline:hover,
a.sac-btn--outline:focus,
button.sac-btn--outline:focus {
	color: #fff !important;
	background: var(--sac-red);
}

/*
 * Form footers: the confirmation and the buttons were touching each other, and the two
 * buttons had nothing between them. A row with its own gap keeps them apart on a wide
 * screen and stacks them on a narrow one.
 */
.sac-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
	margin-top: 22px;
}
.sac-form .sac-check + .sac-actions {
	margin-top: 26px;
}
.sac-form .sac-check {
	margin: 18px 0 0;
	align-items: flex-start;
	line-height: 1.5;
}

/* A link styled as a button is still a link to the theme, which underlines it. */
a.sac-btn,
a.sac-btn:hover,
a.sac-btn:focus {
	text-decoration: none;
}
a.sac-btn--outline,
button.sac-btn--outline {
	color: var(--sac-red);
}
a.sac-btn--outline:hover,
a.sac-btn--outline:focus,
button.sac-btn--outline:hover,
button.sac-btn--outline:focus {
	background: var(--sac-red);
	color: #fff;
}
