/* Вход, регистрация, приглашения (views/auth/*) — в стиле кабинета: логотип над карточкой, фирменные кнопки и ссылки,
   мягкий фон, на телефоне — карточка во всю ширину с полями. */
body.gt-auth { background: #f5f7ff !important; flex-direction: column !important; gap: 22px; padding: 28px 16px calc(28px + env(safe-area-inset-bottom, 0px)) !important; font-family: 'Inter', system-ui, -apple-system, sans-serif; overflow-x: hidden; }
.gt-auth-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.gt-auth-bg i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.gt-auth-bg .b1 { width: 44vmax; height: 44vmax; left: -14vmax; top: -16vmax; background: #c7d2fe; }
.gt-auth-bg .b2 { width: 38vmax; height: 38vmax; right: -14vmax; bottom: -16vmax; background: #ddd6fe; }
body.gt-auth > *:not(.gt-auth-bg) { position: relative; z-index: 1; }
.gt-auth-logo { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 18px; background: #fff; border: 1px solid #e8ebf3; box-shadow: 0 14px 30px -18px rgba(30,41,59,.4); text-decoration: none; transition: transform .15s; }
.gt-auth-logo:hover { transform: translateY(-1px); }
.gt-auth-logo .gt-logo-mark { width: 32px; height: 32px; }
.gt-auth .card { width: 100% !important; max-width: 440px; margin-top: 0 !important; margin-bottom: 0 !important; border: 1px solid #e5e7eb !important; border-radius: 24px !important;
    box-shadow: 0 30px 60px -32px rgba(30,41,59,.35), 0 2px 8px rgba(15,23,42,.04) !important; }
.gt-auth h3, .gt-auth h4 { color: #0f172a; letter-spacing: -.01em; }
.gt-auth .form-label { color: #475569 !important; }
.gt-auth .form-control { border-radius: 12px; border-color: #e2e8f0; min-height: 44px; }
.gt-auth .form-control:focus { border-color: #818cf8; box-shadow: 0 0 0 .2rem rgba(79,70,229,.15); }
.gt-auth .input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.gt-auth .input-group .btn-outline-secondary { border-color: #e2e8f0; color: #64748b; border-radius: 0 12px 12px 0; background: #fff; }
.gt-auth .input-group .btn-outline-secondary:hover { background: #f5f7ff; color: #4f46e5; }
.gt-auth .btn-primary { background: #4f46e5 !important; border-color: #4f46e5 !important; min-height: 46px; box-shadow: 0 10px 22px -12px rgba(79,70,229,.7); }
.gt-auth .btn-primary:hover { background: #4338ca !important; border-color: #4338ca !important; }
.gt-auth .btn-outline-primary { color: #4f46e5; border-color: #c7d2fe; }
.gt-auth .btn-outline-primary:hover { background: #eef2ff; color: #3730a3; border-color: #a5b4fc; }
.gt-auth a:not(.btn):not(.gt-auth-logo) { color: #4f46e5; font-weight: 600; }
.gt-auth a:not(.btn):not(.gt-auth-logo):hover { color: #3730a3; }
.gt-auth .text-primary { color: #4f46e5 !important; }
.gt-auth .alert { border-radius: 12px; }
.gt-auth .form-check-input:checked { background-color: #4f46e5; border-color: #4f46e5; }
.gt-auth-foot { font-size: 12.5px; color: #94a3b8; text-align: center; }
@media (max-width: 480px) {
  body.gt-auth { justify-content: flex-start !important; padding-top: 22px !important; gap: 16px; }
  .gt-auth .card-body { padding: 26px 20px !important; }
  .gt-auth-logo { width: 50px; height: 50px; border-radius: 16px; }
  .gt-auth-logo .gt-logo-mark { width: 28px; height: 28px; }
}

/* ================= Вход и регистрация (views/auth/login.ejs, register.ejs) — классы ga-*, без классов Bootstrap =================
   Поля как в окнах кабинета: мягкий фон, значок слева, фокус — индиго-обводка; окно восстановления — по центру на всех экранах. */
body.ga { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; margin: 0;
    padding: 32px 16px calc(32px + env(safe-area-inset-bottom, 0px)); background: #f5f7ff; color: #0f172a; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.ga > *:not(.gt-auth-bg):not(.ga-modal) { position: relative; z-index: 1; }
body.ga [hidden] { display: none !important; }
body.ga *, body.ga *::before, body.ga *::after { box-sizing: border-box; } /* не полагаться на Bootstrap (вход в админку без него) */
.ga-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid #e8ebf3; border-radius: 26px; padding: 34px 34px 28px;
    box-shadow: 0 30px 60px -32px rgba(30,41,59,.35), 0 2px 8px rgba(15,23,42,.04); }
.ga-card.wide { max-width: 470px; }
.ga-mark { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 18px; background: #eef2ff; text-decoration: none; transition: transform .15s; }
.ga-mark:hover { transform: translateY(-1px); }
.ga-mark svg { width: 32px; height: 32px; }
.ga-title { margin: 0; text-align: center; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; color: #0f172a; }
.ga-sub { margin: 7px 0 24px; text-align: center; color: #64748b; font-size: 14.5px; line-height: 1.45; }

/* поля */
.ga-field { margin-bottom: 16px; }
.ga-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: #475569; }
.ga-label small { font-weight: 500; color: #94a3b8; font-size: 12.5px; }
.ga-label a, .ga-link { font-size: 13px; font-weight: 600; color: #4f46e5; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.ga-label a:hover, .ga-link:hover { color: #3730a3; }
.ga-input { position: relative; }
.ga-input > .ga-ic { position: absolute; left: 16px; top: 25px; transform: translateY(-50%); color: #94a3b8; font-size: 15px; pointer-events: none; transition: color .15s; }
.ga-input input { display: block; width: 100%; height: 50px; margin: 0; padding: 0 16px 0 44px; border: 1.5px solid #e2e8f0; border-radius: 14px; background: #f8fafc;
    color: #0f172a; font-family: inherit; font-weight: 500; font-size: 16px; line-height: 1; outline: none; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.ga-input input::placeholder { color: #a3adbd; font-weight: 400; }
.ga-input input:hover { border-color: #cbd5e1; }
.ga-input input:focus { border-color: #818cf8; background: #fff; box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.ga-input:focus-within > .ga-ic { color: #4f46e5; }
.ga-input input[readonly] { background: #f1f5f9; color: #334155; cursor: default; box-shadow: none; border-color: #e2e8f0; }
.ga-input.pass input { padding-right: 52px; }
.ga-input.no-ic input { padding-left: 16px; }
.ga-send { min-height: 46px; margin-top: 8px; font-size: 15px; }
.ga-input.has-btn input { padding-right: 138px; }
.ga-eye { position: absolute; right: 6px; top: 6px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 10px;
    background: transparent; color: #94a3b8; font-size: 15px; cursor: pointer; transition: color .15s, background .15s; }
.ga-eye:hover { color: #4f46e5; background: #eef2ff; }
.ga-inbtn { position: absolute; right: 6px; top: 6px; height: 38px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 10px;
    background: #4f46e5; color: #fff; font-family: inherit; font-weight: 700; font-size: 13.5px; line-height: 1; white-space: nowrap; cursor: pointer; transition: background .15s, opacity .15s; }
.ga-inbtn:hover { background: #4338ca; }
.ga-inbtn[disabled] { opacity: .7; cursor: default; }
.ga-inbtn.ghost { background: #fff; color: #4f46e5; border: 1px solid #e0e7ff; }
.ga-inbtn.ghost:hover { background: #eef2ff; }
.ga-badge { position: absolute; right: 8px; top: 10px; height: 30px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
    background: #dcfce7; color: #15803d; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ga-input.has-badge input { padding-right: 150px; }
.ga-err { display: none; align-items: flex-start; gap: 6px; margin-top: 7px; color: #dc2626; font-size: 13px; font-weight: 600; line-height: 1.4; }
.ga-err i { margin-top: 2px; }
.ga-field.err .ga-err { display: flex; }
.ga-field.err .ga-input input { border-color: #f87171; background: #fff8f8; }
.ga-field.err .ga-input input:focus { box-shadow: 0 0 0 4px rgba(248,113,113,.15); }
.ga-err a { color: #4f46e5; font-weight: 700; text-decoration: none; }
.ga-caps { display: none; align-items: center; gap: 6px; margin-top: 7px; color: #b45309; font-size: 12.5px; font-weight: 600; }
.ga-field.caps .ga-caps { display: flex; }
.ga-hint { margin-top: 7px; font-size: 12.5px; color: #64748b; line-height: 1.45; }
.ga-hint.good { color: #15803d; font-weight: 600; }
.ga-hint.bad { color: #dc2626; font-weight: 600; }
.ga-field.good .ga-input input { border-color: #86efac; }

/* требования к паролю — загораются по мере ввода */
.ga-reqs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ga-reqs span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 12px; font-weight: 600; transition: background .2s, color .2s; }
.ga-reqs span.ok { background: #dcfce7; color: #15803d; }
.ga-reqs span.weak { background: #fee2e2; color: #b91c1c; }

/* кнопки */
.ga-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 52px; padding: 0 18px; border: 0; border-radius: 14px;
    background: #4f46e5; color: #fff; font-family: inherit; font-weight: 700; font-size: 16px; line-height: 1.2; cursor: pointer; box-shadow: 0 12px 24px -12px rgba(79,70,229,.75);
    transition: background .15s, transform .12s, box-shadow .15s, opacity .15s; -webkit-tap-highlight-color: transparent; }
.ga-btn:hover { background: #4338ca; }
.ga-btn:active { transform: scale(.985); }
.ga-btn[disabled] { opacity: .7; cursor: default; transform: none; }
.ga-btn.soft { background: #eef2ff; color: #4f46e5; box-shadow: none; }
.ga-btn.soft:hover { background: #e0e7ff; }
.ga-btn.green { background: #16a34a; box-shadow: 0 12px 24px -12px rgba(22,163,74,.7); }
.ga-btn.green:hover { background: #15803d; }
.ga-alt { margin-top: 20px; text-align: center; font-size: 14.5px; color: #64748b; }
.ga-alt a { color: #4f46e5; font-weight: 700; text-decoration: none; }
.ga-alt a:hover { color: #3730a3; }
.ga-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* сообщения над формой */
.ga-alert { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 500; line-height: 1.45; }
.ga-alert[hidden] { display: none; }
.ga-alert i { margin-top: 2px; }
.ga-alert.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fee2e2; }
.ga-alert.good { background: #f0fdf4; color: #15803d; border: 1px solid #dcfce7; }
.ga-alert.info { background: #eef2ff; color: #3730a3; border: 1px solid #e0e7ff; }
.ga-alert a { color: inherit; font-weight: 700; }
.shake { animation: ga-shake .4s; }
@keyframes ga-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* роль при регистрации */
.ga-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.ga-role { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0; padding: 14px 14px 13px; border: 1.5px solid #e2e8f0; border-radius: 16px;
    background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.ga-role:hover { border-color: #c7d2fe; }
.ga-role input { position: absolute; opacity: 0; pointer-events: none; }
.ga-role .ic { width: 40px; height: 40px; margin-bottom: 7px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #eef2ff; color: #4f46e5; font-size: 16px; }
.ga-role.st .ic { background: #ecfdf5; color: #059669; }
.ga-role b { font-size: 15px; font-weight: 700; color: #0f172a; }
.ga-role small { font-size: 12.5px; color: #64748b; line-height: 1.3; }
.ga-role .tick { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
    border: 1.5px solid #cbd5e1; color: transparent; font-size: 10px; transition: background .15s, border-color .15s, color .15s; }
.ga-role.on { border-color: #4f46e5; background: #f7f7ff; box-shadow: 0 0 0 4px rgba(79,70,229,.1); }
.ga-role.on .tick { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.ga-role:has(input:focus-visible) { outline: 2px solid #818cf8; outline-offset: 2px; }

/* код из письма */
.ga-code { margin-top: 12px; padding: 16px 16px 14px; border-radius: 16px; background: #f8fafc; border: 1px solid #eef2f7; animation: ga-in .25s ease-out; }
.ga-code[hidden] { display: none; }
.ga-code-t { margin: 0 0 12px; text-align: center; font-size: 13.5px; color: #475569; line-height: 1.45; word-break: break-word; }
.ga-code-t b { color: #0f172a; }
.ga-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 336px; margin: 0 auto; }
.ga-otp input { width: 100%; height: 54px; margin: 0; padding: 0; border: 1.5px solid #dbe1ea; border-radius: 13px; background: #fff; text-align: center; color: #0f172a;
    font-family: inherit; font-weight: 800; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; outline: none; caret-color: #4f46e5; -webkit-appearance: none; appearance: none;
    transition: border-color .15s, box-shadow .15s, background .15s; }
.ga-otp input:focus { border-color: #818cf8; box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.ga-otp input:disabled { opacity: .7; }
.ga-otp.bad input { border-color: #f87171; background: #fef2f2; color: #b91c1c; }
.ga-otp.bad { animation: ga-shake .4s; }
.ga-otp.ok input { border-color: #4ade80; background: #f0fdf4; color: #15803d; }
.ga-code-foot { display: flex; align-items: center; justify-content: center; gap: 4px 16px; text-align: center; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: #64748b; }
.ga-code-foot .ga-link[disabled] { color: #94a3b8; cursor: default; }
.ga-code-msg { margin-top: 10px; text-align: center; font-size: 13px; font-weight: 600; color: #dc2626; }
.ga-code-msg:empty { display: none; }
@keyframes ga-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* промокод, согласие */
.ga-more { display: inline-flex; align-items: center; gap: 7px; margin: 2px 0 4px; padding: 0; border: 0; background: none; color: #4f46e5; font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1.3; cursor: pointer; }
.ga-more:hover { color: #3730a3; }
.ga-check { display: flex; align-items: flex-start; gap: 11px; margin: 16px 0 20px; font-size: 13px; color: #64748b; line-height: 1.5; cursor: pointer; }
.ga-check input { flex: none; display: grid; place-content: center; width: 21px; height: 21px; margin: 0; border: 1.5px solid #cbd5e1; border-radius: 7px; background: #fff;
    -webkit-appearance: none; appearance: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.ga-check input::before { content: ''; width: 10px; height: 6px; margin-top: -2px; border: 2.2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg); opacity: 0; transition: opacity .1s; }
.ga-check input:checked { background: #4f46e5; border-color: #4f46e5; }
.ga-check input:checked::before { opacity: 1; }
.ga-check input:focus-visible { box-shadow: 0 0 0 4px rgba(79,70,229,.15); }
.ga-check a { color: #4f46e5; font-weight: 600; text-decoration: none; }
.ga-check.err input { border-color: #f87171; box-shadow: 0 0 0 4px rgba(248,113,113,.15); }
.ga-check.err { color: #b91c1c; }

/* окно восстановления пароля — по центру */
.ga-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,23,42,.45);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.ga-modal.open { opacity: 1; visibility: visible; }
.ga-modal-box { position: relative; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 30px 28px 26px;
    border-radius: 24px; background: #fff; box-shadow: 0 40px 80px -30px rgba(15,23,42,.55); transform: translateY(14px) scale(.98); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.ga-modal.open .ga-modal-box { transform: none; }
.ga-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 11px;
    background: #f1f5f9; color: #64748b; font-size: 15px; cursor: pointer; transition: background .15s, color .15s; }
.ga-x:hover { background: #e2e8f0; color: #0f172a; }
.ga-steps { display: flex; justify-content: center; gap: 6px; margin: 2px 0 16px; }
.ga-steps i { width: 28px; height: 5px; border-radius: 99px; background: #e2e8f0; transition: background .2s; }
.ga-steps i.on { background: #4f46e5; }
.ga-modal-ic { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; background: #eef2ff; color: #4f46e5; font-size: 20px; }
.ga-modal h2 { margin: 0; text-align: center; font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; }
.ga-modal .ga-sub { margin-bottom: 20px; }
.ga-step[hidden] { display: none; }
.ga-step { animation: ga-in .22s ease-out; }
html.ga-lock, html.ga-lock body { overflow: hidden; }

@media (max-width: 480px) {
  body.ga { justify-content: flex-start; padding-top: 20px; }
  .ga-card { padding: 26px 20px 22px; border-radius: 22px; }
  .ga-title { font-size: 24px; }
  .ga-sub { margin-bottom: 20px; }
  .ga-roles { gap: 8px; }
  .ga-role { padding: 12px 11px 11px; }
  .ga-role .ic { width: 36px; height: 36px; font-size: 15px; margin-bottom: 5px; }
  .ga-role b { font-size: 14px; }
  .ga-role small { font-size: 12px; }
  .ga-role .tick { top: 10px; right: 10px; width: 20px; height: 20px; }
  .ga-code { padding: 14px 10px 12px; }
  .ga-otp { gap: 6px; }
  .ga-otp input { height: 50px; font-size: 20px; border-radius: 11px; }
  .ga-modal-box { padding: 26px 18px 20px; border-radius: 22px; }
}
/* узкий экран: кнопка «Получить код» — под полем, иначе не остаётся места для почты */
@media (max-width: 400px) {
  .ga-input.has-btn input { padding-right: 16px; }
  .ga-input.has-btn .ga-inbtn { position: static; width: 100%; height: 44px; margin-top: 8px; justify-content: center; font-size: 14.5px; }
  .ga-input.has-badge input { padding-right: 16px; }
  .ga-input.has-badge .ga-badge { position: static; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .ga-modal, .ga-modal-box, .ga-code, .ga-step, .shake, .ga-otp.bad { transition: none; animation: none; } }

/* iPhone (Safari и все браузеры на нём, в том числе Яндекс): поле ввода со шрифтом мельче 16 px при нажатии приближает
   страницу. На сенсорных экранах поля — не мельче 16 px; масштаб пальцами не запрещаем (мелкий текст можно приблизить). */
@media (hover: none) and (pointer: coarse) {
    input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),
    textarea:not(.tl-text-input), select, .ProseMirror, [contenteditable="true"]:not(.tl-container *) { font-size: max(16px, 1em) !important; }
}
