/* The sign-in page and the pages beside it (the legal notice; fork P's set-password page) - Luka, 2026-10-23.
   Loaded after style.css and page.css; the colours are their tokens (--bg, --panel, --accent ...), so the light and
   dark themes follow without a rule of their own. The class names .login-bg/-card/-title/-btn/-btn-ms/-field/
   -error/-foot are a contract: other pages reuse them. */

/* A subtle background in our style: the page colour with faint contour lines, like a site plan's relief - drawn
   as an SVG data URI (no file, no request), at a low opacity so the card is what the eye finds. */
.login-bg {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% 38%, var(--surface) 0%, transparent 62%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480' viewBox='0 0 480 480'%3E%3Cg fill='none' stroke='%23888' stroke-opacity='0.16' stroke-width='1'%3E%3Cpath d='M-20 90 C 80 40, 160 140, 260 90 S 420 40, 500 100'/%3E%3Cpath d='M-20 150 C 90 100, 170 200, 270 150 S 430 100, 500 160'/%3E%3Cpath d='M-20 210 C 100 160, 180 260, 280 210 S 440 160, 500 220'/%3E%3Cpath d='M-20 270 C 110 220, 190 320, 290 270 S 450 220, 500 280'/%3E%3Cpath d='M-20 330 C 100 290, 200 380, 300 330 S 440 290, 500 340'/%3E%3Cpath d='M-20 390 C 90 350, 190 440, 290 390 S 430 350, 500 400'/%3E%3Cellipse cx='360' cy='120' rx='46' ry='26'/%3E%3Cellipse cx='360' cy='120' rx='22' ry='11'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat;
  min-height: 100vh;
}

.login-top { position: fixed; top: 16px; right: 20px; display: flex; gap: 10px; align-items: center; z-index: 2; }

.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 72px 16px 48px; }

.login-card {
  width: 100%; max-width: 400px; box-sizing: border-box;
  background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: 6px; padding: 32px 32px 24px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column; gap: 12px;
}
.login-brand {
  font-size: 13px; letter-spacing: 3px; font-weight: 600; color: var(--text-muted);
  border-left: 4px solid var(--accent); padding-left: 10px; align-self: flex-start;
}
.login-title { font-size: 22px; font-weight: 600; color: var(--text); margin: 6px 0 0; }
.login-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 8px; line-height: 1.5; }

.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; box-sizing: border-box;
  min-height: 42px; padding: 9px 16px; border-radius: 4px; cursor: pointer;
  font: 500 14px var(--font-ui); text-decoration: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-2);
  transition: border-color .12s, background-color .12s;
}
.login-btn:hover { border-color: var(--accent); }
.login-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.login-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.login-btn-ms { background: var(--surface); }
.login-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; margin-top: 4px; }
.login-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.login-btn:disabled, .login-btn-primary:disabled {
  background: var(--panel-3); border-color: var(--border); color: var(--text-muted); cursor: not-allowed;
}
/* Open: the accent edge only - a grey fill read as a disabled button (light theme, 2026-10-23). */
.login-btn[aria-expanded="true"] { border-color: var(--accent); }

.login-or { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.login-form[hidden] { display: none; }
.login-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.login-field input {
  font: 14px var(--font-ui); padding: 9px 10px; border-radius: 4px; box-sizing: border-box; width: 100%;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-2);
}
.login-field input:focus { outline: none; border-color: var(--accent); }
.login-error { color: var(--accent); font-size: 13px; margin: 0; line-height: 1.4; }
.login-error[hidden], .login-none[hidden], .login-contact[hidden] { display: none; }
.login-none { color: var(--text-muted); font-size: 13px; margin: 0; }

.login-foot {
  margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-muted);
}
.login-foot p { margin: 0; }
.login-foot a { color: var(--text-muted); }
.login-foot a:hover { color: var(--accent); }

/* Which methods the edition offers: the server's <html> attributes decide before the first paint. */
html[data-microsoft-login="0"] .login-ms-only,
html[data-password-login="0"] .login-pw-only,
html[data-microsoft-login="0"] .login-both-only,
html[data-password-login="0"] .login-both-only { display: none !important; }

/* The legal notice: the same card, wider and for reading. */
.legal-card { max-width: 720px; }
.legal-card h2 { font-size: 14px; margin: 14px 0 4px; color: var(--text); }
.legal-card p { font-size: 13px; line-height: 1.6; color: var(--text-dim); margin: 0; }
.legal-card .legal-placeholder {
  border: 1px dashed var(--accent); color: var(--accent); background: transparent;
  padding: 8px 10px; border-radius: 4px; font-size: 13px; font-weight: 500;
}

@media (max-width: 480px) {
  .login-card { padding: 24px 20px 18px; }
  .login-main { padding-top: 64px; }
}

/* The second step (static/mfa.js): the card holds only that. */
.login-second-step .login-pw-only, .login-second-step .login-ms-only { display: none !important; }
