/* ==========================================================================
   Ayantrix Trainings - extras on top of ayx-theme.css
   Linked only from the public training pages, student auth pages and the
   student dashboard (partials/training_css.php). Uses theme tokens only.
   ========================================================================== */

/* ---------- course catalog ---------- */
body .trn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 22px; align-items: stretch; }
body .trn-card { padding: 0; gap: 0; overflow: hidden; height: 100%; }
body .trn-thumb-link { display: block; }
body .trn-card:hover { transform: translateY(-3px); }

/* fixed-ratio media: photo (object-fit: cover) or generated placeholder, never stretched */
body .trn-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, var(--ayx-navy) 0%, var(--ayx-navy-2) 60%, #1e4fb8 100%); }
body .trn-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; border-radius: 0; }
body .trn-thumb .trn-thumb-ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: #fff; text-align: center; padding: 12px; background:
  radial-gradient(260px 120px at 85% -10%, rgba(251, 191, 36, .28), transparent 65%),
  radial-gradient(240px 140px at 10% 110%, rgba(96, 165, 250, .35), transparent 65%); }
body .trn-thumb .trn-thumb-ph b { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); font-size: 24px; font-weight: 800; letter-spacing: .02em; }
body .trn-thumb .trn-thumb-ph span { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #bfdbfe; }
body .trn-thumb.is-fallback img { display: none; }
body .trn-thumb .trn-thumb-ph { display: none; }
body .trn-thumb.is-ph .trn-thumb-ph, body .trn-thumb.is-fallback .trn-thumb-ph { display: grid; }
body .trn-badge { position: absolute; left: 14px; top: 14px; z-index: 1; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--ayx-navy); font-size: 12px; font-weight: 800; box-shadow: 0 4px 12px rgba(2, 6, 23, .18); }

body .trn-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 6px; padding: 20px 22px 6px; min-width: 0; }
body .trn-body h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body .trn-body h3 a { color: inherit; text-decoration: none; }
body .trn-body p { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.2em; font-size: 14.5px; line-height: 1.6; }
body .trn-foot { display: grid; gap: 14px; margin-top: auto; padding: 14px 22px 22px; }
body .trn-facts { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--ayx-line); }
body .trn-facts > div { min-width: 0; }
body .trn-facts small { display: block; color: var(--ayx-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
body .trn-facts strong { display: block; color: var(--ayx-ink); font-size: 15px; }
body .trn-facts .trn-price { color: var(--ayx-primary-dark); font-size: 1.45rem; font-weight: 800; line-height: 1.1; text-align: right; }
body .trn-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body .trn-cta .portal-btn { width: 100%; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
body .trn-cta form { margin: 0; max-width: none; }
@media (max-width: 380px) { body .trn-cta { grid-template-columns: 1fr; } }

body .trn-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
body .trn-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 22px; color: #dbeafe; font-size: 14px; font-weight: 600; }
body .trn-trust span::before { content: "\2713"; margin-right: 7px; color: var(--ayx-accent); font-weight: 800; }

/* ---------- course details ---------- */
body .trn-back { display: inline-flex; margin-bottom: 14px; text-decoration: none; }
body .trn-detail-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: clamp(20px, 4vw, 44px); align-items: center; padding: clamp(24px, 4vw, 44px); border-radius: 24px; background: radial-gradient(900px 300px at 85% -20%, rgba(96, 165, 250, .35), transparent 60%), linear-gradient(135deg, var(--ayx-navy) 0%, var(--ayx-navy-2) 60%, #123a8f 100%); color: #fff; box-shadow: var(--ayx-shadow-lg); }
body .trn-detail-hero h1 { color: #fff; margin: 4px 0 12px; font-size: clamp(1.7rem, 3.6vw, 2.7rem); overflow-wrap: anywhere; }
body .trn-detail-hero p { max-width: 640px; margin: 0 0 18px; color: #cbd5e1; font-size: 1.05rem; }
body .trn-detail-hero .portal-kicker { background: rgba(255, 255, 255, .12); color: #dbeafe; }
body .trn-hero-facts { display: flex; flex-wrap: wrap; gap: 10px; }
body .trn-hero-facts span { padding: 7px 14px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 13.5px; font-weight: 650; }
body .trn-detail-hero .trn-thumb { border-radius: 18px; box-shadow: 0 18px 40px rgba(2, 6, 23, .35); border: 1px solid rgba(255, 255, 255, .18); }
@media (max-width: 820px) { body .trn-detail-hero { grid-template-columns: 1fr; } body .trn-detail-hero .trn-thumb { order: -1; max-width: 420px; } }

body .trn-detail-grid { margin-top: 24px; }
body .trn-sections { display: grid; gap: 18px; min-width: 0; }
body .trn-section { padding: clamp(18px, 2.6vw, 28px); border: 1px solid var(--ayx-line); border-radius: var(--ayx-radius); background: #fff; box-shadow: var(--ayx-shadow); min-width: 0; }
body .trn-section h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
body .trn-section h2::before { content: ""; width: 5px; height: 1.15em; border-radius: 4px; background: linear-gradient(180deg, var(--ayx-primary), var(--ayx-accent)); }
body .trn-section .portal-prose { margin: 0; }
body .trn-syllabus { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: syl; }
body .trn-syllabus li { counter-increment: syl; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--ayx-line); border-radius: 12px; background: #f8fbff; color: var(--ayx-text); line-height: 1.5; }
body .trn-syllabus li::before { content: counter(syl); display: grid; flex: 0 0 28px; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--ayx-primary); color: #fff; font-size: 13px; font-weight: 800; }
body .trn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
body .trn-chips li { padding: 6px 14px; border-radius: 999px; background: var(--ayx-primary-soft); color: var(--ayx-primary-dark); font-size: 14px; font-weight: 650; }

body .trn-enroll { position: sticky; top: calc(var(--ayx-header-h) + 18px); display: grid; gap: 14px; padding: 24px; border: 1px solid var(--ayx-line); border-radius: var(--ayx-radius); background: #fff; box-shadow: var(--ayx-shadow-lg); }
body .trn-enroll h3 { margin: 0; }
body .trn-fee { padding: 16px; border-radius: 14px; background: linear-gradient(135deg, #f3f7ff, #eaf1ff); border: 1px solid #d6e4ff; }
body .trn-fee small { display: block; color: var(--ayx-muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
body .trn-fee .trn-price { display: block; margin-top: 2px; color: var(--ayx-navy); font-size: 2rem; font-weight: 800; line-height: 1.15; }
body .trn-fee .trn-fee-note { display: block; margin-top: 4px; color: var(--ayx-muted); font-size: 13px; }
body .trn-fee .trn-save { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--ayx-ok-bg); color: var(--ayx-ok); font-size: 12px; font-weight: 800; }
body .trn-info { display: grid; gap: 10px; margin: 0; }
body .trn-info div { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--ayx-line); font-size: 14.5px; }
body .trn-info div:last-child { border-bottom: 0; padding-bottom: 0; }
body .trn-info dt { color: var(--ayx-muted); font-weight: 650; flex: 0 0 auto; }
body .trn-info dd { margin: 0; color: var(--ayx-ink); font-weight: 700; text-align: right; }
body .trn-enroll .portal-btn { width: 100%; }
body .trn-enroll form { margin: 0; max-width: none; }
body .trn-enroll-actions { display: grid; gap: 10px; }
body .trn-enroll small { color: var(--ayx-muted); text-align: center; }
@media (max-width: 920px) { body .trn-enroll { position: static; } }

/* ---------- student dashboard ---------- */
body .trn-section-gap { margin-top: 28px; }
body .trn-btn-block { width: 100%; margin-top: 20px; }
body .trn-stack { display: grid; gap: 14px; }
body .trn-student-progress { margin-top: 14px; }
body .account-form-grid .portal-field label { color: var(--ayx-ink); font-size: 14px; font-weight: 700; }
body .account-profile-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--ayx-line); }
body .account-profile-head h1 { margin: 0; font-size: clamp(1.3rem, 2.6vw, 1.7rem); overflow-wrap: anywhere; }
body .account-profile-head p { margin: 4px 0 0; overflow-wrap: anywhere; }
body .profile-checklist { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
body .profile-checklist span { padding: 10px 12px; border-radius: 12px; background: #f1f5fb; color: var(--ayx-text); font-size: 14px; }
body .profile-checklist .missing { background: var(--ayx-warn-bg); color: var(--ayx-warn); font-weight: 650; }
body .student-row .portal-actions { margin-top: 14px; }
body .student-row .portal-progress { margin-top: 14px; }
body .student-row-head > div { min-width: 0; }
body .student-row-head h3, body .student-row-head p { overflow-wrap: anywhere; }
body .trn-empty-cta { display: grid; justify-items: center; gap: 12px; }
body .account-panel-head h2 { font-size: 1.2rem; }
body .portal-alert.warning { margin: 0; }

/* ---------- payments ---------- */
body .trn-pay { display: grid; gap: 22px; margin: 0; max-width: none; }
body .trn-pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
body .trn-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--ayx-ink); font-size: 14px; font-weight: 700; }
body .trn-field > small, body .trn-hint { color: var(--ayx-muted); font-size: 12.5px; font-weight: 500; }
body .trn-field select, body .trn-field input[type=text], body .trn-field input[type=number] { width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid #cbd5e1; border-radius: var(--ayx-radius-sm); background: #fff; color: var(--ayx-ink); font: 500 15px/1.4 var(--ayx-font); transition: border-color .2s, box-shadow .2s; }
body .trn-field select:focus, body .trn-field input:focus { outline: 0; border-color: var(--ayx-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
body .trn-field.has-error select, body .trn-field.has-error input, body .trn-upload.has-error { border-color: #e11d48; box-shadow: 0 0 0 3px rgba(225, 29, 72, .12); }
body .trn-error { display: none; color: var(--ayx-bad); font-size: 13px; font-weight: 650; }
body .trn-field.has-error .trn-error, body .trn-upload-wrap.has-error .trn-error { display: block; }
body .trn-money { position: relative; display: block; }
body .trn-money > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ayx-muted); font-weight: 800; pointer-events: none; }
body .trn-money input { padding-left: 32px !important; font-weight: 700 !important; font-variant-numeric: tabular-nums; }
body .trn-fill { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--ayx-primary); font: 700 13px/1.2 var(--ayx-font); cursor: pointer; text-decoration: underline; }
body .trn-fill[hidden] { display: none; }

body .trn-legend { margin: 0 0 10px; padding: 0; color: var(--ayx-ink); font-size: 14px; font-weight: 700; }
body .trn-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
body .trn-method { position: relative; display: block; cursor: pointer; min-width: 0; }
body .trn-method input { position: absolute; opacity: 0; pointer-events: none; }
body .trn-method > span { display: flex; align-items: flex-start; gap: 12px; height: 100%; padding: 16px; border: 1.5px solid var(--ayx-line); border-radius: 14px; background: #f8fafc; transition: border-color .2s, background .2s, box-shadow .2s; }
body .trn-method:hover > span { border-color: #93b4f0; }
body .trn-method i { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #fff; border: 1px solid var(--ayx-line); color: var(--ayx-navy); font-style: normal; font-size: 20px; font-weight: 800; }
body .trn-method b { display: block; color: var(--ayx-ink); font-size: 15.5px; }
body .trn-method small { display: block; margin-top: 2px; color: var(--ayx-muted); font-size: 12.5px; line-height: 1.4; }
body .trn-method em { margin-left: auto; align-self: center; display: grid; flex: 0 0 22px; place-items: center; width: 22px; height: 22px; border: 2px solid #cbd5e1; border-radius: 50%; background: #fff; font-style: normal; color: transparent; font-size: 13px; font-weight: 800; }
body .trn-method input:checked + span { border-color: var(--ayx-primary); background: var(--ayx-primary-soft); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
body .trn-method input:checked + span em { border-color: var(--ayx-primary); background: var(--ayx-primary); color: #fff; }
body .trn-method input:checked + span i { border-color: #bcd2fb; }
body .trn-method input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .5); outline-offset: 2px; }

body .trn-total { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, var(--ayx-navy), var(--ayx-navy-2)); color: #fff; }
body .trn-total span { color: #bfdbfe; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
body .trn-total strong { color: #fff; font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }

body .trn-gpay { display: grid; gap: 18px; padding: clamp(16px, 2.4vw, 24px); border: 1px solid #d6e4ff; border-radius: var(--ayx-radius); background: #f8fbff; }
body .trn-gpay[hidden] { display: none; }
body .trn-gpay h3 { margin: 0; }
body .trn-gpay-top { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: center; }
body .trn-qr { display: grid; place-items: center; width: 220px; max-width: 100%; aspect-ratio: 1 / 1; padding: 10px; border: 1px solid var(--ayx-line); border-radius: 16px; background: #fff; box-shadow: var(--ayx-shadow); overflow: hidden; }
body .trn-qr img { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: contain; border-radius: 8px; }
body .trn-qr-ph { display: none; padding: 12px; text-align: center; color: var(--ayx-muted); font-size: 13px; line-height: 1.45; }
body .trn-qr.is-fallback img { display: none; }
body .trn-qr.is-fallback .trn-qr-ph, body .trn-qr.is-empty .trn-qr-ph { display: block; }
body .trn-qr-ph b { display: block; margin-bottom: 4px; color: var(--ayx-ink); font-size: 15px; }
body .trn-upi { display: grid; gap: 6px; }
body .trn-upi label { color: var(--ayx-muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
body .trn-upi-row { display: flex; gap: 8px; }
body .trn-upi-row input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px dashed #93b4f0; border-radius: 12px; background: #fff; color: var(--ayx-ink); font: 700 15px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
body .trn-upi-row .portal-btn { min-height: 44px; padding: 8px 16px; }
body .trn-copied { color: var(--ayx-ok); font-size: 13px; font-weight: 700; min-height: 1.2em; }
body .trn-steps { margin: 6px 0 0; padding-left: 1.3em; color: var(--ayx-text); font-size: 14px; line-height: 1.6; }
body .trn-steps li { margin: 2px 0; }
body .trn-gpay-warn { margin: 0; padding: 12px 14px; border: 1px solid #fde68a; border-radius: 12px; background: var(--ayx-warn-bg); color: #78350f; font-size: 14px; }

body .trn-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1.5px dashed #93b4f0; border-radius: 14px; background: #fff; }
body .trn-upload input[type=file] { flex: 1 1 220px; min-width: 0; max-width: 100%; font: 500 14px var(--ayx-font); color: var(--ayx-text); }
body .trn-preview { display: block; width: 120px; height: 120px; max-width: 100%; object-fit: cover; border: 1px solid var(--ayx-line); border-radius: 12px; background: #f1f5fb; }
body .trn-preview[hidden] { display: none; }
body .trn-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
body .trn-submit-row p { margin: 0; font-size: 13.5px; max-width: 520px; }
body .trn-submit-row .portal-btn { min-width: 240px; }

@media (max-width: 760px) {
  body .trn-pay-grid { grid-template-columns: 1fr; }
  body .trn-gpay-top { grid-template-columns: 1fr; justify-items: center; }
  body .trn-gpay-top > div:last-child { width: 100%; }
  body .trn-qr { width: 200px; }
  body .trn-submit-row .portal-btn { width: 100%; min-width: 0; }
}
@media (max-width: 480px) {
  body .trn-methods { grid-template-columns: 1fr; }
  body .trn-upi-row { flex-direction: column; }
  body .trn-total strong { font-size: 1.5rem; }
}

/* payment history on small screens: stacked cards instead of a wide table */
body .trn-history { display: block; }
@media (max-width: 640px) {
  body .trn-history .account-table-wrap { border: 0; background: transparent; overflow: visible; }
  body .trn-history .account-table { min-width: 0; display: block; }
  body .trn-history .account-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body .trn-history .account-table tbody { display: grid; gap: 12px; }
  body .trn-history .account-table tr { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--ayx-line); border-radius: 14px; background: #fbfdff; }
  body .trn-history .account-table td { display: flex; justify-content: space-between; gap: 14px; padding: 0; border: 0; text-align: right; overflow-wrap: anywhere; }
  body .trn-history .account-table td::before { content: attr(data-label); flex: 0 0 auto; color: var(--ayx-muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; text-align: left; }
}

/* ---------- auth ---------- */
body .trn-auth { max-width: 520px; }
body .trn-auth.wide { max-width: 820px; }
body .trn-auth .portal-kicker + h1 { margin-top: 4px; }
body .trn-auth-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--ayx-primary-soft); color: var(--ayx-primary-dark); font-size: 13.5px; }

body .trn-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
body .trn-fieldset .trn-legend { padding: 0; }
body .trn-method-text { display: block; min-width: 0; }
body .trn-thumb-link { display: block; }

/* student shell: sidebar scroller must never widen the page (theme change suggested: same rule in ayx-theme.css) */
body .account-shell > * { min-width: 0; }
@media (max-width: 960px) { body .account-shell { grid-template-columns: minmax(0, 1fr); } body .account-sidebar { max-width: 100%; overflow: hidden; } body .account-side-links { overflow-x: auto; } }
body .trn-field.has-error .trn-upload { border-color: #e11d48; }
body .account-main form { max-width: none; margin-left: 0; margin-right: 0; width: auto; }
body .trn-money input { display: block; }
body .trn-field input, body .trn-field select, body .trn-upload input { margin: 0; }
