/* ===== Team page: shared ===== */
.team-area { padding: 90px 0 60px; }
.tm-col { margin-bottom: 30px; display: flex; }
.tm-card { position: relative; width: 100%; background: #fff; color: #4F6168; }
.tm-name { font-size: 22px; line-height: 1.3; color: #042E3C; margin: 0 0 4px; font-weight: 700; }
.tm-role { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0; line-height: 1.5; }
.tm-bio { font-size: 15px; line-height: 1.7; color: #4F6168; font-weight: 300; margin: 16px 0 0; }
.tm-empty { text-align: center; color: #6f8288; padding: 40px 0; }

.tm-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.tm-photo--initials {
    display: flex; align-items: center; justify-content: center; font-size: 56px; font-weight: 700; letter-spacing: 2px;
    color: rgba(255, 255, 255, .92); background: linear-gradient(150deg, var(--accent) 0%, #042E3C 100%);
}

.tm-icon { width: 16px; height: 16px; display: block; }
.tm-contacts { list-style: none; padding: 0; margin: 18px 0 0; font-size: 14px; }
.tm-contacts li { display: flex; align-items: center; gap: 10px; padding: 6px 0; min-width: 0; }
.tm-contacts__ico { flex: 0 0 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent); }
.tm-contacts__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* for screen readers */
.tm-contacts__val { color: #042E3C; overflow-wrap: anywhere; min-width: 0; }
a.tm-contacts__val:hover { color: var(--accent); }

.tm-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; }
.tm-qr .qr-code { width: 96px; height: 96px; display: block; background: #fff; }
.tm-qr__cap { font-size: 11px; color: #9a8a8a; letter-spacing: .3px; text-align: center; max-width: 120px; line-height: 1.3; }
.tm-qr--center { margin: 22px auto 0; }

/* ===== 1. Classic portrait ===== */
.tm-classic { border: 1px solid #DDE7EA; display: flex; flex-direction: column; transition: box-shadow .4s, transform .4s; }
.tm-classic:hover { box-shadow: 0 18px 40px rgba(4,46,60,.09); transform: translateY(-4px); }
.tm-classic__media { aspect-ratio: 4 / 4.4; overflow: hidden; }
.tm-classic__media .tm-photo { transition: transform .8s ease; }
.tm-classic:hover .tm-classic__media .tm-photo { transform: scale(1.04); }
.tm-classic__body { padding: 26px 26px 24px; display: flex; flex-direction: column; flex: 1; border-top: 3px solid var(--accent); }
.tm-classic__foot { margin-top: auto; padding-top: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.tm-classic__foot .tm-contacts { margin: 0; flex: 1; min-width: 0; }
.tm-classic .tm-qr .qr-code { width: 84px; height: 84px; }

/* ===== 2. ID badge ===== */
.tm-badge { border-radius: 22px; border: 1px solid #DDE7EA; padding: 34px 16px 0; overflow: hidden; text-align: center;
    box-shadow: 0 14px 34px rgba(4,46,60,.07); display: flex; flex-direction: column; }
.tm-badge__slot { position: absolute; top: 12px; left: 50%; width: 54px; height: 9px; margin-left: -27px; border-radius: 9px;
    background: #E5EDEF; box-shadow: inset 0 1px 2px rgba(4,46,60,.15); }
.tm-badge__media { position: relative; aspect-ratio: 4 / 3.7; border-radius: 16px; overflow: hidden; }
.tm-badge__wave { position: absolute; left: 0; bottom: -1px; width: 72%; height: 30%; fill: #fff; }
.tm-badge__logo { position: absolute; left: 14px; bottom: 12px; width: auto; height: 24px; }
.tm-badge__body { padding: 22px 12px 74px; flex: 1; display: flex; flex-direction: column; align-items: center; }
.tm-badge .tm-name { font-size: 25px; }
.tm-badge__pill { display: inline-block; margin-top: 8px; padding: 6px 18px; border-radius: 8px; font-size: 14px; font-weight: 700;
    background: var(--accent); color: var(--accent-ink); }
.tm-badge .tm-contacts { text-align: left; align-self: stretch; padding: 0 8px; }
.tm-badge .tm-qr--center { margin-top: auto; padding-top: 20px; }
.tm-badge__corner { position: absolute; right: 0; bottom: 0; width: 46%; height: 52px; fill: var(--accent); opacity: .95; }

/* ===== 3. Photo overlay ===== */
.tm-overlay { aspect-ratio: 3 / 4.1; overflow: hidden; outline: none; background: #042E3C; }
.tm-overlay > .tm-photo { position: absolute; inset: 0; transition: transform .8s ease, filter .6s; }
.tm-overlay__panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 90px 26px 24px; color: #fff;
    background: linear-gradient(to top, rgba(4,46,60,.96) 0%, rgba(4,46,60,.85) 55%, rgba(4,46,60,0) 100%); }
.tm-overlay .tm-name { color: #fff; }
.tm-overlay .tm-role { color: color-mix(in srgb, var(--accent) 45%, #fff); }
.tm-overlay .tm-bio { color: rgba(255, 255, 255, .85); }
.tm-overlay__more { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .6s ease, opacity .4s ease; }
.tm-overlay:hover .tm-overlay__more, .tm-overlay:focus-within .tm-overlay__more { max-height: 520px; opacity: 1; }
.tm-overlay:hover > .tm-photo, .tm-overlay:focus-within > .tm-photo { transform: scale(1.05); filter: blur(1px) brightness(.8); }
.tm-overlay__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 4px; }
.tm-overlay .tm-contacts { flex: 1; min-width: 0; }
.tm-overlay .tm-contacts__ico { background: rgba(255, 255, 255, .12); color: #fff; }
.tm-overlay .tm-contacts__val { color: #fff; }
.tm-qr--light .qr-code { padding: 4px; border-radius: 6px; width: 80px; height: 80px; }
.tm-qr--light .tm-qr__cap { color: rgba(255, 255, 255, .7); }
/* Touch screens have no hover: show everything below the photo instead. */
@media (hover: none) {
    .tm-overlay { aspect-ratio: auto; background: #fff; }
    .tm-overlay > .tm-photo { position: relative; aspect-ratio: 4 / 4.2; }
    .tm-overlay__panel { position: relative; padding: 22px 24px; background: #042E3C; }
    .tm-overlay__more { max-height: none; opacity: 1; }
}

/* ===== 4. Minimal elegant ===== */
.tm-minimal { text-align: center; padding: 40px 30px 32px; border: 1px solid #DDE7EA; border-top: 2px solid var(--accent);
    display: flex; flex-direction: column; align-items: center; transition: box-shadow .4s; }
.tm-minimal:hover { box-shadow: 0 18px 40px rgba(4,46,60,.07); }
.tm-minimal__photo { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; margin-bottom: 22px;
    box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--accent); }
.tm-minimal__photo .tm-photo--initials { font-size: 42px; }
.tm-minimal .tm-role { font-variant: small-caps; text-transform: none; letter-spacing: 2px; font-size: 15px; }
.tm-minimal__rule { width: 40px; height: 1px; background: var(--accent); margin: 18px auto 0; }
.tm-minimal .tm-bio { font-style: italic; }
.tm-minimal .tm-contacts { align-self: stretch; text-align: left; border-top: 1px solid #E5EDEF; padding-top: 14px; }
.tm-qr--framed { margin-top: auto; padding-top: 22px; }
.tm-qr--framed .qr-code { padding: 8px; border: 1px solid #DDE7EA; width: 104px; height: 104px; }

/* ===== 5. Flip card ===== */
.tm-flip { background: transparent; perspective: 1400px; min-height: 600px; }
.tm-flip__inner { position: relative; width: 100%; height: 100%; min-height: inherit; transition: transform .8s cubic-bezier(.2, .7, .2, 1); transform-style: preserve-3d; }
.tm-flip.is-flipped .tm-flip__inner { transform: rotateY(180deg); }
.tm-flip__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    border: 1px solid #DDE7EA; background: #fff; overflow: hidden; }
.tm-flip__front { display: flex; flex-direction: column; }
.tm-flip__front .tm-photo { flex: 1; min-height: 0; }
.tm-flip__caption { padding: 22px 24px; text-align: center; border-top: 3px solid var(--accent); position: relative; }
.tm-flip__back { transform: rotateY(180deg); padding: 34px 28px 24px; display: flex; flex-direction: column; overflow-y: auto;
    background: linear-gradient(180deg, #fff 0%, #FBF7F7 100%); }
.tm-flip__back .tm-name { font-size: 20px; }
.tm-flip__back .tm-qr--center { margin-top: auto; padding-top: 18px; }
.tm-flip__btn { margin-top: 14px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer;
    padding: 7px 18px; border-radius: 30px; font-size: 13px; font-weight: 600; letter-spacing: .5px; transition: background .3s, color .3s; }
.tm-flip__btn:hover, .tm-flip__btn:focus-visible { background: var(--accent); color: var(--accent-ink); }
.tm-flip__btn--back { position: absolute; top: 12px; right: 12px; margin: 0; width: 34px; height: 34px; padding: 0; font-size: 16px; }

/* ===== Design preview page (staff only) ===== */
.tm-preview { padding-top: 60px; }
.tm-preview__intro { max-width: 760px; margin: 0 auto 50px; text-align: center; }
.tm-preview__intro h1 { font-size: 40px; color: #042E3C; }
.tm-preview__toc { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.tm-preview__toc a { border: 1px solid #DDE7EA; padding: 6px 14px; border-radius: 20px; font-size: 14px; color: #042E3C; }
.tm-preview__toc a:hover { border-color: var(--accent); color: var(--accent); }
.tm-preview__design { padding: 40px 0 20px; border-top: 1px solid #DDE7EA; scroll-margin-top: 90px; }
.tm-preview__head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.tm-preview__head h2 { font-size: 28px; color: #042E3C; margin: 0 0 6px; }
.tm-preview__head p { margin: 0; }
.tm-preview__head .btn { padding: 16px 28px; }
.tm-preview__current { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 3px 12px; border-radius: 20px;
    font-size: 13px; background: #e6f6ec; color: #1c7b40; font-family: "Roboto", sans-serif; }

@media (max-width: 575px) {
    .team-area { padding: 60px 0 30px; }
    .tm-flip { min-height: 580px; }
}
