/* AI Training Portal (/ai-training-portal/) — on top of site.css */
main { overflow-x: clip; } /* the 3D card flip and slide-in must never widen the page on phones */

/* Hero */
.tp-stat { padding: 0.8rem 0.9rem; border-radius: 12px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); }
.tp-stat b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: clamp(1.05rem, 2.2vw, 1.35rem); letter-spacing: -0.02em; }
.tp-stat span { display: block; font-size: 0.74rem; line-height: 1.3; color: rgba(255,255,255,0.65); margin-top: 0.15rem; }
.tp-hero-card { border-radius: 20px; padding: 1.5rem; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 30px 70px rgba(18,3,64,0.35); }
.tp-ring { --p: 0; flex-shrink: 0; width: 4.2rem; height: 4.2rem; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#3C3AFF calc(var(--p) * 1%), rgba(255,255,255,0.12) 0); position: relative; }
.tp-ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #241064; }
.tp-ring span { position: relative; font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; font-weight: 600; }
.tp-hero-mod { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; }
.tp-hero-mod .n { font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; color: rgba(255,255,255,0.5); width: 1.3rem; }
.tp-hero-mod .st { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 0.64rem; color: rgba(255,255,255,0.55); white-space: nowrap; }
.tp-hero-mod.done { border-color: rgba(126,226,184,0.4); }
.tp-hero-mod.done .st { color: #7EE2B8; }
.tp-cert-peek { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 0.9rem; border-radius: 12px; border: 1px dashed rgba(245,199,126,0.6); color: #F5C77E;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }

/* Law table */
.tp-table { width: 100%; border-collapse: collapse; }
.tp-table th { text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: #4E4C7A; background: #F6F5FF; padding: 0.8rem 1rem; }
.tp-table td { padding: 0.85rem 1rem; border-top: 1px solid #EEEDFF; vertical-align: top; line-height: 1.45; }
.tp-table td:last-child { width: 1%; white-space: nowrap; }
.tp-status { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 600; padding: 0.3rem 0.65rem; border-radius: 999px; }
.tp-status.yes { background: #EAF8F1; color: #1F6A4A; }
.tp-status.no { background: #F1F0FA; color: #4E4C7A; }
.tp-status.where { background: #FFF4E2; color: #7A4B0F; }
@media (max-width: 560px) { .tp-table td:last-child { white-space: normal; } .tp-table td, .tp-table th { padding: 0.7rem 0.75rem; } }
.tp-tl { padding: 1rem; border-radius: 14px; background: #fff; border: 1px solid #DFDBFF; }
.tp-tl .d { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 0.78rem; color: #3C3AFF; }

/* Progress bar */
.tp-bar { height: 8px; border-radius: 999px; background: #EEEDFF; overflow: hidden; }
.tp-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3C3AFF, #7B79FF); transition: width 500ms cubic-bezier(0.16,1,0.3,1); }

/* Module cards */
.tp-mod { display: flex; flex-direction: column; text-align: left; padding: 1.5rem; border-radius: 16px; background: #fff; border: 1px solid #DFDBFF; cursor: pointer;
  transition: transform 200ms, box-shadow 200ms, border-color 200ms; width: 100%; }
.tp-mod:hover { transform: translateY(-3px); border-color: #C8C4F5; box-shadow: 0 16px 40px rgba(29,6,91,0.08); }
.tp-mod .ic { width: 2.6rem; height: 2.6rem; border-radius: 12px; background: #EBEBFF; display: flex; align-items: center; justify-content: center; }
.tp-mod.done .ic { background: #1F9D6B; }
.tp-mod.done .ic svg { color: #fff; }
.tp-mod .meta { font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: #7876A8; }
.tp-pill { display: inline-flex; align-items: center; gap: 0.35rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.3rem 0.6rem; border-radius: 999px; }
.tp-pill.todo { background: #F1F0FA; color: #4E4C7A; }
.tp-pill.doing { background: #EBEBFF; color: #3C3AFF; }
.tp-pill.done { background: #EAF8F1; color: #1F6A4A; }
.tp-pill.warn { background: #FFF4E2; color: #7A4B0F; }

/* Certificate panel */
.tp-cert { border-radius: 18px; padding: 1.6rem; display: grid; gap: 1.2rem; }
.tp-cert.locked { background: #fff; border: 1px dashed #C8C4F5; }
.tp-cert.ready { background: linear-gradient(140deg, #1D065B 0%, #2D1578 60%, #3C3AFF 140%); color: #fff; }
@media (min-width: 900px) { .tp-cert { grid-template-columns: 1fr 1.15fr; align-items: start; padding: 2rem; } }
.tp-cert-preview { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,0.3); background: #fff; }

/* Player */
.tp-player-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tp-back { display: inline-flex; align-items: center; gap: 0.4rem; color: #4E4C7A; font-weight: 600; font-size: 0.92rem; }
.tp-back:hover { color: #3C3AFF; }
.tp-stage { perspective: 1800px; margin-top: 1.25rem; }
.tp-flash { position: relative; width: 100%; min-height: 420px; transform-style: preserve-3d; transition: transform 600ms cubic-bezier(0.2,0.8,0.2,1); cursor: pointer; }
.tp-flash.flipped { transform: rotateY(180deg); }
.tp-flash.enter { animation: tp-enter 380ms cubic-bezier(0.16,1,0.3,1); }
@keyframes tp-enter { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.tp-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; padding: clamp(1.4rem, 3.5vw, 2.6rem); display: flex; flex-direction: column; overflow: hidden; }
.tp-front { background: linear-gradient(160deg, #1D065B 0%, #2D1578 55%, #120340 100%); color: #fff; box-shadow: 0 26px 60px rgba(29,6,91,0.25); }
.tp-front::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 55% 45% at 88% 12%, rgba(60,58,255,0.45), transparent 70%); }
.tp-back-face { background: #fff; color: #1D065B; border: 1px solid #DFDBFF; transform: rotateY(180deg); box-shadow: 0 26px 60px rgba(29,6,91,0.12); cursor: pointer; }
.tp-card-n { position: absolute; right: clamp(1.2rem, 3vw, 2.2rem); top: clamp(1rem, 3vw, 1.8rem); font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: clamp(3.5rem, 9vw, 6rem); line-height: 0.85; color: rgba(255,255,255,0.1); }
.tp-card-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; letter-spacing: -0.02em; line-height: 1.06; font-size: clamp(1.8rem, 4.2vw, 3rem); }
.tp-card-hook { margin-top: 1rem; font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.5; color: rgba(255,255,255,0.8); max-width: 38rem; }
.tp-hint { display: inline-flex; align-items: center; gap: 0.5rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.tp-hint i.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #3C3AFF; animation: tp-pulse 2s infinite; }
@keyframes tp-pulse { 0% { box-shadow: 0 0 0 0 rgba(60,58,255,0.6); } 70% { box-shadow: 0 0 0 10px rgba(60,58,255,0); } 100% { box-shadow: 0 0 0 0 rgba(60,58,255,0); } }
.tp-points { display: grid; gap: 0.85rem; margin-top: 1.1rem; }
.tp-points li { display: flex; gap: 0.75rem; line-height: 1.5; color: #2E2A5C; font-size: 1.02rem; }
.tp-points li::before { content: ''; flex-shrink: 0; width: 0.5rem; height: 0.5rem; border-radius: 2px; background: #3C3AFF; margin-top: 0.55rem; }
.tp-rule { margin-top: 1.3rem; padding: 0.95rem 1.1rem; border-radius: 14px; background: linear-gradient(160deg, #1D065B, #2D1578); color: #fff; }
.tp-rule .l { font-family: 'IBM Plex Mono', monospace; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.tp-rule p { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.1rem; line-height: 1.35; margin-top: 0.25rem; }
.tp-dots { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tp-dots span { width: 1.4rem; height: 5px; border-radius: 999px; background: #DFDBFF; }
.tp-dots span.on { background: #3C3AFF; }
.tp-dots span.q { background: #F5C77E; opacity: 0.45; }
.tp-dots span.q.on { opacity: 1; }
.tp-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1.1rem; }
.tp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 3.1rem; padding: 0 1.1rem; border-radius: 12px; font-weight: 600; cursor: pointer; transition: all 160ms; }
.tp-btn.ghost { border: 1px solid #C8C4F5; background: #fff; color: #1D065B; }
.tp-btn.ghost:hover:not(:disabled) { border-color: #3C3AFF; color: #3C3AFF; }
.tp-btn:disabled { opacity: 0.35; cursor: default; }

/* Quiz */
.tp-quiz { border-radius: 22px; background: #fff; border: 1px solid #DFDBFF; padding: clamp(1.4rem, 3.5vw, 2.4rem); margin-top: 1.25rem; box-shadow: 0 26px 60px rgba(29,6,91,0.08); }
.tp-q { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.25; letter-spacing: -0.01em; }
.tp-ans { display: flex; gap: 0.9rem; align-items: flex-start; width: 100%; text-align: left; padding: 1rem 1.1rem; border-radius: 14px; border: 2px solid #DFDBFF; background: #fff; color: #1D065B; font-size: 1rem; line-height: 1.45; cursor: pointer; transition: border-color 160ms, background 160ms; }
.tp-ans:hover { border-color: #C8C4F5; }
.tp-ans .k { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 9px; background: #EEEDFF; color: #3C3AFF; display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.tp-ans.correct { border-color: #1F9D6B; background: #EAF8F1; }
.tp-ans.correct .k { background: #1F9D6B; color: #fff; }
.tp-ans.wrong { border-color: #D64545; background: #FDEEEE; }
.tp-ans.wrong .k { background: #D64545; color: #fff; }
.tp-ans.dim { opacity: 0.5; }
.tp-answers.locked .tp-ans { pointer-events: none; }
.tp-explain { margin-top: 1.1rem; padding: 1rem 1.15rem; border-radius: 14px; background: linear-gradient(160deg, #1D065B, #2D1578); color: #fff; }
.tp-explain .v { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.2rem; }
.tp-explain .v.ok { color: #7EE2B8; }
.tp-explain .v.ko { color: #FFB4B4; }
.tp-done { text-align: center; padding: clamp(1.6rem, 4vw, 3rem); border-radius: 22px; background: linear-gradient(160deg, #1D065B 0%, #2D1578 55%, #120340 100%); color: #fff; margin-top: 1.25rem; }
.tp-done .big { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: clamp(3rem, 8vw, 5rem); line-height: 1; letter-spacing: -0.03em; }

/* Tracks */
.tp-track { position: relative; display: flex; flex-direction: column; padding: 1.5rem; border-radius: 16px; background: #fff; border: 1px solid #DFDBFF; height: 100%; }
.tp-track.free { border: 2px solid #3C3AFF; box-shadow: 0 16px 40px rgba(60,58,255,0.12); }
.tp-track.locked .tp-track-body { opacity: 0.72; }
.tp-track .lock { position: absolute; top: 1.1rem; right: 1.1rem; width: 2.1rem; height: 2.1rem; border-radius: 10px; background: #F1F0FA; display: flex; align-items: center; justify-content: center; color: #4E4C7A; }
.tp-track .dur { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: #3C3AFF; font-weight: 600; }

/* Checklist */
.tp-check { display: flex; gap: 0.8rem; align-items: center; width: 100%; text-align: left; padding: 0.85rem 0.95rem; border-radius: 12px; border: 1px solid #DFDBFF; background: #fff; cursor: pointer; transition: background 150ms, border-color 150ms; line-height: 1.4; }
.tp-check .b { flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 7px; border: 2px solid #C8C4F5; display: flex; align-items: center; justify-content: center; }
.tp-check.on { background: #EAF8F1; border-color: #9AD9BC; }
.tp-check.on .b { background: #1F9D6B; border-color: #1F9D6B; color: #fff; }

/* FAQ */
.tp-faq { border-radius: 14px; background: #fff; border: 1px solid #DFDBFF; }
.tp-faq summary { list-style: none; cursor: pointer; padding: 1.1rem 1.25rem; display: flex; justify-content: space-between; gap: 1rem; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.08rem; }
.tp-faq summary::-webkit-details-marker { display: none; }
.tp-faq summary::after { content: '+'; font-family: 'IBM Plex Mono', monospace; color: #3C3AFF; font-size: 1.2rem; line-height: 1; transition: transform 200ms; }
.tp-faq[open] summary::after { transform: rotate(45deg); }
.tp-faq p { padding: 0 1.25rem 1.2rem; color: #4E4C7A; line-height: 1.6; }

/* Forms + modal */
.tp-label { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: #4E4C7A; margin-bottom: 0.4rem; }
.tp-field { width: 100%; background: #F6F5FF; border: 1px solid #DFDBFF; border-radius: 10px; padding: 0.75rem 0.9rem; font-size: 1rem; color: #1D065B; }
.tp-field:focus { outline: none; border-color: #3C3AFF; box-shadow: 0 0 0 1px #3C3AFF; background: #fff; }
.tp-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.tp-modal[hidden] { display: none; }
.tp-modal-backdrop { position: absolute; inset: 0; background: rgba(29,6,91,0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tp-modal-panel { position: relative; width: min(36rem, 100%); max-height: 92vh; overflow-y: auto; background: #fff; border: 1px solid #DFDBFF; border-radius: 18px; padding: 1.6rem; box-shadow: 0 24px 64px rgba(29,6,91,0.25); }
.tp-modal-close { position: absolute; top: 0.85rem; right: 0.85rem; width: 2.25rem; height: 2.25rem; border-radius: 9px; border: 1px solid #DFDBFF; background: #F6F5FF; display: flex; align-items: center; justify-content: center; cursor: pointer; }

@media (max-width: 640px) {
  .tp-flash { min-height: 70svh; }
  .tp-ctrl .tp-btn span.lbl { display: none; }
  .tp-dots span { width: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tp-flash { transition: none; }
  .tp-flash.enter, .tp-hint i.dot { animation: none !important; }
}
