/* гость: окно «Войдите или получите доступ», форма заявки и страница входа (aigen/access.py, static/js/access.js,
   templates/_access_dialog.html, _access_form.html, login.html). Подключается только там, где они есть */

/* окно на главной и в уроках */
.access-dialog {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px 22px 22px; border: 1px solid var(--border);
  border-radius: 18px; background: var(--raised); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.access-dialog::backdrop { background: rgba(20, 16, 10, .45); }
.access-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.access-dialog-head h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.access-dialog-head .icon-btn { flex: none; margin: -4px -6px 0 0; }
.access-tool { display: grid; gap: 3px; margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.access-tool small { color: var(--accent); font-size: 12px; font-weight: 650; }
.access-tool b { font-size: 16px; }
.access-tool span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.access-tool span:empty { display: none; }
.access-choice p { margin: 0 0 16px; line-height: 1.5; }
.access-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.access-buttons .btn { padding: 11px 16px; }
.access-alt { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.access-alt a { color: var(--accent); font-weight: 600; }

/* форма заявки */
.access-form { display: grid; gap: 0; }
.access-form .field { margin-bottom: 14px; gap: 6px; }
.access-form .field > span:first-child { font-size: 13px; font-weight: 600; }
.access-form .field > span .hint { margin-left: 4px; font-size: 12.5px; font-weight: 500; }
.access-form .field > .hint { font-size: 12.5px; line-height: 1.35; }
.access-form textarea { min-height: 76px; }
.access-consent { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; margin: 2px 0 14px; font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.access-consent input { width: 18px; height: 18px; margin: 1px 0 0; }
.access-consent a { color: var(--accent); }
.access-status { margin: 0 0 12px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--err-soft); color: var(--err); font-size: 14px; }
.access-status[hidden] { display: none; }
/* ловушка для ботов: люди поле не видят и не попадают на него с клавиатуры */
.access-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.access-done { display: grid; justify-items: center; gap: 10px; padding: 26px 0 8px; text-align: center; }
.access-done[hidden] { display: none; }
.access-done b { font-size: 18px; }
.access-done .muted { max-width: 34ch; font-size: 14px; line-height: 1.45; }
.access-done .btn { margin-top: 6px; }
.access-done svg { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--accent-soft); fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.access-dialog [data-access-home], .access-page [data-access-close] { display: none; }

/* страница входа: вход и заявка рядом, на телефоне друг под другом */
.access-page { width: 100%; max-width: 820px; display: grid; gap: 16px; }
.access-back { justify-self: start; color: var(--muted); text-decoration: none; font-size: 14px; }
.access-back:hover { color: var(--accent); }
.access-page > .access-tool { margin: 0; padding: 16px 18px; border: 1px solid var(--border); background: var(--surface); }
.access-page > .access-tool p { margin: 4px 0 0; font-size: 14.5px; }
.access-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.access-cols .login-card { max-width: none; }
.access-card { display: grid; gap: 14px; padding: 30px 28px; scroll-margin-top: 16px; }
.access-card h2 { font-size: 22px; }
.access-card > p { margin: -6px 0 0; color: var(--muted); line-height: 1.5; font-size: 14.5px; }
@media (max-width: 760px) {
  .access-cols { grid-template-columns: minmax(0, 1fr); }
  .access-card, .access-cols .login-card { padding: 24px 20px; }
}
@media (max-width: 420px) {
  .access-buttons { grid-template-columns: minmax(0, 1fr); }
  .access-dialog { padding: 18px 16px 18px; }
}

/* серая тема: надписи прямо на сером фоне светлые (как в app.css, 30.10.2026) */
:root[data-theme="grey"] .access-back { color: var(--on-bg-muted); }
:root[data-theme="grey"] .access-back:hover { color: var(--on-bg); }
/* регистрация по почте (templates/signup.html, aigen/signup.py) */
.signup-card { width: 100%; max-width: 440px; margin: 0 auto; }
.signup-form { display: grid; gap: 14px; }
.signup-form .muted { margin: 0; }
.signup-card .access-done svg { width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
