/* Terminalul ELECTRIC v1.5 (app/terminal.js) — ecran întreg pe tabletă: butoane mari, text mare, fără derulare pe orizontală */
.tm-home { gap: 8px; }
.tm-home .term-clock { font-size: clamp(56px, 10vw, 120px); }
.tm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: min(1100px, 100%); margin-top: 14px; }
.tm-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 190px; padding: 20px 14px; border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .07); color: #fff; cursor: pointer; text-align: center; font: inherit; -webkit-tap-highlight-color: transparent; }
.tm-tile:active { transform: scale(.985); background: rgba(255, 255, 255, .14); }
.tm-tile .ic { width: 78px; height: 78px; border-radius: 18px; background: #fff; color: #172131; display: flex; align-items: center; justify-content: center; }
.tm-tile.face .ic { background: #dff3e8; color: #1a5c35; }
.tm-tile b { font-size: clamp(20px, 2.4vw, 27px); font-weight: 800; line-height: 1.15; }
.tm-tile small { font-size: clamp(14px, 1.6vw, 17px); color: rgba(255, 255, 255, .72); line-height: 1.3; }
.tm-tile.off, .tm-tile:disabled { opacity: .42; cursor: default; }
.tm-tile.off .ic { background: rgba(255, 255, 255, .5); }
.tm-hint { margin: 10px 0 0; max-width: 900px; text-align: center; font-size: clamp(14px, 1.6vw, 17px); color: rgba(255, 255, 255, .62); }
.tm-clock-sm { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.tm-h { margin: 0; font-size: clamp(22px, 2.8vw, 30px); font-weight: 800; text-align: center; }
.tm-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.tm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; min-width: 150px; padding: 0 24px; border-radius: 16px;
  border: 0; background: #fff; color: #172131; font: inherit; font-size: 20px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tm-btn.ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.tm-btn:active { transform: scale(.98); }
/* căutarea după nume / marcă */
.tm-who { justify-content: flex-start; padding-top: 14px; gap: 10px; }
.tm-search { width: min(760px, 100%); min-height: 64px; padding: 10px 18px; border-radius: 14px; background: #fff; color: #172131; font-size: 30px; font-weight: 800; letter-spacing: 1.5px;
  display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
.tm-search .ph { font-size: 18px; font-weight: 600; letter-spacing: 0; color: #6b7686; white-space: normal; }
.tm-matches { width: min(760px, 100%); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 64px; }
.tm-match { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 8px 14px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08); color: #fff; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.tm-match b { font-size: 20px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-match small { font-size: 14px; color: rgba(255, 255, 255, .7); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-match:active { background: rgba(255, 255, 255, .2); }
.tm-none { grid-column: 1 / -1; padding: 14px; text-align: center; font-size: 18px; color: #ffd27a; }
.tm-kb { width: min(860px, 100%); display: flex; flex-direction: column; gap: 6px; }
.tm-kb-row { display: flex; gap: 6px; justify-content: center; }
.tm-key { flex: 1 1 0; max-width: 78px; min-width: 0; height: 58px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-size: 24px; font-weight: 800; cursor: pointer; }
.tm-key.wide { max-width: 220px; font-size: 18px; }
.tm-key:active { background: rgba(255, 255, 255, .32); }
/* PIN */
.tm-pinscr { gap: 10px; }
.tm-who-sel { text-align: center; }
.tm-who-sel b { display: block; font-size: clamp(24px, 3vw, 34px); font-weight: 800; text-transform: uppercase; }
.tm-who-sel small { display: block; font-size: 16px; color: rgba(255, 255, 255, .7); max-width: 720px; }
.tm-pin { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tm-pin-lbl { font-size: 18px; color: rgba(255, 255, 255, .8); text-align: center; max-width: 560px; }
.tm-dots { display: flex; gap: 14px; }
.tm-dots i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .6); }
.tm-dots i.on { background: #fff; border-color: #fff; }
.tm-pad { display: grid; grid-template-columns: repeat(3, 96px); gap: 10px; }
.tm-pk { height: 76px; border-radius: 16px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-size: 34px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tm-pk.del { font-size: 26px; background: rgba(255, 255, 255, .07); }
.tm-pk:active { background: rgba(255, 255, 255, .34); }
.tm-err { padding: 10px 16px; border-radius: 12px; background: #5a1410; color: #ffd6d1; font-size: 19px; font-weight: 700; text-align: center; max-width: 640px; }
/* operațiunile */
.tm-ops { gap: 14px; }
.tm-person { display: flex; align-items: center; gap: 18px; width: min(900px, 100%); }
.tm-person b { display: block; font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; text-transform: uppercase; line-height: 1.1; overflow-wrap: anywhere; }
.tm-person small { display: block; font-size: clamp(16px, 2vw, 20px); color: rgba(255, 255, 255, .78); margin-top: 4px; }
.term-ph.sm { width: 92px; height: 110px; font-size: 36px; flex: none; }
.tm-opgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: min(1000px, 100%); }
.tm-opgrid.n1 { grid-template-columns: minmax(0, 420px); justify-content: center; }
.tm-opgrid.n2, .tm-opgrid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tm-op { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 130px; padding: 14px; border-radius: 20px; border: 3px solid transparent;
  color: #fff; font: inherit; font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; text-align: center; line-height: 1.15; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tm-op.in { background: #1d5a33; } .tm-op.out { background: #24497c; } .tm-op.brk { background: #6a4a0c; } .tm-op.svc { background: #3d3b6e; }
.tm-op.sug { border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); }
.tm-op:active { transform: scale(.985); filter: brightness(1.15); }
.tm-op:disabled { opacity: .5; }
/* camera pentru recunoașterea facială (terminal + înscriere) */
.fc-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fc-frame { position: relative; width: min(480px, 86vw); aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #000; }
.fc-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.fc-oval { position: absolute; left: 50%; top: 50%; width: 46%; height: 78%; transform: translate(-50%, -50%); border-radius: 50%; border: 4px dashed rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
.fc-box.good .fc-oval { border-style: solid; border-color: #3ccf7c; }
.fc-box.bad .fc-oval { border-color: #ff6b5e; }
.fc-txt { text-align: center; }
.fc-txt b { display: block; font-size: 22px; font-weight: 800; }
.fc-txt b.bad { color: #ffb3ab; max-width: 640px; }
.fc-txt small { display: block; font-size: 15px; opacity: .72; }
.fc-box:not(.dark) .fc-txt b { font-size: 16px; }
.fc-box:not(.dark) .fc-frame { width: min(400px, 100%); }
@media (max-width: 900px) {
  .tm-tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 560px; }
  .tm-tile { min-height: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: center; justify-items: start; text-align: left; padding: 14px 16px; }
  .tm-tile .ic { width: 64px; height: 64px; grid-row: span 2; }
  .tm-opgrid, .tm-opgrid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-op { min-height: 110px; }
}
@media (max-width: 560px) {
  .tm-matches { grid-template-columns: minmax(0, 1fr); }
  .tm-key { height: 50px; font-size: 20px; }
  .tm-pad { grid-template-columns: repeat(3, 84px); }
  .tm-pk { height: 66px; }
  .tm-opgrid, .tm-opgrid.n2, .tm-opgrid.n4 { grid-template-columns: minmax(0, 1fr); }
}
/* portret (tabletă verticală): tastatura mai jos, fără derulare inutilă */
@media (max-height: 700px) and (orientation: landscape) {
  .tm-tile { min-height: 150px; }
  .tm-key { height: 48px; }
  .tm-pk { height: 62px; }
  .tm-op { min-height: 104px; }
  .term-top { padding: 8px 16px; }
}
/* tasta „OK” (PIN-uri din versiunile vechi, cu lungime necunoscută) */
.tm-pk.ok { font-size: 26px; background: #1f8f4e; }
.tm-pk.ok:disabled { background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .3); cursor: default; }
/* v1.5.1: „Cum se folosește tableta?” */
.tm-helpbtn { margin: 6px auto 0; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .06); color: #fff; font: inherit; font-size: 17px; font-weight: 650; cursor: pointer; }
.tm-help { max-width: 900px; margin: 0 auto; width: 100%; overflow-y: auto; }
.tm-help-steps { margin: 6px 0 12px; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 10px; }
.tm-help-steps li { position: relative; padding: 12px 14px 12px 60px; border-radius: 14px; background: rgba(255, 255, 255, .08); counter-increment: st; font-size: 18px; line-height: 1.4; }
.tm-help-steps li::before { content: counter(st); position: absolute; left: 14px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand, #e02a00);
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tm-help-steps li span { color: rgba(255, 255, 255, .82); }
.tm-help-faq { margin: 0 0 12px; padding-left: 22px; font-size: 16px; line-height: 1.45; color: rgba(255, 255, 255, .85); }
.tm-help-faq li { margin: 4px 0; }
.tm-help-faq b { color: #fff; }
@media (max-width: 700px) { .tm-help-steps li { font-size: 16px; padding-left: 54px; } }
/* v1.6.2: două plăci (fără recunoaștere facială) pe lat; pe tableta verticală plăcile urcă, sunt mai mari, ajutorul jos */
.tm-tiles.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(860px, 100%); }
@media (max-width: 900px) { .tm-tiles.n2 { grid-template-columns: minmax(0, 1fr); } }
@media (orientation: portrait) and (min-height: 860px) and (min-width: 560px) {
  .tm-home { justify-content: flex-start; padding-top: 5vh; gap: 6px; }
  .tm-home .term-clock { font-size: clamp(90px, 16vw, 160px); }
  .tm-home .term-date { font-size: clamp(20px, 3vw, 28px); }
  .tm-tiles, .tm-tiles.n2, .tm-tiles.n3 { grid-template-columns: minmax(0, 1fr); width: min(700px, 100%); max-width: none; gap: 18px; margin-top: 5vh; }
  .tm-tile { min-height: 180px; display: grid; grid-template-columns: 100px minmax(0, 1fr); column-gap: 24px; row-gap: 4px; align-items: center; justify-items: start;
    text-align: left; padding: 24px 28px; border-radius: 26px; }
  .tm-tile .ic { width: 100px; height: 100px; border-radius: 22px; grid-row: span 2; }
  .tm-tile .ic svg { width: 54px; height: 54px; }
  .tm-tile b { font-size: 34px; }
  .tm-tile small { font-size: 20px; }
  .tm-hint { font-size: 18px; margin-top: 3vh; max-width: 640px; }
  .tm-helpbtn { margin-top: auto; margin-bottom: 2vh; font-size: 19px; padding: 14px 24px; }
}
/* v1.6.2: autorizarea tabletei cu codul de la birou */
.tm-pair { justify-content: flex-start; padding-top: 4vh; }
.tm-pair .tm-hint { max-width: 560px; }
.term-lost .tm-btn { margin: 4px 0; }
/* v1.6.4: „Cine ești?” — tastatura fixă, jos pe ecran (ca la telefon); doar zona de sus se schimbă când apar numele */
.tm-who { justify-content: space-between; gap: 0; padding-bottom: 12px; }
.tm-who-top { flex: 1 1 auto; min-height: 0; width: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tm-who-kb { flex: none; width: 100%; display: flex; flex-direction: column; align-items: center; padding-top: 10px; }
.tm-who-kb .tm-row { margin-top: 8px; }
@media (orientation: portrait) and (min-height: 860px) and (min-width: 560px) {
  .tm-who .tm-kb { gap: 8px; }
  .tm-who .tm-kb-row { gap: 8px; }
  .tm-who .tm-key { height: 70px; max-width: 86px; font-size: 26px; }
  .tm-who .tm-key.wide { max-width: 240px; font-size: 20px; }
}
/* pe lat: numele pe trei coloane (șase nume în două rânduri), deasupra tastaturii */
@media (orientation: landscape) and (min-width: 900px) {
  .tm-who .tm-search, .tm-who .tm-matches { width: min(1040px, 100%); }
  .tm-who .tm-matches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tm-who .tm-match { min-height: 58px; padding: 6px 12px; }
  .tm-who .tm-match b { font-size: 18px; }
}
/* tabletă mică, pe lat: totul mai scund, ca numele să încapă deasupra tastaturii */
@media (orientation: landscape) and (max-height: 700px) {
  .tm-who { padding-top: 6px; padding-bottom: 6px; }
  .tm-who-top { gap: 6px; }
  .tm-who .tm-h { font-size: 20px; }
  .tm-who .tm-search { min-height: 46px; padding: 6px 14px; font-size: 24px; }
  .tm-who .tm-match { min-height: 48px; padding: 4px 12px; }
  .tm-who .tm-match b { font-size: 17px; }
  .tm-who .tm-match small { font-size: 12.5px; }
  .tm-who-kb { padding-top: 6px; }
  .tm-who .tm-kb, .tm-who .tm-kb-row { gap: 5px; }
  .tm-who .tm-key { height: 44px; }
  .tm-who-kb .tm-row { margin-top: 6px; }
  .tm-who-kb .tm-btn { min-height: 48px; }
}
