/* Termaneh registration, payment and receipt pages. Builds on catalog.css tokens
   (--accent, --stamp, --paper, --rule, --muted); fields use a ruled line instead of a box. */
.trm-reg { max-width: 760px; margin-inline: auto; }
.trm-reg :is(h2, h3, ul, ol, table, fieldset, legend, p) { margin: 0; }
.trm-reg-loading { padding: 2em 0; color: var(--muted); }
.trm-reg-institute { color: var(--muted); font-size: .9em; margin-bottom: .4em; }
.trm-reg-title { font-size: 1.45em; line-height: 1.5; margin-bottom: .6em; }
.trm-reg-body { margin-top: 1.2em; }
.trm-ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.trm-sub { display: block; color: var(--muted); font-size: .9em; line-height: 1.7; }
.trm-num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Steps */
.trm-steps { list-style: none; padding: 0; display: flex; gap: 0; border-bottom: 2px solid var(--accent); }
.trm-steps li { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 4px; color: var(--muted); font-size: .9em; min-width: 0; }
.trm-step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid currentColor; font-weight: 700; flex: none; }
.trm-steps li.is-current { color: var(--accent); font-weight: 700; box-shadow: inset 0 -4px 0 var(--stamp); }
.trm-steps li.is-current .trm-step-n { background: var(--accent); color: #fff; border-color: var(--accent); }
.trm-steps li.is-done { color: var(--accent); }
.trm-step-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Fields: ruled line, not a box */
.trm-form { display: grid; gap: 14px; margin-top: 18px; }
.trm-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.trm-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trm-field-label { font-weight: 600; font-size: .92em; }
.trm-field input[type="text"], .trm-field select { min-height: 46px; border: 0; border-bottom: 1.5px solid var(--rule); background: transparent; color: inherit; font: inherit; padding: 6px 2px; border-radius: 0; width: 100%; box-sizing: border-box; }
.trm-field input[type="text"]:focus, .trm-field select:focus { outline: none; border-bottom-color: var(--accent); box-shadow: 0 2px 0 var(--accent); }
.trm-field.has-error input, .trm-field.has-error select { border-bottom-color: var(--stamp); }
.trm-field-hint { color: var(--muted); font-size: .85em; }
.trm-field-error { color: var(--stamp); font-size: .88em; font-weight: 600; }
.trm-birth { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 10px; }
.trm-birth select { min-height: 46px; border: 0; border-bottom: 1.5px solid var(--rule); background: transparent; color: inherit; font: inherit; border-radius: 0; }

/* Choices and picks */
.trm-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trm-choice, .trm-pick, .trm-plan { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--rule); border-radius: 6px; background: var(--paper); cursor: pointer; min-height: 44px; }
.trm-choice.is-on, .trm-pick.is-on, .trm-plan.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.trm-choice input, .trm-pick input, .trm-plan input { margin-top: 5px; width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.trm-pick-list { display: grid; gap: 10px; }
.trm-pick { border-inline-start: 6px solid var(--trm-course, var(--accent)); justify-content: space-between; align-items: center; }
.trm-pick-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.trm-pick-title { font-size: 1.08em; }
.trm-pick-meta { color: var(--muted); font-size: .92em; }
.trm-pick-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: end; }
.trm-fee { font-weight: 700; white-space: nowrap; }
.trm-seats { font-size: .85em; font-weight: 700; color: #2f6b3f; }
.trm-seats.is-full { color: var(--stamp); }
.trm-check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.trm-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.trm-student { border: 1px solid var(--rule); border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; background: var(--paper); display: grid; gap: 12px; }
.trm-student-head { display: flex; justify-content: space-between; align-items: center; }
.trm-classpicks { display: grid; gap: 2px; }
.trm-link { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 8px 0; min-height: 44px; text-decoration: underline; }
.trm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.trm-actions .trm-button { flex: 0 1 auto; }
.trm-button[disabled] { opacity: .55; cursor: not-allowed; }
.trm-button-ghost { background: transparent; color: var(--accent); }
.trm-mobile-shown { font-size: 1.3em; font-weight: 700; margin-bottom: .6em; }

/* Callouts and stamps */
.trm-callout { margin-top: 14px; padding: 10px 14px; border-radius: 5px; border: 1px solid var(--rule); border-inline-start-width: 5px; background: var(--paper); line-height: 1.8; }
.trm-callout.is-error { border-color: var(--stamp); color: #7d2118; background: #fdf0ee; }
.trm-callout.is-warn { border-color: #d8a31a; background: #fff8e1; color: #5e4300; }
.trm-callout.is-info { border-color: var(--accent); }
.trm-stamp-mark { display: inline-block; padding: 0 .8em; border: 2px solid var(--stamp); border-radius: 3px; color: var(--stamp); font-weight: 800; transform: rotate(-3deg); box-shadow: inset 0 0 0 1px var(--paper), inset 0 0 0 2px var(--stamp); }
.trm-stamp-mark.is-paid { border-color: #2f6b3f; color: #2f6b3f; box-shadow: inset 0 0 0 1px var(--paper), inset 0 0 0 2px #2f6b3f; }
.trm-stamp-mark.is-void { border-color: #777; color: #777; box-shadow: none; }

/* Invoice */
.trm-invoice { border: 1.5px solid var(--accent); border-radius: 6px; background: var(--paper); padding: 16px 18px; margin-top: 14px; }
.trm-invoice-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.trm-lines, .trm-installments, .trm-schedule { width: 100%; border-collapse: collapse; }
.trm-lines td, .trm-installments :is(th, td), .trm-schedule td { padding: 9px 6px; border-bottom: 1px dashed var(--rule); text-align: start; vertical-align: top; }
.trm-lines td:last-child { text-align: end; white-space: nowrap; }
.trm-lines td:last-child del { display: block; color: var(--muted); font-size: .85em; }
.trm-installments th { font-size: .85em; color: var(--muted); font-weight: 600; border-bottom: 1.5px solid var(--rule); }
.trm-installments tr.is-late td { background: #fdf0ee; }
.trm-installments input { width: 20px; height: 20px; accent-color: var(--accent); }
.trm-discounts { list-style: none; padding: 8px 0 0; display: grid; gap: 4px; color: #2f6b3f; font-size: .95em; }
.trm-discounts li { display: flex; justify-content: space-between; gap: 12px; }
.trm-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 8px; border-top: 2px solid var(--accent); font-size: 1.15em; }
.trm-total.is-sub { border-top: 0; margin-top: 0; padding-top: 4px; font-size: 1em; color: var(--muted); }
.trm-pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .82em; font-weight: 700; border: 1px solid var(--rule); }
.trm-pill.is-paid { color: #2f6b3f; border-color: #2f6b3f; }
.trm-pill.is-overdue { color: var(--stamp); border-color: var(--stamp); }
.trm-coupon { display: flex; gap: 12px; align-items: flex-end; margin-top: 14px; }
.trm-coupon .trm-field { flex: 1 1 auto; }
.trm-plans { border: 0; padding: 0; margin-top: 16px; display: grid; gap: 10px; }
.trm-plans legend { font-weight: 700; margin-bottom: 8px; }
.trm-plan { flex-wrap: wrap; }
.trm-plan > span { flex: 1 1 60%; display: flex; flex-direction: column; }
.trm-schedule { margin-top: 8px; font-size: .92em; flex: 1 1 100%; }
.trm-hold { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border: 1.5px dashed var(--stamp); border-radius: 6px; color: #7d2118; background: #fdf0ee; margin-top: 10px; }
.trm-hold strong { font-size: 1.25em; font-variant-numeric: tabular-nums; }
.trm-waitbox { border: 1.5px solid var(--accent); border-radius: 6px; padding: 12px 16px; margin-top: 14px; background: var(--paper); }
.trm-waitbox h3 { font-size: 1.05em; margin-bottom: 6px; }
.trm-waitbox ul { padding-inline-start: 1.2em; line-height: 1.9; }
.trm-history { margin-top: 14px; }
.trm-history ul { list-style: none; padding: 6px 0 0; display: grid; gap: 4px; }
.trm-history li { display: flex; justify-content: space-between; gap: 12px; }

/* Receipt */
.trm-slip { background: var(--paper); border: 1.5px solid var(--accent); border-radius: 6px; padding: 22px 24px; position: relative; }
.trm-slip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid var(--accent); padding-bottom: 12px; }
.trm-slip-head h2 { font-size: 1.4em; }
.trm-slip-head p { color: var(--muted); }
.trm-seal-paid { display: inline-block; padding: .15em .9em; border: 3px solid #2f6b3f; border-radius: 4px; color: #2f6b3f; font-weight: 800; font-size: 1.2em; transform: rotate(-5deg); box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px #2f6b3f; }
.trm-slip-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 14px 0; }
.trm-slip-facts > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--rule); }
.trm-slip-facts dt { color: var(--muted); }
.trm-slip-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.trm-slip-table th, .trm-slip-table td { text-align: start; padding: 8px 4px; border-bottom: 1px dashed var(--rule); }
.trm-slip-table th:last-child, .trm-slip-table td:last-child { text-align: end; }
.trm-slip-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.3em; padding-top: 12px; border-top: 2px solid var(--accent); margin-top: 8px; }
.trm-slip-note { color: var(--muted); margin-top: 8px; }
.trm-slip-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.trm-waitnote { margin-top: 10px; }

@media (max-width: 640px) {
	.trm-form-row, .trm-choices, .trm-slip-facts { grid-template-columns: minmax(0, 1fr); }
	.trm-steps li { flex-direction: column; gap: 2px; font-size: .78em; padding: 6px 2px; }
	.trm-pick { flex-wrap: wrap; }
	.trm-pick-side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; padding-inline-start: 32px; }
	.trm-invoice { padding: 14px; }
	.trm-installments th:nth-child(5), .trm-installments td:nth-child(5) { display: none; }
	.trm-coupon { flex-direction: column; align-items: stretch; }
	.trm-actions .trm-button { flex: 1 1 100%; }
	.trm-slip { padding: 16px; }
	.trm-seal-paid { font-size: 1em; }
}
@media (prefers-reduced-motion: no-preference) { .trm-stamp-mark, .trm-seal-paid { animation: trm-stamp .35s ease-out; } }
@keyframes trm-stamp { from { transform: scale(1.5) rotate(-12deg); opacity: 0; } to { transform: rotate(-3deg); opacity: 1; } }
@media print {
	body * { visibility: hidden; }
	.trm-receipt, .trm-receipt * { visibility: visible; }
	.trm-receipt { position: absolute; inset: 0; max-width: none; }
	.trm-slip-actions { display: none !important; }
}
.trm-schedule td, .trm-installments td { white-space: nowrap; }
.trm-installments td:nth-child(2) { white-space: normal; }
.trm-step-t { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.4; font-size: .92em; }
.trm-steps li { align-items: flex-start; }

/* Nothing on the public steps may be wider than the screen (320-390px phones): fieldsets and flex children
   default to their content width and push the option boxes past the left edge. */
.trm-reg fieldset { min-inline-size: 0; max-inline-size: 100%; margin-inline: 0; }
.trm-reg :is(.trm-plans, .trm-plan, .trm-plan > span, .trm-pick, .trm-pick-body, .trm-choice, .trm-invoice, .trm-slip, .trm-field, .trm-form, .trm-actions) { min-width: 0; max-width: 100%; }
.trm-reg :is(img, svg, table, input, select, textarea) { max-width: 100%; }
@media (max-width: 460px) {
	.trm-plan { padding: 12px; gap: 10px; }
	.trm-schedule { font-size: .86em; width: 100%; }
	.trm-schedule th, .trm-schedule td { padding: 6px 2px; }
	.trm-schedule td { white-space: normal; }
	.trm-schedule td:last-child { white-space: nowrap; }
	.trm-installments td { white-space: normal; }
}
@media (max-width: 460px) {
	.trm-installments { table-layout: fixed; font-size: .86em; }
	.trm-installments :is(th, td) { padding: 7px 3px; overflow-wrap: anywhere; }
	.trm-installments .trm-num, .trm-installments td { white-space: normal; }
	.trm-installments th:first-child, .trm-installments td:first-child { width: 30px; }
	.trm-installments input { width: 18px; height: 18px; }
}
.trm-field textarea { min-height: 84px; border: 1.5px solid var(--rule); background: transparent; color: inherit; font: inherit; padding: 8px; border-radius: 4px; width: 100%; box-sizing: border-box; resize: vertical; }
.trm-field textarea:focus { outline: none; border-color: var(--accent); }
.trm-field input[type="file"] { font: inherit; max-width: 100%; padding: 8px 0; }
.trm-form .trm-field, .trm-student .trm-field { margin-top: 10px; }
.trm-filebtn { position: relative; display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; min-height: 40px; padding: 0 18px; border: 1.5px solid var(--accent); border-radius: 6px; color: var(--accent); font-weight: 600; cursor: pointer; margin: 6px 0; }
.trm-filebtn:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.trm-file-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.trm-consult { max-width: 560px; margin-inline: auto; }
.trm-consult .trm-form { display: grid; gap: 10px; position: relative; }
.trm-consult-title { font-size: 1.3em; }
.trm-consult-msg { min-height: 1.5em; font-weight: 600; }
.trm-consult-msg.is-ok { color: #2f6b3f; }
.trm-consult-msg.is-bad { color: var(--stamp); }
.trm-consult .trm-field textarea, .trm-consult .trm-field select { font: inherit; }
