/* msab 2026-11-16 auth: redesigned sign-in modal (#login_block.msab-au) + compact Google invite (.msab-gi).
   Scope: only these two components. Rollback: remove the link/script tags in templates/index.html and restore
   /msab_bak_20261116_auth/index.html.orig. Colours follow mobile-v2 tokens (teal #2bcbc3, navy #273445, ink #131a24). */

/* ---------- 1. sign-in modal ---------- */
.jquery-modal .modal#login_block.msab-au { width: 92%; max-width: 420px; padding: 22px 22px 18px; border-radius: 20px; background: #fff; box-shadow: 0 18px 50px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08); box-sizing: border-box; text-align: left; color: #2b3442; font-family: MuseoSans, Arial, sans-serif; outline: none; max-height: calc(100dvh - 24px); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.jquery-modal .modal#login_block.msab-au:focus, .jquery-modal .modal#login_block.msab-au:focus-visible { outline: none; } /* the card only receives programmatic focus; the visible focus ring stays on the controls */
.msab-au * { box-sizing: border-box; }
.msab-au .msab-au__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding-right: 44px; margin-bottom: 14px; }
.msab-au .msab-au__logo img { display: block; height: 34px; width: auto; }
.jquery-modal .modal#login_block.msab-au a.close-modal { top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid #e6e9ee; background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23273445' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") no-repeat center / 16px 16px; text-indent: -9999px; overflow: hidden; }
.jquery-modal .modal#login_block.msab-au a.close-modal:hover { background-color: #f4f6f8; }
.jquery-modal .modal#login_block.msab-au a.close-modal:focus-visible { outline: 2px solid #2bcbc3; outline-offset: 2px; }
.msab-au .msab-au__h { margin: 0 0 4px; font-size: 22px; line-height: 1.25; font-weight: 800; color: #273445; }
.msab-au .msab-au__sub { margin: 0 0 16px; font-size: 14px; line-height: 1.4; color: #6b7280; }
.msab-au .msab-au__g { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid #dadce0; border-radius: 12px; background: #fff; color: #1f1f1f; font-size: 15px; font-weight: 600; text-decoration: none; transition: background-color .15s, box-shadow .15s; }
.msab-au .msab-au__g:hover { background: #f8fafd; box-shadow: 0 1px 4px rgba(60, 64, 67, .2); }
.msab-au .msab-au__g:focus-visible { outline: 2px solid #2bcbc3; outline-offset: 2px; }
.msab-au .msab-au__g svg { width: 20px; height: 20px; flex: 0 0 20px; }
.msab-au .msab-au__or { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; color: #6b7280; font-size: 13px; }
.msab-au .msab-au__or::before, .msab-au .msab-au__or::after { content: ""; flex: 1 1 auto; height: 1px; background: #e6e9ee; }
.msab-au .msab-au__f { margin: 0 0 12px; }
.msab-au .msab-au__l { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #273445; }
.msab-au .msab-au__pw { position: relative; }
.jquery-modal .modal#login_block.msab-au input.msab-au__in { display: block; width: 100%; min-height: 46px; margin: 0; padding: 10px 14px; border: 1px solid #d9dee5; border-radius: 12px; background: #fff; color: #131a24; font: inherit; font-size: 16px; line-height: 1.3; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; }
.jquery-modal .modal#login_block.msab-au .msab-au__pw input.msab-au__in { padding-right: 48px; }
.jquery-modal .modal#login_block.msab-au input.msab-au__in::placeholder { color: #9aa3ae; }
.jquery-modal .modal#login_block.msab-au input.msab-au__in:focus { outline: none; border-color: #2bcbc3; box-shadow: 0 0 0 3px rgba(43, 203, 195, .25); }
.msab-au .msab-au__f.is-err input.msab-au__in { border-color: #e0324b; }
.msab-au .msab-au__eye { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 40px; height: 40px; padding: 0; margin: 0; border: 0; border-radius: 10px; background: transparent; color: #6b7280; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.msab-au .msab-au__eye:hover { color: #273445; background: #f4f6f8; }
.msab-au .msab-au__eye:focus-visible { outline: 2px solid #2bcbc3; outline-offset: -2px; }
.msab-au .msab-au__eye svg { width: 20px; height: 20px; }
.msab-au .msab-au__eye .msab-au__eye-off { display: none; }
.msab-au .msab-au__eye[aria-pressed="true"] .msab-au__eye-on { display: none; }
.msab-au .msab-au__eye[aria-pressed="true"] .msab-au__eye-off { display: block; }
.msab-au .msab-au__err { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: #fdecef; color: #b3122b; font-size: 13px; line-height: 1.4; }
.msab-au .msab-au__err--top { margin: 0 0 12px; }
.msab-au .msab-au__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 14px; font-size: 14px; }
.msab-au .msab-au__rem { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #2b3442; cursor: pointer; font-weight: 400; font-size: 14px; }
.msab-au .msab-au__rem input { width: 18px; height: 18px; margin: 0; accent-color: #2bcbc3; flex: 0 0 18px; }
.msab-au .msab-au__forgot { color: #1fa39c; font-weight: 700; text-decoration: none; }
.msab-au .msab-au__forgot:hover { text-decoration: underline; }
.msab-au .msab-au__forgot:focus-visible, .msab-au .msab-au__reg:focus-visible { outline: 2px solid #2bcbc3; outline-offset: 2px; border-radius: 4px; }
.jquery-modal .modal#login_block.msab-au .msab-au__btn { display: block; width: 100%; min-height: 48px; margin: 0; padding: 12px 16px; border: 0; border-radius: 12px; background: #2bcbc3; color: #fff; font: inherit; font-size: 16px; font-weight: 800; letter-spacing: .01em; cursor: pointer; transition: background-color .15s, opacity .15s; }
.jquery-modal .modal#login_block.msab-au .msab-au__btn:hover { background: #1fa39c; }
.jquery-modal .modal#login_block.msab-au .msab-au__btn:focus-visible { outline: 2px solid #273445; outline-offset: 2px; }
.jquery-modal .modal#login_block.msab-au .msab-au__btn[disabled], .jquery-modal .modal#login_block.msab-au .msab-au__btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.msab-au .msab-au__foot { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid #eef1f4; text-align: center; font-size: 14px; color: #6b7280; }
.msab-au .msab-au__reg { color: #1fa39c; font-weight: 700; text-decoration: none; }
.msab-au .msab-au__reg:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .jquery-modal .modal#login_block.msab-au { width: 100%; padding: 18px 16px 16px; border-radius: 18px; max-height: calc(100dvh - 16px); }
  .msab-au .msab-au__h { font-size: 20px; }
}
@media (max-height: 560px) {
  .jquery-modal .modal#login_block.msab-au { padding-top: 14px; }
  .msab-au .msab-au__top { margin-bottom: 8px; }
  .msab-au .msab-au__sub { margin-bottom: 10px; }
  .msab-au .msab-au__or { margin: 10px 0; }
}

/* ---------- 2. compact Google invite ---------- */
.msab-gi { position: fixed; z-index: 28500; box-sizing: border-box; width: 300px; max-width: calc(100vw - 24px); padding: 16px 16px 14px; border: 1px solid #e6e9ee; border-radius: 18px; background: #fff; box-shadow: 0 14px 40px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06); color: #2b3442; font-family: MuseoSans, Arial, sans-serif; opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.msab-gi.is-on { opacity: 1; transform: none; }
.msab-gi * { box-sizing: border-box; }
.msab-gi__logo { display: block; height: 22px; width: auto; margin-bottom: 8px; }
.msab-gi__x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; padding: 0; margin: 0; border: 0; border-radius: 50%; background: transparent url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") no-repeat center / 14px 14px; cursor: pointer; text-indent: -9999px; overflow: hidden; }
.msab-gi__x:hover { background-color: #f4f6f8; }
.msab-gi__x:focus-visible { outline: 2px solid #2bcbc3; outline-offset: 1px; }
.msab-gi__h { margin: 0 32px 2px 0; font-size: 16px; line-height: 1.3; font-weight: 800; color: #273445; }
.msab-gi__p { margin: 0 0 12px; font-size: 13px; line-height: 1.4; color: #6b7280; }
.msab-gi__g { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #dadce0; border-radius: 12px; background: #fff; color: #1f1f1f; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .15s, box-shadow .15s; }
.msab-gi__g:hover { background: #f8fafd; box-shadow: 0 1px 4px rgba(60, 64, 67, .2); }
.msab-gi__g:focus-visible { outline: 2px solid #2bcbc3; outline-offset: 2px; }
.msab-gi__g svg { width: 18px; height: 18px; flex: 0 0 18px; }
@media (min-width: 1025px) {
  .msab-gi { top: var(--msab-gi-top, 16px); right: 16px; }
}
@media (max-width: 1024px) {
  .msab-gi { left: 12px; right: 12px; width: auto; max-width: 480px; margin: 0 auto; bottom: calc(var(--msab-gi-nav, 0px) + 12px + env(safe-area-inset-bottom, 0px)); padding: 14px 14px 12px; }
  /* while the invite is up, the floating «Написати» / «up» buttons step above it so nothing is covered */
  body.msab-gi-on .mv-msg-btn, body.msab-gi-on .msab-totop { transform: translateY(calc(-1 * var(--msab-gi-h, 0px))); transition: transform .25s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .msab-gi, body.msab-gi-on .mv-msg-btn, body.msab-gi-on .msab-totop { transition: none; }
}
