/* checkout.css — matches the stanfordgsbhk.org (Avada) look: cardinal-red page,
   centered white card, Inter font. Replaces prereg.css for the /n checkout flow.
   Mobile-first form layout: fields wrap via flexbox instead of a wide table,
   so the form never needs horizontal scrolling on a phone. */

:root {
	--gsb-red: #8C1515;
	--gsb-red-dark: #6f1010;
	--gsb-text: #141617;
	--gsb-border: #cccccc;
	--gsb-alert: #c0392b;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background-color: var(--gsb-red);
	color: var(--gsb-text);
	font-family: Inter, Arial, Helvetica, sans-serif;
	font-size: 14px;
	overflow-x: hidden;
}

a, a:visited {
	color: var(--gsb-red);
	text-decoration: underline;
}
a:hover { color: var(--gsb-red-dark); }

/* Top bar */
.checkout-topbar {
	background: #ffffff;
	border-bottom: 1px solid #eee;
}
.checkout-topbar-inner {
	max-width: 1000px;
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
}
.checkout-logo { height: 48px; width: auto; display: block; }
.checkout-logo-link { line-height: 0; }
.checkout-nav a {
	margin-left: 20px;
	color: var(--gsb-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
}
.checkout-nav a:first-child { margin-left: 0; }
.checkout-nav a:hover { color: var(--gsb-red); }

/* Page / card */
.checkout-page {
	padding: 32px 16px 56px;
	display: flex;
	justify-content: center;
}
.checkout-card {
	background: #ffffff;
	width: 100%;
	max-width: 960px;
	padding: 28px 32px 36px;
	border-radius: 8px;
	box-shadow: 0 2px 18px rgba(0,0,0,0.18);
	overflow-x: hidden;
}

/* Footer */
.checkout-footer {
	background: var(--gsb-text);
	color: #eeeeee;
}
.checkout-footer-inner {
	max-width: 1000px;
	margin: 0 auto;
	padding: 18px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 12px;
}
.checkout-footer-link { color: #eeeeee; }
.checkout-footer-link:hover { color: #ffffff; }

/* Headings / status */
p.headLine {
	padding-top: 0;
	margin-top: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--gsb-red);
}
#remarkDiv {
	color: var(--gsb-alert);
	background-color: #fdf0e5;
	padding: 8px 12px;
	border-radius: 4px;
}
#remarkDiv:empty { display: none; }

hr {
	border: none;
	border-top: 1px solid #e5e5e5;
	margin: 18px 0;
}

/* Form elements */
input[type=text], select {
	font-family: inherit;
	font-size: 13px;
	padding: 8px;
	border: 1px solid var(--gsb-border);
	border-radius: 4px;
	background: #fff;
	color: var(--gsb-text);
	max-width: 100%;
}
input[type=button], input[type=submit] {
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 20px;
	border: none;
	border-radius: 5px;
	background: var(--gsb-red);
	color: #ffffff;
	cursor: pointer;
}
input[type=button]:hover, input[type=submit]:hover { background: var(--gsb-red-dark); }

/* validation state classes toggled by existing JS - keep class names, restyle colors */
.alertBox { border-color: var(--gsb-alert) !important; background: #fff5f5; }
.normalBox { border-color: var(--gsb-border); }

/* Explicit "this field is required" text, shown under a field only while its
   input/select carries .alertBox (set by the existing validate*() functions).
   Adjacent-sibling selector, not :has(), so it works in every browser. */
.fieldError {
	display: none;
	color: var(--gsb-alert);
	font-size: 12px;
	font-weight: 600;
	margin-top: 2px;
}
.alertBox + .fieldError {
	display: block;
}

/* Field grid: used both for static sections (folkDiv/guestDiv) and the
   JS-generated seat/guest details (makeRows()). Fields wrap onto their own
   line whenever there isn't room for the next one side-by-side, so nothing
   ever has to scroll horizontally to be filled in - on a phone every field
   just stacks to full width automatically. */
.fieldGrid {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 10px 0;
}
.field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 180px;
	min-width: 0;
}
.field label {
	font-size: 12px;
	font-weight: 600;
	color: #666;
}
.fieldHint {
	font-weight: 400;
	font-style: italic;
	color: #888;
	display: block;
	font-size: 11px;
}
.guestLabel {
	font-weight: 700;
	color: var(--gsb-red);
	margin: 16px 0 0;
}

/* Read-only summary table (built by submitPreReg()) - the only remaining
   <table> in the flow. Kept as a simple 2-column table on wider screens. */
table { border-collapse: collapse; max-width: 100%; }
table td, table th { padding: 3px 8px 3px 0; }

/* Mobile: force every field / table row onto its own line so the form can
   always be completed without scrolling left or right. */
@media (max-width: 640px) {
	.checkout-page { padding: 16px 10px 40px; }
	.checkout-card { padding: 18px 16px 26px; border-radius: 6px; }
	.checkout-topbar-inner { padding: 10px 14px; }
	.checkout-logo { height: 36px; }
	.checkout-nav a { margin-left: 12px; font-size: 12px; }
	p.headLine { font-size: 17px; }

	.field { flex-basis: 100%; }
	input[type=text], select { font-size: 16px; } /* 16px avoids iOS auto-zoom on focus */

	input[type=button], input[type=submit] {
		display: block;
		width: 100%;
		margin: 8px 0;
	}

	table td, table th {
		display: block;
		width: 100% !important;
	}
	table tr {
		display: block;
		margin-bottom: 8px;
	}
}
