/**
 * Trialoop - page components added by the "auth" batch of the site redesign (2026-11):
 * T6 form and account pages, T7 content pages, auth screens. To be merged into components.css.
 * Same conventions: every colour is a theme token with the Grid value as fallback,
 * Vitesse signatures (blue band, slanted speed lines) under [data-theme="vitesse"].
 */

/* ---------- heading colours ----------
 * ui.css ends with "h1, h2, h3, h4, h5, h6 { color: var(--tl-text) !important }": without this block a display
 * title written as a heading loses its theme colour (blue in Vitesse, white on the Vitesse band). */
h1.tl-display, h2.tl-display, h2.tl-h2, h3.tl-h2, .tl-prose h2 { color: var(--tl-display, var(--white, #fff)) !important; }
[data-theme="vitesse"] .tl-band h1.tl-display, [data-theme="vitesse"] .tl-band h2.tl-display { color: #FFFFFF !important; }

/* ---------- page frame ----------
 * body is a flex column (ui.css): with "margin: 0 auto" alone, .tl-page shrinks to its content. */
.tl-page { width: 100%; }

/* ---------- T7 content page: band head + prose + side summary ---------- */
.tl-dochead .tl-display { font-size: clamp(38px, 7vw, 80px); }
.tl-dochead .tl-lead { font-size: 18px; }
.tl-dochead__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.tl-dochead > * { position: relative; z-index: 1; }
.tl-docgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.tl-docgrid__main { min-width: 0; }
.tl-docgrid__aside { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tl-docgrid__aside .tl-panel + .tl-panel { margin-top: 0; }
@media (min-width: 1024px) {
    .tl-docgrid { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
    .tl-docgrid__aside { position: sticky; top: calc(var(--header-height, 80px) + 16px); max-height: calc(100vh - var(--header-height, 80px) - 32px); overflow-y: auto; scrollbar-width: thin; }
}
@media (max-width: 1023px) {
    .tl-docgrid__aside--desk { display: none; }
}
.tl-section { margin-bottom: 36px; scroll-margin-top: calc(var(--header-height, 80px) + 16px); }
.tl-section:last-child { margin-bottom: 0; }
.tl-prose > :first-child, .tl-section > :first-child { margin-top: 0; }
.tl-prose h2, .tl-prose h3 { scroll-margin-top: calc(var(--header-height, 80px) + 16px); }
.tl-prose h3 { color: var(--tl-text, #fff); }
.tl-prose strong, .tl-prose em { color: var(--tl-text, #fff); }
.tl-prose p { margin: 0 0 14px; }
.tl-prose ul, .tl-prose ol { padding-left: 1.3em; margin: 0 0 16px; }
.tl-prose li { margin-bottom: 6px; }
.tl-prose li::marker { color: var(--tl-accent-ink, #ff4d8a); }
.tl-prose code { font-size: .9em; padding: 2px 6px; border-radius: 6px; background: var(--tl-surface-2, rgba(255, 255, 255, 0.08)); color: var(--tl-text, #fff); overflow-wrap: anywhere; }
.tl-prose hr { border: 0; border-top: 1px solid var(--tl-line, rgba(255, 255, 255, 0.1)); margin: 24px 0; }
.tl-prose table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14px; line-height: 1.5; border: 1px solid var(--tl-line, rgba(255, 255, 255, 0.1)); border-radius: var(--tl-r-sm, 12px); overflow: hidden; }
.tl-prose th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tl-faint, rgba(255, 255, 255, 0.5)); background: var(--tl-surface-2, rgba(255, 255, 255, 0.06)); padding: 10px 12px; }
.tl-prose td { padding: 10px 12px; border-top: 1px solid var(--tl-line, rgba(255, 255, 255, 0.08)); color: var(--tl-muted, rgba(255, 255, 255, 0.8)); vertical-align: top; overflow-wrap: anywhere; }
.tl-prose td:first-child { color: var(--tl-text, #fff); font-weight: 600; }
.tl-aside__title { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--tl-accent-ink, #ff4d8a); margin: 0 0 10px; }

/* on-page summary (filled by /assets/js/tl-toc.js from the h2 of [data-tl-toc-src]) */
.tl-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-toc a { display: flex; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: 10px; border-left: 3px solid transparent; font-size: 14px; line-height: 1.35; color: var(--tl-muted, rgba(255, 255, 255, 0.7)); text-decoration: none; transition: background .15s ease, color .15s ease; }
.tl-toc a:hover { color: var(--tl-text, #fff); background: rgba(var(--tl-ink-rgb, 255, 255, 255), .05); }
.tl-toc a.is-on { color: var(--tl-text, #fff); background: var(--tl-accent-soft, rgba(255, 30, 106, 0.14)); border-left-color: var(--tl-accent, #ff1e6a); font-weight: 600; }
[data-theme="vitesse"] .tl-toc a.is-on { background: #E2E8FA; border-left-color: #1D3FBF; color: #1D3FBF; }

/* icon tiles (features, values) */
.tl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 0 0 32px; }
.tl-tile { padding: 18px; border-radius: var(--tl-r, 1rem); background: var(--tl-surface, rgba(255, 255, 255, 0.03)); border: 1px solid var(--tl-line, rgba(255, 255, 255, 0.1)); transition: transform .2s ease, border-color .2s ease; }
.tl-tile:hover { transform: translateY(-3px); border-color: var(--tl-accent, #ff1e6a); }
.tl-tile__icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 22px; background: var(--tl-accent-soft, rgba(255, 30, 106, 0.16)); color: var(--tl-accent-ink, #ff4d8a); }
.tl-tile__icon svg { width: 22px; height: 22px; }
.tl-tile h3 { font-size: 16px; font-weight: 700; line-height: 1.3; margin: 0 0 4px; color: var(--tl-text, #fff); }
.tl-tile p { font-size: 14px; line-height: 1.5; margin: 0; color: var(--tl-muted, rgba(255, 255, 255, 0.7)); }
[data-theme="vitesse"] .tl-tile__icon { background: #1D3FBF; color: #FFFFFF; border-radius: 4px; }
.tl-stack { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.tl-stack .tl-todo { font-size: 15px; line-height: 1.45; }

/* questions and answers */
.tl-faq details { border: 1px solid var(--tl-line, rgba(255, 255, 255, 0.1)); border-radius: var(--tl-r, 1rem); background: var(--tl-surface, rgba(255, 255, 255, 0.03)); margin-bottom: 10px; transition: border-color .2s ease; }
.tl-faq details[open] { border-color: var(--tl-line-strong, rgba(255, 255, 255, 0.3)); }
.tl-faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; padding: 12px 18px; cursor: pointer; font-weight: 600; font-size: 15px; line-height: 1.4; color: var(--tl-text, #fff); }
.tl-faq summary::-webkit-details-marker { display: none; }
.tl-faq summary::after { content: '+'; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; background: var(--tl-accent-soft, rgba(255, 30, 106, 0.14)); color: var(--tl-accent-ink, #ff4d8a); transition: transform .2s ease; }
.tl-faq details[open] summary::after { transform: rotate(45deg); }
.tl-faq details > :not(summary) { margin: 0; padding: 0 18px 16px; color: var(--tl-muted, rgba(255, 255, 255, 0.8)); line-height: 1.65; }

/* entrance: children rise one after the other (set --i on each) */
.tl-rise { animation: tl-rise .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes tl-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- T6 form and account ---------- */
.tl-formgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.tl-formgrid__main { min-width: 0; }
.tl-formgrid__aside { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tl-formgrid__aside .tl-panel + .tl-panel { margin-top: 0; }
@media (min-width: 960px) {
    .tl-formgrid { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
    .tl-formgrid__aside { position: sticky; top: calc(var(--header-height, 80px) + 16px); }
}
.tl-panel--lg { padding: 26px; border-radius: calc(var(--tl-r, 16px) * 1.5); }
.tl-panel--lg + .tl-panel--lg { margin-top: 18px; }
.tl-panel--danger { border-color: rgba(var(--tl-danger-rgb, 255, 51, 102), .45); }
.tl-panel__title { font-size: 20px; font-weight: 700; line-height: 1.25; margin: 0 0 14px; color: var(--tl-text, #fff); }
.tl-panel > p { color: var(--tl-muted, rgba(255, 255, 255, 0.75)); line-height: 1.6; }
.tl-form--big { max-width: none; }
.tl-form--big input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]),
.tl-form--big select, .tl-form--big textarea {
    width: 100%; min-height: 50px; padding: 12px 16px; box-sizing: border-box; margin: 0;
    border-radius: var(--tl-r-sm, 14px); border: 1px solid var(--tl-input-border, rgba(255, 255, 255, 0.2));
    background: var(--tl-field, rgba(255, 255, 255, 0.05)); color: var(--tl-text, #fff);
    font: inherit; font-size: 16px; line-height: 1.4; transition: border-color .15s ease, box-shadow .15s ease;
}
.tl-form--big select[multiple] { padding: 8px; }
.tl-form--big textarea { min-height: 120px; resize: vertical; }
.tl-form--big input:focus, .tl-form--big select:focus, .tl-form--big textarea:focus { outline: none; border-color: var(--tl-accent, #ff1e6a); box-shadow: 0 0 0 4px rgba(var(--tl-accent-rgb, 255, 30, 106), .18); }
.tl-form--big input::placeholder { color: var(--tl-faint, rgba(255, 255, 255, 0.5)); }
.tl-form--big input.error, .tl-form--big input[aria-invalid="true"] { border-color: var(--tl-danger, #ff3366); }
.tl-form--big input[type="checkbox"], .tl-form--big input[type="radio"] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--tl-accent-fill, #ff1e6a); }
.tl-input--code { text-align: center; font-size: 26px !important; letter-spacing: .45em; font-variant-numeric: tabular-nums; font-weight: 700; }
.tl-field__error { font-size: 13px; color: var(--tl-danger, #ff3366); }
.tl-check { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; cursor: pointer; font-size: 14px; font-weight: 400; line-height: 1.45; color: var(--tl-text, #fff); opacity: 1; }
.tl-option { color: var(--tl-text, #fff); font-weight: 400; line-height: 1.4; }
.tl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.tl-actions--split { justify-content: space-between; }
.tl-btn--block { width: 100%; }
.tl-btn--lg { min-height: 52px; padding: 0 26px; font-size: 15px; }
.tl-btn--danger { background: var(--tl-danger-solid, #ff3366); color: var(--tl-on-danger, #fff); }
.tl-btn--danger:hover { color: var(--tl-on-danger, #fff); }
button.tl-btn { font-family: inherit; }
.tl-notice--info { background: var(--tl-info-bg, rgba(0, 212, 255, 0.12)); color: var(--tl-info, #00d4ff); }
.tl-notice--stack { flex-direction: column; align-items: flex-start; gap: 6px; }
.tl-notice p { margin: 0; color: inherit; }
.tl-notice a { color: inherit; font-weight: 600; text-decoration: underline; }
.tl-notice > i, .tl-notice > svg { flex-shrink: 0; }
.tl-notice[hidden], .tl-formgrid [hidden], .tl-authcard [hidden] { display: none !important; }
.tl-steplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tl-steplist .tl-step { min-height: 40px; text-decoration: none; }
.tl-steplist a.tl-step:hover { color: var(--tl-text, #fff); }
@media (max-width: 640px) {
    .tl-panel--lg { padding: 20px 18px; }
    .tl-actions { flex-direction: column; align-items: stretch; }
    .tl-actions > .tl-btn, .tl-actions > form, .tl-actions > form > .tl-btn { width: 100%; }
}

/* ---------- auth screens (login, register, password, 2FA): centred card ---------- */
.tl-authpage { position: relative; isolation: isolate; flex: 1 0 auto; width: 100%; box-sizing: border-box; min-height: 100vh; margin-top: calc(-1 * var(--header-height, 80px)); padding: 40px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.tl-authpage--inline { min-height: 0; margin-top: 0; padding: 32px 16px 64px; }
.tl-authpage::before { content: ''; position: absolute; z-index: -1; top: -18%; right: -12%; width: 68vw; height: 68vw; max-width: 760px; max-height: 760px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--tl-accent-rgb, 255, 30, 106), .22), transparent 66%); pointer-events: none; animation: tl-glow 10s ease-in-out infinite alternate; }
.tl-authpage::after { content: ''; position: absolute; z-index: -1; left: -6%; bottom: -8%; width: 56%; height: 46%; pointer-events: none; background: repeating-linear-gradient(-76deg, rgba(var(--tl-accent-rgb, 255, 30, 106), .08) 0 14px, transparent 14px 42px); -webkit-mask-image: linear-gradient(35deg, #000, transparent 70%); mask-image: linear-gradient(35deg, #000, transparent 70%); }
@keyframes tl-glow { from { transform: translate(0, 0) scale(1); } to { transform: translate(-6%, 8%) scale(1.08); } }
[data-theme="vitesse"] .tl-authpage::before { top: 0; right: 0; left: 0; width: auto; height: 46%; max-width: none; max-height: none; border-radius: 0; background: #1D3FBF; animation: none; }
[data-theme="vitesse"] .tl-authpage::after { left: auto; right: -40px; top: 0; bottom: auto; width: 620px; height: 46%; background: repeating-linear-gradient(-76deg, rgba(255, 255, 255, .08) 0 18px, transparent 18px 46px); -webkit-mask-image: none; mask-image: none; }
.tl-authpage .tl-authcard, .tl-authcard--glass { width: 100%; box-sizing: border-box; margin: 0 auto; padding: 32px 28px; background: var(--tl-surface, rgba(255, 255, 255, 0.05)); border: 1px solid var(--tl-line, rgba(255, 255, 255, 0.12)); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: var(--tl-text, #fff); animation: tl-rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.tl-authcard--wide { max-width: 520px; }
.tl-authcard__head { text-align: center; margin-bottom: 24px; }
.tl-authcard__logo { display: block; height: 40px; width: auto; margin: 0 auto 18px; }
.tl-authcard__icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--tl-accent-soft, rgba(255, 30, 106, 0.16)); color: var(--tl-accent-ink, #ff4d8a); }
.tl-authcard .tl-display { font-size: clamp(34px, 9vw, 46px); }
.tl-authcard .tl-lead { margin: 10px auto 0; font-size: 15px; }
.tl-authcard a:not(.tl-btn) { color: var(--tl-accent-ink, #ff4d8a); }
.tl-authcard__foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--tl-line, rgba(255, 255, 255, 0.1)); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: 14px; color: var(--tl-muted, rgba(255, 255, 255, 0.7)); }
.tl-authcard__foot p { margin: 0; color: inherit; }
.tl-authcard__foot a:not(.tl-btn) { font-weight: 600; text-decoration: none; }
.tl-authcard__foot a:hover { text-decoration: underline; }
.tl-authcard .social-or { color: var(--tl-muted, rgba(255, 255, 255, 0.7)); }
.tl-authcard .social-or::before, .tl-authcard .social-or::after { border-top-color: var(--tl-line, rgba(255, 255, 255, 0.15)); }
.tl-authcard .social-login { margin-bottom: 4px; }
.tl-authcard .tl-field { margin-bottom: 16px; }
.tl-field__row > label { margin: 0; font-size: 14px; font-weight: 600; color: var(--tl-text, #fff); opacity: 1; }
.tl-authcard .tl-field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tl-authcard .tl-field__row a { font-size: 13px; font-weight: 600; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
@media (max-width: 480px) {
    .tl-authpage { padding: 24px 12px; justify-content: flex-start; }
    .tl-authpage .tl-authcard, .tl-authcard--glass { padding: 24px 18px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .tl-rise, .tl-authpage .tl-authcard, .tl-authcard--glass, .tl-authpage::before { animation: none; }
    .tl-tile:hover { transform: none; }
}
