/* Tri-School Enrollment – frontend. Override the variables in your theme to match branding. */
.tse {
	--tse-primary: #2b6cb0;
	--tse-primary-dark: #22558c;
	--tse-success: #2f855a;
	--tse-danger: #c53030;
	--tse-border: #dfe3e8;
	--tse-muted: #6b7280;
	--tse-bg: #f7f9fb;
	--tse-radius: 10px;
	font-size: 16px;
	line-height: 1.55;
	color: inherit;
}
.tse *, .tse *::before, .tse *::after { box-sizing: border-box; }
.tse [hidden] { display: none !important; }
.tse h3 { margin: 1.4em 0 .6em; font-size: 1.15em; }
.tse-lead { font-size: 1.05em; }
.tse-muted { color: var(--tse-muted); }
.tse-small { font-size: .875em; }
.tse-req { color: var(--tse-danger); }
.tse-error-text { color: var(--tse-danger); }
.tse-hp { position: absolute !important; left: -9999px !important; height: 1px; overflow: hidden; }

/* Cards / notices */
.tse-card { background: #fff; border: 1px solid var(--tse-border); border-radius: var(--tse-radius); padding: 22px 24px; margin: 0 0 20px; }
.tse-card h3:first-child { margin-top: 0; }
.tse-notice { padding: 12px 16px; border-radius: 8px; margin: 0 0 18px; background: #ebf4ff; border-left: 4px solid var(--tse-primary); }
.tse-notice--success { background: #f0fff4; border-color: var(--tse-success); }
.tse-notice--error { background: #fff5f5; border-color: var(--tse-danger); }

/* Forms */
.tse-form .tse-grid, .tse .tse-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.tse-field { margin: 0 0 16px; }
.tse-field--wide { grid-column: 1 / -1; }
.tse-field > label, .tse-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95em; }
.tse input[type=text], .tse input[type=email], .tse input[type=tel], .tse input[type=date], .tse input[type=number], .tse input[type=password], .tse select, .tse textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--tse-border); border-radius: 8px; font: inherit; background: #fff; color: inherit;
}
.tse input:focus, .tse select:focus, .tse textarea:focus { outline: 2px solid var(--tse-primary); outline-offset: 1px; border-color: var(--tse-primary); }
.tse .tse-invalid { border-color: var(--tse-danger) !important; background: #fff8f8; }
.tse-choice { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; font-weight: 400; cursor: pointer; }
.tse-choice .tse-muted { margin-left: auto; white-space: nowrap; }
.tse-check label { font-weight: 400; }

/* Buttons */
.tse-btn { display: inline-block; background: var(--tse-primary); color: #fff !important; border: 0; border-radius: 8px; padding: 11px 22px; font: inherit; font-weight: 600; text-decoration: none !important; cursor: pointer; transition: background .15s; line-height: 1.3; }
.tse-btn:hover, .tse-btn:focus { background: var(--tse-primary-dark); }
.tse-btn[disabled] { opacity: .6; cursor: wait; }
.tse-btn--ghost { background: transparent; color: var(--tse-primary) !important; box-shadow: inset 0 0 0 1.5px var(--tse-primary); }
.tse-btn--ghost:hover { background: #ebf4ff; }
.tse-btn--danger { background: var(--tse-danger); }
.tse-btn--sm { padding: 6px 14px; font-size: .875em; }
.tse-inline { display: inline; margin: 0; }
.tse-actions { margin-top: 18px; }

/* Steps */
.tse-progress { display: flex; gap: 6px; list-style: none; margin: 0 0 24px; padding: 0; counter-reset: s; flex-wrap: wrap; }
.tse-progress li { flex: 1 1 0; min-width: 90px; font-size: .8em; color: var(--tse-muted); border-top: 4px solid var(--tse-border); padding-top: 8px; counter-increment: s; }
.tse-progress li::before { content: counter(s) ". "; }
.tse-progress li.is-done { border-color: #90cdf4; }
.tse-progress li.is-active { border-color: var(--tse-primary); color: inherit; font-weight: 600; }
.tse-step { border: 0; padding: 0; margin: 0; min-width: 0; }
.tse-step legend { font-size: 1.3em; font-weight: 700; margin-bottom: 16px; padding: 0; }
.tse-step-nav { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--tse-border); }
.tse-step-nav .tse-saved { margin-left: auto; color: var(--tse-success); font-size: .85em; }
.tse-step-nav .tse-next, .tse-step-nav .tse-submit { margin-left: auto; }
.tse-step-nav .tse-saved + .tse-next, .tse-step-nav .tse-saved ~ .tse-submit { margin-left: 0; }
.tse-review h4 { margin: 18px 0 6px; }
.tse-review dl { display: grid; grid-template-columns: minmax(140px, 38%) 1fr; gap: 4px 14px; margin: 0; font-size: .92em; }
.tse-review dt { color: var(--tse-muted); }
.tse-review dd { margin: 0; white-space: pre-wrap; }
.tse-full-note { background: #fffaf0; border-left: 4px solid #dd6b20; padding: 12px 14px; border-radius: 6px; margin-top: 8px; }

/* Calculator */
.tse-calc { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.tse-calc__result { background: var(--tse-bg); border: 1px solid var(--tse-border); border-radius: var(--tse-radius); padding: 18px 20px; position: sticky; top: 20px; }
.tse-calc__result h4 { margin: 0 0 10px; }
.tse-calc-table { width: 100%; border-collapse: collapse; font-size: .93em; }
.tse-calc-table td { padding: 5px 0; border: 0; vertical-align: top; }
.tse-calc-table td:last-child { text-align: right; white-space: nowrap; padding-left: 10px; }
.tse-calc-table .tse-total td { font-weight: 700; border-top: 1px solid var(--tse-border); padding-top: 8px; }
.tse-calc-table .tse-sub td { padding-top: 14px; color: var(--tse-muted); font-size: .9em; text-transform: uppercase; letter-spacing: .03em; }
@media (max-width: 720px) { .tse-calc { grid-template-columns: 1fr; } .tse-calc__result { position: static; } }

/* Tours */
.tse-dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.tse-date input, .tse-slot input { position: absolute; opacity: 0; pointer-events: none; }
.tse-date span { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 8px 6px; border: 1px solid var(--tse-border); border-radius: 8px; cursor: pointer; background: #fff; }
.tse-date strong { font-size: 1.35em; line-height: 1.2; }
.tse-date small { font-size: .72em; color: var(--tse-muted); text-transform: uppercase; }
.tse-date input:checked + span, .tse-slot input:checked + span { background: var(--tse-primary); border-color: var(--tse-primary); color: #fff; }
.tse-date input:checked + span small, .tse-slot input:checked + span small { color: #e2ecf7; }
.tse-date input:focus-visible + span, .tse-slot input:focus-visible + span { outline: 2px solid var(--tse-primary); outline-offset: 2px; }
.tse-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.tse-slot span { display: flex; flex-direction: column; padding: 10px 16px; border: 1px solid var(--tse-border); border-radius: 8px; cursor: pointer; font-weight: 600; background: #fff; }
.tse-slot small { font-weight: 400; font-size: .75em; color: var(--tse-muted); }

/* Portal */
.tse-auth { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.tse-auth #loginform p { margin: 0 0 14px; }
.tse-auth #loginform label { display: block; font-weight: 600; margin-bottom: 6px; }
.tse-auth #loginform input[type=text], .tse-auth #loginform input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--tse-border); border-radius: 8px; }
.tse-auth #loginform .login-remember label { font-weight: 400; }
.tse-auth #wp-submit { background: var(--tse-primary); color: #fff; border: 0; border-radius: 8px; padding: 11px 22px; font-weight: 600; cursor: pointer; }
.tse-portal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tse-portal-head h2 { margin: 0; }
.tse-app-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tse-app-card h3 { margin: 0; }
.tse-bar { height: 8px; background: #edf2f7; border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.tse-bar span { display: block; height: 100%; background: var(--tse-success); border-radius: 99px; transition: width .4s; }
.tse-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--tse-border); margin: 0 0 18px; overflow-x: auto; }
.tse-tabs a { padding: 10px 16px; text-decoration: none; color: var(--tse-muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tse-tabs a.is-active { color: inherit; border-color: var(--tse-primary); font-weight: 600; }
.tse-checklist { list-style: none; margin: 10px 0 0; padding: 0; }
.tse-checklist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f2f5; flex-wrap: wrap; }
.tse-checklist li:last-child { border: 0; }
.tse-checklist li .tse-btn { margin-left: auto; }
.tse-check-icon { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cbd5e0; flex: none; position: relative; }
.tse-checklist .is-done .tse-check-icon { background: var(--tse-success); border-color: var(--tse-success); }
.tse-checklist .is-done .tse-check-icon::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tse-checklist .is-done > span:nth-child(2) { color: var(--tse-muted); text-decoration: line-through; }
.tse-timeline { list-style: none; margin: 0; padding: 0; font-size: .92em; }
.tse-timeline li { padding: 6px 0; border-bottom: 1px dashed #edf0f3; }
.tse-timeline time { color: var(--tse-muted); margin-right: 8px; font-size: .9em; }
.tse-table { width: 100%; border-collapse: collapse; }
.tse-table th, .tse-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #edf0f3; vertical-align: top; }
.tse-table td:last-child { text-align: right; }
.tse-details td:last-child { text-align: left; }
.tse-details td:first-child { color: var(--tse-muted); width: 40%; }
.tse-details th { padding-top: 18px; font-size: 1.02em; }
.tse-upload { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.tse-upload input[type=file] { max-width: 230px; font-size: .85em; }

/* Badges */
.tse-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78em; font-weight: 600; background: #edf2f7; color: #4a5568; white-space: nowrap; }
.tse-badge--submitted, .tse-badge--under_review, .tse-badge--pending { background: #ebf8ff; color: #2b6cb0; }
.tse-badge--accepted, .tse-badge--offered { background: #fefcbf; color: #975a16; }
.tse-badge--enrolled, .tse-badge--paid, .tse-badge--approved, .tse-badge--signed { background: #c6f6d5; color: #22543d; }
.tse-badge--waitlisted, .tse-badge--due { background: #feebc8; color: #9c4221; }
.tse-badge--declined, .tse-badge--withdrawn, .tse-badge--rejected, .tse-badge--cancelled, .tse-badge--unsigned { background: #fed7d7; color: #9b2c2c; }

/* E-sign */
.tse-agreement { max-height: 360px; overflow-y: auto; padding: 16px 18px; background: var(--tse-bg); border: 1px solid var(--tse-border); border-radius: 8px; margin-bottom: 18px; }
.tse-sig-pad { display: block; width: 100%; max-width: 600px; height: 180px; border: 2px dashed #a0aec0; border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; margin-bottom: 8px; }
