/* ==============================================================
   Trainer directory — trainers.html, trainer.html, trainer-signup.html
   Loaded after home.css and built only on its tokens.
   ============================================================== */

:root {
    --tr-ok: #1f8a5b;
    --tr-ok-soft: rgba(31,138,91,.10);
    --tr-ok-line: rgba(31,138,91,.25);
    --tr-err: #c2334f;
    --tr-err-soft: rgba(232,67,111,.09);
    --tr-err-line: rgba(232,67,111,.28);
}

/* ---------- Page head extras ---------- */
.tr-head-points { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; }
.tr-head-points span { display: inline-flex; align-items: center; gap: 8px; }
.tr-head-points i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 10px; }

/* ---------- Shared bits ---------- */
.tr-section { padding: clamp(36px, 5vw, 64px) 0 var(--section-y); }
.tr-chip {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    padding: 5px 12px; border-radius: 100px; background: var(--bg-soft); border: 1px solid var(--line);
    font-size: 13px; font-weight: 500; color: var(--ink-2); line-height: 1.35;
}
.tr-chip--more { background: #fff; color: var(--muted); }
.tr-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.tr-avatar {
    width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: var(--grad-warm); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 18px;
    letter-spacing: .02em; box-shadow: 0 12px 24px -12px rgba(232,67,111,.6);
}
.tr-avatar--lg { width: 88px; height: 88px; font-size: 30px; }

.tr-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); }
.tr-meta span { display: inline-flex; align-items: center; gap: 7px; }
.tr-meta i { color: var(--brand); font-size: 12px; }

.tr-select {
    appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%234f5d6c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 15px center; background-size: 12px 8px;
}
.tr-field-hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
.tr-input-group { position: relative; }
.tr-input-group > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 14px; pointer-events: none; }
.tr-input-group > .vc-input { padding-left: 42px; }
.tr-suffix { position: relative; }
.tr-suffix > .vc-input { padding-right: 64px; }
.tr-suffix > span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }

.tr-alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
    font-size: 14.5px; line-height: 1.5; border: 1px solid transparent;
}
.tr-alert i { margin-top: 3px; flex-shrink: 0; }
.tr-alert--error { background: var(--tr-err-soft); border-color: var(--tr-err-line); color: var(--tr-err); }
.tr-alert--ok { background: var(--tr-ok-soft); border-color: var(--tr-ok-line); color: var(--tr-ok); }
.tr-alert--info { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.tr-alert[hidden] { display: none; }

.lc-btn[disabled], .lc-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none; }
.tr-linkbtn { background: none; border: 0; padding: 0; color: var(--brand-ink); font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tr-linkbtn:disabled { color: var(--faint); cursor: default; text-decoration: none; }

/* ---------- Skills combobox ---------- */
.tr-combo { position: relative; }
.tr-combo-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 50px; padding: 7px 10px;
    border: 1px solid var(--line-strong); border-radius: 12px; background: #fbfbfe; cursor: text; transition: var(--t);
}
.tr-combo.is-open .tr-combo-box, .tr-combo-box:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.tr-combo-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 11px; border-radius: 100px;
    background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-ink); font-size: 13.5px; font-weight: 600; line-height: 1.3;
}
.tr-combo-chip button {
    width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--brand-ink);
    display: grid; place-items: center; cursor: pointer; font-size: 11px;
}
.tr-combo-chip button:hover, .tr-combo-chip button:focus-visible { background: rgba(241,90,41,.18); outline: none; }
.tr-combo-input { flex: 1 1 140px; min-width: 120px; border: 0; outline: none; background: transparent; padding: 6px 4px; font-family: var(--font); font-size: 15px; color: var(--ink); }
.tr-combo-input::placeholder { color: var(--faint); }
.tr-combo-list {
    position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); max-height: 320px; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px;
    overscroll-behavior: contain;
}
.tr-combo-list[hidden] { display: none; }
.tr-combo-group { padding: 10px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tr-combo-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px;
    font-size: 14.5px; color: var(--ink-2); cursor: pointer;
}
.tr-combo-option small { font-size: 12px; color: var(--muted); }
.tr-combo-option .tick { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 10px; color: transparent; flex-shrink: 0; }
.tr-combo-option[aria-selected="true"] .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.tr-combo-option.is-active { background: var(--bg-soft); }
.tr-combo-option[aria-selected="true"] { color: var(--brand-ink); font-weight: 600; }
.tr-combo-empty { padding: 14px 12px; font-size: 14px; color: var(--muted); }

/* ---------- Directory filters ---------- */
.tr-filters {
    background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 20px;
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; gap: 14px; align-items: end;
}
.tr-filters .vc-label { margin-bottom: 6px; }
.tr-filters-row2 { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.tr-filters-row2 .tr-select { width: auto; min-width: 170px; padding-top: 10px; padding-bottom: 10px; font-size: 14.5px; }
.tr-seg { display: inline-flex; padding: 4px; border-radius: 100px; background: var(--bg-soft); border: 1px solid var(--line); }
.tr-seg button {
    border: 0; background: transparent; padding: 8px 16px; border-radius: 100px; font-size: 14px; font-weight: 600; color: var(--body); cursor: pointer; transition: var(--t);
}
.tr-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.tr-filters-clear { margin-left: auto; }

.tr-results-head { margin: 28px 2px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tr-results-head p { font-size: 15px; color: var(--muted); }
.tr-results-head strong { color: var(--ink); }

/* ---------- Trainer cards ---------- */
.tr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tr-card {
    position: relative; display: flex; flex-direction: column; gap: 16px; background: #fff; border-radius: var(--r-lg);
    padding: 24px; box-shadow: var(--shadow-card); transition: var(--t); min-width: 0;
}
.tr-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.tr-card-top { display: flex; gap: 14px; align-items: center; min-width: 0; }
.tr-card-top h3 { font-size: 18px; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.tr-card-top h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tr-card-top h3 a:focus-visible { outline: none; }
.tr-card:has(h3 a:focus-visible) { box-shadow: 0 0 0 3px var(--brand), var(--shadow-lg); }
.tr-card .tr-meta { margin-top: 4px; font-size: 13.5px; }
.tr-card-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--line-2); }
.tr-card-foot .lc-btn { position: relative; z-index: 2; }
.tr-card-foot .tr-view { font-size: 14px; font-weight: 600; color: var(--brand-ink); display: inline-flex; align-items: center; gap: 8px; }

.tr-skel { pointer-events: none; }
.tr-skel .bar, .tr-skel .tr-avatar { background: linear-gradient(90deg, #eef0f6 0%, #f7f8fb 50%, #eef0f6 100%); background-size: 200% 100%; animation: tr-shimmer 1.3s linear infinite; box-shadow: none; color: transparent; }
.tr-skel .bar { height: 12px; border-radius: 8px; }
@keyframes tr-shimmer { to { background-position: -200% 0; } }

.tr-empty { text-align: center; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: clamp(36px, 6vw, 64px) 24px; }
.tr-empty .ic { width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 22px; }
.tr-empty h3 { font-size: 21px; }
.tr-empty p { margin: 10px auto 0; max-width: 460px; color: var(--body); font-size: 15.5px; }
.tr-empty .lc-hero-ctas { margin-top: 22px; }

.tr-pager { margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 14.5px; color: var(--muted); }

/* ---------- Profile page ---------- */
.tr-profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.tr-profile-head h1 { overflow-wrap: anywhere; }
.tr-profile-head .tr-meta { margin-top: 12px; font-size: 15px; }
.tr-profile-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.tr-panel { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: clamp(22px, 3vw, 32px); }
.tr-panel + .tr-panel { margin-top: 20px; }
.tr-panel h2 { font-size: 20px; letter-spacing: -0.015em; margin-bottom: 16px; }
.tr-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tr-fact { background: var(--bg-soft); border-radius: 16px; padding: 16px; }
.tr-fact strong { display: block; font-family: var(--font-display); font-size: 24px; color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; }
.tr-fact span { font-size: 13.5px; color: var(--muted); }
.tr-skill-area + .tr-skill-area { margin-top: 18px; }
.tr-skill-area h3 { font-size: 13px; font-family: var(--font); font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }

.tr-contact-card { position: sticky; top: 100px; }
.tr-contact-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.tr-contact-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--bg-soft); min-width: 0; }
.tr-contact-row .ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--brand); flex-shrink: 0; box-shadow: var(--shadow-xs); }
.tr-contact-row div { min-width: 0; }
.tr-contact-row small { display: block; font-size: 12.5px; color: var(--muted); }
.tr-contact-row strong { display: block; font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }
.tr-contact-row .masked { letter-spacing: .14em; color: var(--faint); }
.tr-contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tr-contact-actions .full { grid-column: 1 / -1; }
.tr-btn-wa { background: #25d366; color: #0b3d22; }
.tr-btn-wa:hover { background: #1fbd5b; color: #0b3d22; transform: translateY(-2px); }
.tr-note { margin-top: 14px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.tr-note i { color: var(--brand); margin-right: 6px; }

/* ---------- Sign-up page ---------- */
.tr-form-card { background: #fff; border-radius: 26px; padding: clamp(22px, 3.4vw, 34px); box-shadow: var(--shadow-card); }
.tr-form-card h2 { font-size: 22px; letter-spacing: -0.02em; }
.tr-form-card > p { margin-top: 6px; font-size: 15px; color: var(--muted); }
.tr-form-card .lc-form-grid { margin-top: 22px; }
.tr-check { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; cursor: pointer; }
.tr-check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); flex-shrink: 0; cursor: pointer; }
.tr-check a { color: var(--brand-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tr-otp {
    width: 100%; max-width: 260px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: #fbfbfe;
    font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: .4em; text-align: center; color: var(--ink);
}
.tr-otp:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.tr-step-actions { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.tr-done { text-align: center; padding: 18px 4px 6px; }
.tr-done .ic { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--tr-ok-soft); color: var(--tr-ok); font-size: 26px; }
.tr-done h2 { font-size: 24px; }
.tr-done p { margin: 10px auto 0; max-width: 420px; color: var(--body); font-size: 15.5px; }
.tr-done .lc-hero-ctas { margin-top: 24px; }
.tr-below-form { margin-top: 16px; text-align: center; font-size: 14.5px; color: var(--muted); }

.tr-terms { margin-top: 40px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 0 26px; }
.tr-terms summary { list-style: none; cursor: pointer; padding: 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); }
.tr-terms summary::-webkit-details-marker { display: none; }
.tr-terms summary i { transition: var(--t); color: var(--muted); font-size: 14px; }
.tr-terms[open] summary i { transform: rotate(180deg); }
.tr-terms ol { padding: 0 0 22px 20px; margin: 0; list-style: decimal; display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--body); }
.tr-terms a { color: var(--brand-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Dialog (unlock contact, delete profile) ---------- */
.tr-dialog {
    width: min(500px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 24px;
    background: #fff; color: var(--body); box-shadow: var(--shadow-xl); overflow: auto;
}
.tr-dialog::backdrop { background: rgba(11,22,34,.55); backdrop-filter: blur(3px); }
.tr-dialog-head { display: flex; align-items: flex-start; gap: 14px; padding: 24px 24px 0; }
.tr-dialog-head h2 { font-size: 20px; letter-spacing: -0.015em; line-height: 1.25; }
.tr-dialog-head p { margin-top: 4px; font-size: 14.5px; color: var(--muted); }
.tr-dialog-close {
    margin-left: auto; flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
    color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: var(--t);
}
.tr-dialog-close:hover { background: var(--bg-soft); }
.tr-dialog-body { padding: 20px 24px 24px; }
.tr-dialog-body .lc-form-grid { gap: 14px; }
.tr-dialog-body .vc-input { padding: 12px 14px; }
.tr-dialog .tr-alert { margin-top: 14px; }
.tr-privacy { margin-top: 14px; font-size: 13px; color: var(--muted); line-height: 1.55; }
.tr-privacy i { color: var(--brand); margin-right: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .tr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
    .tr-filters { grid-template-columns: 1fr 1fr; }
    .tr-filters > .tr-f-skills { grid-column: 1 / -1; order: 3; }
    .tr-filters-row2 { order: 4; }
    .tr-profile-grid { grid-template-columns: 1fr; }
    .tr-contact-card { position: static; }
}
@media (max-width: 680px) {
    .tr-grid { grid-template-columns: 1fr; }
    .tr-filters { grid-template-columns: 1fr; padding: 16px; }
    .tr-filters-row2 { flex-direction: column; align-items: stretch; }
    .tr-filters-row2 .tr-select { width: 100%; }
    .tr-seg { display: flex; }
    .tr-seg button { flex: 1; }
    .tr-filters-clear { margin-left: 0; }
    .tr-facts { grid-template-columns: 1fr 1fr; }
    .tr-facts .tr-fact:last-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .lc-form-grid { grid-template-columns: 1fr; }
    .tr-avatar--lg { width: 68px; height: 68px; font-size: 24px; }
    .tr-contact-actions { grid-template-columns: 1fr; }
    .tr-dialog { width: calc(100% - 20px); border-radius: 20px; }
    .tr-dialog-head { padding: 20px 18px 0; }
    .tr-dialog-body { padding: 18px 18px 20px; }
    .tr-step-actions .lc-btn { width: 100%; }
    .tr-otp { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .tr-skel .bar, .tr-skel .tr-avatar { animation: none; }
    .tr-card, .tr-card:hover { transition: none; transform: none; }
}
