/* Mentor portal (templates/mentor/) — sits on top of portal.css's tokens
   and components (buttons, fields, panels, modals, badges). */

/* ---------- Top bar ---------- */
.m-bar { position: sticky; top: 0; z-index: 20; background: rgba(246, 247, 251, 0.88); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.m-bar__in { max-width: 1160px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.m-brand { display: inline-flex; align-items: center; gap: 10px; }
.m-brand .brand__logo { height: 40px; }
.m-brand__tag { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.01em; }
.m-nav { display: flex; gap: 4px; flex: 1 1 auto; }
.m-nav a { padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.m-nav a:hover { background: rgba(22, 24, 42, 0.05); color: var(--text); }
.m-nav a[aria-current="page"] { background: var(--brand-10); color: var(--brand-pale); font-weight: 600; }
.m-bar__end { display: flex; align-items: center; gap: 12px; }
.m-bar__name { font-size: 14px; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.m-main { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 36px 24px 64px;
  display: flex; flex-direction: column; gap: 24px; }
.m-main--narrow { max-width: 760px; }
.m-foot { position: relative; z-index: 1; text-align: center; color: var(--faint); font-size: 13px; padding: 0 16px 32px; }

.m-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; }
.m-hero h1 { font-family: var(--font-display); font-weight: 800; font-size: 38px; line-height: 1.05; letter-spacing: -0.03em; }
.m-hero p { margin-top: 8px; max-width: 560px; color: var(--muted); }
.m-search { display: flex; gap: 8px; flex: 0 1 380px; }

/* ---------- Mentor cards ---------- */
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.m-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 20px; background: #FFFFFF;
  border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(22, 24, 42, 0.05); color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
a.m-card:hover { color: inherit; border-color: var(--brand-45); box-shadow: 0 14px 34px rgba(52, 83, 254, 0.10); transform: translateY(-2px); }
.m-card__top { display: flex; gap: 14px; align-items: center; }
.m-card__name { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.2; }
.m-card__role { font-size: 14px; color: var(--muted); }
.m-card__bio { font-size: 14px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-card__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.m-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--brand-14); }
.m-photo--lg { width: 112px; height: 112px; }
.m-photo--sm { width: 44px; height: 44px; }
.m-initials { display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: var(--brand-pale); }
.m-photo.m-initials { font-size: 22px; }
.m-photo--lg.m-initials { font-size: 38px; }
.m-photo--sm.m-initials { font-size: 15px; }

/* ---------- Mentor profile ---------- */
.m-profile { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.m-profile__head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.m-profile__head h1 { font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1.1; letter-spacing: -0.02em; }
.m-bio { white-space: pre-line; color: var(--text-2); line-height: 1.65; }
.m-side { position: sticky; top: 88px; }
.m-checklist { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.m-checklist li { display: flex; gap: 8px; align-items: center; color: var(--text-2); }
.m-checklist li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pending); flex-shrink: 0; }

.m-alert { padding: 12px 16px; border-radius: 14px; font-size: 14px; background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.m-ok { padding: 12px 16px; border-radius: 14px; font-size: 14px; background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }

/* ---------- Requests (both sides) ---------- */
.m-section-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.m-count { font-family: var(--font-mono); font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--brand-10); color: var(--brand-pale); }
.m-req { display: flex; flex-direction: column; gap: 14px; }
.m-req__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.m-req__who { display: flex; gap: 14px; align-items: center; min-width: 0; }
.m-req__note { padding: 12px 14px; border-radius: 12px; background: rgba(22, 24, 42, 0.03); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); white-space: pre-line; }
.m-kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 14px; font-size: 14px; }
.m-kv dt { color: var(--faint); }
.m-kv dd { margin: 0; color: var(--text-2); white-space: pre-line; }
.m-empty { padding: 28px; text-align: center; color: var(--faint); border: 1px dashed var(--line-3); border-radius: 18px; font-size: 14px; }

/* Slot picker (student) */
.m-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.m-slot { position: relative; }
.m-slot input { position: absolute; opacity: 0; pointer-events: none; }
.m-slot span { display: block; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-3); background: #FFFFFF; cursor: pointer;
  font-size: 14px; font-weight: 500; transition: border-color .15s ease, background-color .15s ease; }
.m-slot input:checked + span { border-color: var(--brand); background: var(--brand-10); color: var(--brand-pale); font-weight: 600; }
.m-slot input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.m-slot input:disabled + span { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }

/* Date/time picker (mentor's accept popup) */
.m-days { display: flex; flex-direction: column; gap: 14px; }
.m-day { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; align-items: end; }
.m-day .field > label { font-size: 12px; }

.m-booked { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; }
.m-booked strong { font-family: var(--font-display); font-size: 18px; }

/* ---------- Apply form ---------- */
.m-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.m-form-grid .full { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .m-profile { grid-template-columns: minmax(0, 1fr); }
  .m-side { position: static; }
}
@media (max-width: 760px) {
  .m-bar__in { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .m-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .m-bar__end { margin-left: auto; }
  .m-bar__name { display: none; }
  .m-main { padding: 24px 16px 48px; }
  .m-hero h1 { font-size: 30px; }
  .m-search { flex-basis: 100%; }
  .m-form-grid { grid-template-columns: 1fr; }
  .m-day { grid-template-columns: 1fr 1fr; }
  .m-day .field:first-child { grid-column: 1 / -1; }
  .m-kv { grid-template-columns: 1fr; gap: 2px; }
  .m-kv dd { margin-bottom: 8px; }
}
