/*
 * payment-responsive.css
 * Makes the individual payment page (views/pay.php) fit tablets and narrow desktop windows,
 * and lays out the Discount Code row (field, ?, Submit and its message) like the other Card rows.
 * Loaded ONLY by views/pay.php, and only for the desktop/tablet layout (not isPhone, which
 * already gets phone.css + phone-payment.css). Loaded last so it can override computer2015.css
 * and payment.css without editing those shared files.
 * To undo: remove the <link> line for this file in views/pay.php.
 * Created 10/28/2026. Updated 11/04/2026, 11/11/2026.
 */

/* Nothing in the form should push the page sideways */
#paymentform img,
#Payment-Info-Container img { max-width: 100%; height: auto; }

/* Readable line height for labels: payment.css gives form rows line-height 0, so a label that
   wraps ("Last Name:", "Card Number:") would draw its two lines on top of each other. (11/04/2026) */
.paymentform-paymentmethod-fieldset div div div.row > label,
.paymentform-acctinfo-fieldset div div.row > label { line-height: 1.25; }

/* ---------- all desktop / tablet widths: side-by-side layout, each row on one line ----------
   Card labels in an even column, Billing fields straight after their label,
   Last Name + Country on one line, City + State + Zip on one line.
   Labels never wrap; in a narrower window the text boxes shrink a little instead, so labels
   do not split over two lines and fields stay in line.
   (Phones do not load this file; they use phone-payment.css.) (11/04/2026) */
@media only screen {
	.paymentform-paymentmethod-fieldset div div div.row,
	.paymentform-acctinfo-fieldset div div.row {
		display: flex !important;   /* payment.css switches some rows to inline-block on narrow screens */
		flex-wrap: nowrap !important;
		align-items: center;
		line-height: normal;
	}
	/* a little space between the side-by-side columns */
	.paymentform-paymentmethod-fieldset div.upper div.col1,
	.paymentform-acctinfo-fieldset div.col1 { box-sizing: border-box; padding-right: 10px; }
	.paymentform-paymentmethod-fieldset div div div.row > label[for],
	.paymentform-acctinfo-fieldset div div.row > label[for] {
		display: inline-block !important;
		white-space: nowrap;
		flex: 0 0 auto;
		float: none !important;
		margin: 0 .35em 0 0 !important;
	}
	/* Card column: labels in an even column, wide enough for the longest label */
	.paymentform-paymentmethod-fieldset div div div.row > label.col1 { width: 7.6em !important; }

	/* text boxes keep their usual size but may shrink rather than push the row over */
	.paymentform-paymentmethod-fieldset div div div.row > span,
	.paymentform-acctinfo-fieldset div div.row > span { flex: 0 1 auto; min-width: 0; }
	.paymentform-paymentmethod-fieldset div div div.row > span fieldset { min-width: 0; max-width: 100%; }
	.paymentform-paymentmethod-fieldset div div div.row span input,
	.paymentform-acctinfo-fieldset div div.row span input { max-width: 100%; box-sizing: border-box; min-width: 4em; }
	/* the long boxes take what room the column has, up to their usual size */
	.paymentform-paymentmethod-fieldset div div div.row > span.x_card_num,
	.paymentform-paymentmethod-fieldset div div div.row > span.x_address,
	.paymentform-paymentmethod-fieldset div div div.row > span.s_address,
	.paymentform-acctinfo-fieldset div div.row > span { flex: 1 1 auto; }
	.paymentform-paymentmethod-fieldset div div div.row > span.x_card_num fieldset,
	.paymentform-paymentmethod-fieldset div div div.row > span.x_address fieldset,
	.paymentform-paymentmethod-fieldset div div div.row > span.s_address fieldset,
	.paymentform-acctinfo-fieldset div div.row > span fieldset { width: 100%; margin: 0; }
	.paymentform-paymentmethod-fieldset div.upper div.col1 div.row span input#x_card_num { width: 100% !important; max-width: 15em; }
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row span input#x_address,
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row span input#s_address { width: 100% !important; }
	.paymentform-acctinfo-fieldset div div.row span input#x_email_address,
	.paymentform-acctinfo-fieldset div div.row span input#x_email_address2,
	.paymentform-acctinfo-fieldset div div.row span input#password,
	.paymentform-acctinfo-fieldset div div.row span input#password2 { width: 100% !important; max-width: 17em; }
	/* First Name and Last Name boxes the same width */
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row span input#x_first_name,
	.paymentform-paymentmethod-fieldset div.lower div.col2 div.row span input#s_first_name { width: 9em !important; max-width: 100%; }
	/* City and Last Name boxes fill their space; Last Name shrinks a little if needed so Country still fits
	   (City's size is set in the Billing rows block below) */
	.paymentform-paymentmethod-fieldset div div div.row > span.x_city fieldset,
	.paymentform-paymentmethod-fieldset div div div.row > span.s_city fieldset { width: 100%; }
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row span input#x_city,
	.paymentform-paymentmethod-fieldset div.lower div.col2 div.row span input#s_city { width: 100% !important; }
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row span input#x_last_name,
	.paymentform-paymentmethod-fieldset div.lower div.col2 div.row span input#s_last_name { width: 100% !important; max-width: 9em; }
	.paymentform-paymentmethod-fieldset div.upper div.col1 div.row.adc-row { margin-bottom: 1.4em; }

	/* Last Name + Country and City + State + Zip stay on one line */
	.paymentform-paymentmethod-fieldset div div div.row span.lastname_country { flex-wrap: nowrap; align-items: center; min-width: 0; }
	.paymentform-paymentmethod-fieldset div div div.row span.lastname_country fieldset { flex: 0 0 9em; min-width: 0; }   /* same width as First Name */
	.paymentform-paymentmethod-fieldset div div div.row span.lastname_country select { flex: 0 1 auto; min-width: 6em; max-width: 100%; }
	#usfields, #nonusfields, #s_usfields, #s_nonusfields { flex-wrap: nowrap; align-items: center; height: auto !important; min-width: 0; }
	#usfields label[for], #nonusfields label[for], #s_usfields label[for], #s_nonusfields label[for] { margin: 0 .3em 0 0 !important; white-space: nowrap; }
	/* Billing rows: Country right after Last Name, State right after City, and the
	   City / State / Zip line ends exactly where the Street Address box ends.
	   Each Billing row is capped at the same width; Street Address and City stretch to fill it. (11/04/2026) */
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row,
	.paymentform-paymentmethod-fieldset div.lower div.col2 div.row { max-width: 26em; clear: both; }   /* rows are floated in payment.css */
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row span input#x_address,
	.paymentform-paymentmethod-fieldset div.lower div.col2 div.row span input#s_address { max-width: none; }
	.paymentform-paymentmethod-fieldset div div div.row span.lastname_country { gap: 0; }
	/* Country dropdown the same height as State and the text boxes (payment.css sets 1.7em) */
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row select#x_country,
	.paymentform-paymentmethod-fieldset div.lower div.col2 div.row select#s_country { height: 28px !important; box-sizing: border-box; }
	.paymentform-paymentmethod-fieldset div div div.row span.lastname_country fieldset { margin: 0 .3em 0 0 !important; }
	.paymentform-paymentmethod-fieldset div div div.row > span.x_city,
	.paymentform-paymentmethod-fieldset div div div.row > span.s_city { flex: 1 1 auto; margin-right: .3em; }
	.paymentform-paymentmethod-fieldset div div div.row > span.x_city fieldset,
	.paymentform-paymentmethod-fieldset div div div.row > span.s_city fieldset { margin: 0 !important; }
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row span input#x_city,
	.paymentform-paymentmethod-fieldset div.lower div.col2 div.row span input#s_city { max-width: none; }
	#usfields, #nonusfields, #s_usfields, #s_nonusfields { flex: 0 0 auto; margin: 0; }
	#usfields select, #s_usfields select { margin-right: .3em !important; }

	/* Discount Code row: same as the other Card rows (label in the label column, then field, ?, Submit).
	   "Invalid Code" / "Too many attempts. Try again later." sit to the right of Submit on one line (11/17/2026) */
	.paymentform-paymentmethod-fieldset div div div.row.adc-row { display: flex !important; align-items: center; flex-wrap: nowrap; }
	.paymentform-paymentmethod-fieldset div div div.row.adc-row > .adc-label { width: 7.6em !important; margin: 0 .35em 0 0 !important; white-space: nowrap; flex: 0 0 auto; }
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code #adcInvalid { position: static; flex: none; align-self: center; white-space: nowrap; margin: 0 0 0 4px; }
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code { flex: 1 1 auto; width: auto !important; }
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code fieldset { flex: 1 1 15em !important; min-width: 8em !important; max-width: 15em; }   /* no wider than the Card Number box (11/17/2026; was 17em) */
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code { gap: 4px; row-gap: 6px; flex-wrap: wrap !important; }   /* message drops below when there is no room beside Submit (11/17/2026) */
	/* ? sits like the Security Code ?: 8px from the box, level with its top edge, never over Submit */
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code { align-items: flex-start !important; }
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code #adcHelp {
		margin: 0 0 0 4px; flex: 0 0 auto; display: block; line-height: normal; position: relative; height: auto; }
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code #adcHelp img { display: block; }
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code .adc-submit { margin-left: 4px; }
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code .adc-submit { padding: 0 8px; }
	/* Lockout (.adc-locked): "Too many attempts. Try again later." is on one line to the right of Submit,
	   like "Invalid Code". The code box keeps its normal size (11/17/2026; was a wrapped line 11/11/2026). */
}

/* ---------- over 1000px: Card and Billing side by side ----------
   The Discount Code row is the last Card row and sits below the Billing rows, so it may use the empty
   space under Billing. "Invalid Code" / "Too many attempts. Try again later." then stay on Submit's line;
   on narrower screens they drop below Submit when there is no room. (11/17/2026) */
@media only screen and (min-width: 1001px) {
	.paymentform-paymentmethod-fieldset div.upper div.col1 div.row.adc-row { width: 200% !important; max-width: none; }
	/* ...but the code box stays the same width as the Card Number box (the Card column is half this row) */
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code fieldset {
		flex: 0 0 auto !important; width: calc(50% - 3.975em) !important; max-width: 15em !important; min-width: 6em !important; }
	/* the message never wraps under Submit here: there is always room to its right in the payment box */
	.paymentform-paymentmethod-fieldset div div div.row.adc-row span.adc_code { flex-wrap: nowrap !important; }
}

/* ---------- up to 1000px: fluid page instead of a fixed 975px ---------- */
@media only screen and (max-width: 1000px) {
	/* Card / Billing (and Email / Password) stack here, so each keeps its label and fields on one
	   line rather than squeezing two columns side by side (11/04/2026) */
	.paymentform-paymentmethod-fieldset div.upper div.col1,
	.paymentform-paymentmethod-fieldset div.upper div.col2,
	.paymentform-acctinfo-fieldset div.col1,
	.paymentform-acctinfo-fieldset div.col2 {
		display: block !important;
		float: none !important;
		width: 100% !important;
		box-sizing: border-box;
		padding-right: 0;
	}
	.paymentform-paymentmethod-fieldset div.upper div.col2 { margin-top: 1em; }
	body { margin: 10px 8px; }
	#page { width: auto; max-width: 975px; }
	.header .toplinks { width: auto; float: none; }
	.header .searchbar_hldr { width: auto; }

	.LeftCol { width: calc(100% - 197px); }
	.LeftCol-Inner { width: 100%; float: none; box-sizing: border-box; display: flow-root; }  /* contain the floated seals */
	.RightCol { width: 182px; }
	.RightCol img { max-width: 100%; height: auto; }

	/* footer rows were sized for 975px */
	.footerholder, .footer_inside { width: auto !important; max-width: 100%; }
	.copyright-holder { width: auto !important; float: none !important; position: static !important; text-align: center; }
}

/* ---------- up to 820px: one column, right-column images move below the form ---------- */
@media only screen and (max-width: 820px) {
	#main { padding: 10px; }
	.LeftCol, .RightCol { float: none; width: auto; }
	.RightCol { clear: both; width: 100%; box-sizing: border-box; }
	.RightCol { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
	.RightCol > * { flex: 0 1 auto; }
	.RightCol img { max-width: 180px; }
	/* header: title, then logo centred below it (otherwise the logo floats into the blue area) */
	.header { display: flow-root; height: auto !important; }
	.header .toplinks { text-align: center; }
	.header .searchbar_hldr { position: static !important; float: none !important; width: auto; text-align: center; margin: 6px 0 4px; }
	#main { clear: both; }
}

/* ---------- up to 741px: payment.css hides the field labels here (meant for phones).
   On a narrow desktop/tablet window there are no placeholders, so the labels stay
   visible (rules in the 1000px block above) and the Card / Billing columns stack. ---------- */
@media only screen and (max-width: 741px) {
	.paymentform-paymentmethod-fieldset div.upper div.col1,
	.paymentform-paymentmethod-fieldset div.upper div.col2,
	.paymentform-acctinfo-fieldset div.col1,
	.paymentform-acctinfo-fieldset div.col2 {
		display: block !important;
		width: 100% !important;
		box-sizing: border-box;
	}
	.paymentform-paymentmethod-fieldset div.upper div.col2 { margin-top: 1em; }
	.paymentform-paymentmethod-fieldset > table { margin: 5px 0 !important; }
	/* payment.css hides labels at this width; keep Zip / Postal visible beside their box */
	#usfields label[for], #nonusfields label[for], #s_usfields label[for], #s_nonusfields label[for] {
		display: inline-block !important; margin: 0 4px 0 2px !important; }

	/* product list: smaller price text so long product names fit */
	#ExamProductsList td span[style*="font-size"] { font-size: 17px !important; }
}

/* ---------- up to 480px ---------- */
@media only screen and (max-width: 480px) {
	/* no room for label + field on one line: label above, field below */
	.paymentform-paymentmethod-fieldset div div div.row,
	.paymentform-acctinfo-fieldset div div.row { flex-wrap: wrap !important; row-gap: 2px; }
	.paymentform-paymentmethod-fieldset div div div.row > label[for],
	.paymentform-acctinfo-fieldset div div.row > label[for],
	.paymentform-paymentmethod-fieldset div div div.row.adc-row > .adc-label { flex: 0 0 100% !important; width: auto !important; }
	.paymentform-paymentmethod-fieldset div div div.row.adc-row { flex-wrap: wrap !important; }
	#main { padding: 6px; border-radius: 6px 6px 0 0; }
	.LeftCol-Inner { padding: 8px; }
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row span input#x_last_name,
	.paymentform-paymentmethod-fieldset div.upper div.col2 div.row span input#x_city { width: 10em !important; }
	.purchasesmall { font-size: 22px; }

	.paymentform-paymentmethod-fieldset div div div.row > span,
	.paymentform-acctinfo-fieldset div div.row > span { max-width: 100%; }
}
