/*
 * Admin sign-in page — approved design A (prototypes/screens/b-04-admin-login):
 * the form on the reading-start side, a brand panel in the identity colour on
 * the other side. On phones the brand panel becomes a band above the form.
 */

body { margin: 0; background: var(--dk-surface); color: var(--dk-text); }

.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-block-size: 100vh; }
.auth__form { display: flex; flex-direction: column; padding: 28px 40px; background: var(--dk-surface); }
.auth__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth__body { flex: 1; display: grid; place-items: center; padding-block: 24px; }
.auth__inner { inline-size: min(400px, 100%); }

.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand strong { font-size: 16px; font-weight: 600; }
.auth-logo { inline-size: 48px; block-size: 48px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.auth-logo .icon { inline-size: 24px; block-size: 24px; }
.auth-logo--light { background: rgba(255, 255, 255, 0.16); color: #fff; position: relative; }

.auth-title { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.auth-sub { margin: 0 0 22px; font-size: 13px; color: var(--dk-muted); }
.auth-foot { margin: 18px 0 0; font-size: 12px; color: var(--dk-muted); }

.auth-field { display: grid; gap: 6px; margin-block-end: 16px; }
.auth-field label { font-size: 13px; font-weight: 600; }
.auth-field input {
  inline-size: 100%; box-sizing: border-box; min-block-size: 44px; padding-inline: 14px;
  border: 1px solid #dfe5ee; border-radius: 10px; background: var(--dk-surface);
  font: inherit; font-size: var(--text-sm); color: var(--dk-text);
}
.auth-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-field input.input-validation-error { border-color: #d0393b; background: #fff7f7; }
.auth-field .field-validation-error { font-size: 12px; color: #c62f31; }
.auth-field .field-validation-valid { display: none; }

/* Password with show/hide. The value is left-to-right while the eye sits at
   the page's inline end, so its space is reserved on that physical side. */
.auth-secret { position: relative; display: flex; align-items: center; }
.auth-eye {
  position: absolute; inset-inline-end: 6px; inline-size: 34px; block-size: 34px;
  display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--dk-muted); cursor: pointer;
}
.auth-eye:hover { background: var(--dk-surface-muted); color: var(--dk-text); }
.auth-eye .icon { inline-size: 18px; block-size: 18px; }
[dir="rtl"] .auth-secret input { padding-left: 46px; padding-right: 14px; }
[dir="ltr"] .auth-secret input { padding-right: 46px; padding-left: 14px; }

.auth-submit {
  inline-size: 100%; min-block-size: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer;
}
.auth-submit:hover { filter: brightness(1.06); }
.auth-submit:disabled { opacity: 0.85; cursor: progress; }

/* Result messages above the form */
[data-form-result] .alert { border-radius: 12px; border-inline-start: 4px solid; margin-block-end: 16px; font-size: 13px; line-height: 1.7; }
[data-form-result] .alert strong { display: block; font-size: 14px; }
[data-form-result] .alert .icon { inline-size: 18px; block-size: 18px; flex: none; margin-block-start: 3px; }
[data-form-result] .alert--danger .icon { color: #c62f31; }
[data-form-result] .alert--info { background: #e8f0fd; border-color: #2a6fdb; color: #17467f; }
[data-form-result] .alert--info .icon { color: #2a6fdb; }

.lang-switch { border-color: var(--dk-border); border-radius: 10px; }
.lang-switch button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

/* Brand panel */
.auth__brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 14px;
  padding: 48px; color: #fff;
  background: linear-gradient(160deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 70%, #1e2a3b) 100%);
}
.auth__brand::before, .auth__brand::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }
.auth__brand::before { inline-size: 420px; block-size: 420px; inset-block-start: -140px; inset-inline-end: -120px; }
.auth__brand::after { inline-size: 260px; block-size: 260px; inset-block-start: 160px; inset-inline-end: 140px; }
.auth__brand h2 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.4; max-inline-size: 460px; position: relative; }
.auth__brand p { margin: 0 0 40px; font-size: 15px; opacity: 0.9; max-inline-size: 440px; position: relative; line-height: 1.8; }

@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__brand { order: -1; padding: 24px; gap: 8px; }
  .auth__brand::before, .auth__brand::after { display: none; }
  .auth__brand h2 { font-size: 18px; }
  .auth__brand p { margin: 0; font-size: 13px; }
  .auth__form { padding: 20px; }
}

.toasts { z-index: 400; }

/* An uploaded organization logo (P0-02) replaces the placeholder mark. */
.auth-logo.has-image { background: #fff; border: 1px solid var(--dk-border); overflow: hidden; }
.auth-logo.has-image img { inline-size: 100%; block-size: 100%; object-fit: contain; }
.auth-brand div span { display: block; font-size: 12px; color: var(--dk-muted); }

/* ---------- Blocked-access screen (approved P0-01 screen 7, option B) ---------- */
.blocked .blocked__brand { justify-content: space-between; }
.blocked .blocked__brand h2 { font-size: 22px; }
.blocked__top { justify-content: flex-end; }
.blocked__top .lang-switch a { padding: 6px 12px; font-size: 13px; color: var(--dk-text); text-decoration: none; }
.blocked__top .lang-switch a[aria-current="true"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.blocked__body { display: grid; gap: 12px; }
.blocked__badge { inline-size: 64px; block-size: 64px; border-radius: 20px; display: grid; place-items: center; background: #fdeceb; color: #c62f31; }
.blocked__badge .icon { inline-size: 30px; block-size: 30px; }
.blocked__body .auth-title { font-size: 24px; line-height: 1.5; margin: 0; }
.blocked__text { margin: 0; font-size: 15px; color: var(--dk-muted); line-height: 1.8; }
.blocked__ip { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--dk-surface-muted); font-size: 13px; color: var(--dk-muted); }
.blocked__ip .icon { inline-size: 14px; block-size: 14px; }
.blocked__contact { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--dk-muted); }
.blocked__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.blocked__list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--dk-border); border-radius: 12px; background: #fff; }
.blocked__ic { inline-size: 36px; block-size: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; flex: none; }
.blocked__ic .icon { inline-size: 18px; block-size: 18px; }
.blocked__list small { display: block; font-size: 11px; color: var(--dk-muted); }
.blocked__list a, .blocked__list span { font-size: 14px; font-weight: 600; color: var(--dk-text); text-decoration: none; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .blocked .blocked__brand { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 20px; min-block-size: 0; block-size: auto; }
  .blocked .blocked__brand::before, .blocked .blocked__brand::after { display: none; }
  .blocked .blocked__brand h2 { font-size: 16px; }
}

/* ---------- Privacy policy and terms (Phase 0 §8) ---------- */
.legal { min-block-size: 100vh; background: var(--dk-bg); }
.legal__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; background: #fff; border-block-end: 1px solid var(--dk-border); }
.legal__lang a { padding: 6px 12px; font-size: 13px; color: var(--dk-text); text-decoration: none; }
.legal__lang a[aria-current="true"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.legal__body { max-inline-size: 760px; margin: 32px auto; padding: 32px; background: #fff; border-radius: var(--dk-radius); box-shadow: var(--dk-shadow); }
.legal__body h1 { margin: 0 0 18px; font-size: 24px; color: var(--brand-text); }
.legal__text { font-size: 15px; line-height: 1.9; }
.legal__text h3 { font-size: 17px; margin: 20px 0 6px; }
.legal__text a { color: var(--brand-text); text-decoration: none; }
.legal__empty { color: var(--dk-muted); }
@media (max-width: 700px) { .legal__body { margin: 16px; padding: 20px; } }

/* Registration, password change and recovery (Phase 1): rules, steps and end states */
.auth-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.auth-field input[readonly] { background: var(--dk-surface-muted); color: var(--dk-muted); }
.auth-req { color: #e11d48; }
.auth-rules { display: grid; gap: 4px; margin: -6px 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--dk-surface-muted); list-style: none; }
.auth-rules .auth-rules__title { font-weight: 600; }
.auth-rules li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dk-muted); }
.auth-rules li.is-ok { color: #12744f; }
.auth-rules .icon { inline-size: 14px; block-size: 14px; }
.auth-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--brand-text); cursor: pointer; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block-start: 14px; }
.auth-state { text-align: center; padding-block: 8px; }
.auth-state > .icon { inline-size: 44px; block-size: 44px; color: #1f62b5; }
.auth-state.is-ok > .icon { color: #12845a; }
.auth-state h1 { font-size: 20px; margin: 10px 0 6px; }
.auth-state p { color: var(--dk-muted); font-size: 14px; line-height: 1.8; margin: 0 0 16px; }
.auth__brand ol { position: relative; margin: 0 0 40px; padding-inline-start: 20px; display: grid; gap: 10px; font-size: 15px; line-height: 1.7; max-inline-size: 440px; }
.auth-code { letter-spacing: 0.4em; text-align: center; font-size: 20px !important; }
@media (max-width: 900px) { .auth__brand ol { display: none; } }

/* The registration page carries the whole record (user decision 2026-11-09): a wider form side. */
.auth--wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.auth--wide .auth__body { place-items: start center; }
.auth__inner--wide { inline-size: min(820px, 100%); }
.auth__inner--wide .person-sec { margin-block-start: var(--space-4); }
.auth__inner--wide .field input, .auth__inner--wide .field select, .auth__inner--wide .field textarea { inline-size: 100%; box-sizing: border-box; }
@media (max-width: 900px) { .auth--wide { grid-template-columns: 1fr; } }

/* The public verification page of a contract (2026-11-10). */
.vf-facts { display: grid; gap: 10px; margin: 18px 0 0; }
.vf-facts div { display: grid; gap: 2px; padding-block-end: 8px; border-block-end: 1px solid var(--dk-border, #e3e7ee); }
.vf-facts dt { font-size: 12px; color: var(--dk-muted); }
.vf-facts dd { margin: 0; font-size: 14px; font-weight: 600; }
.vf-hash { font-family: ui-monospace, Consolas, monospace; font-size: 11px !important; word-break: break-all; text-align: start; }
