/*
 * Sign-in, 2FA and password pages (app_accounts/accounts_auth_base.html). Built only from the ei_brand.css tokens.
 * Desktop: purple brand panel + white card; phone: slim purple header above the card.
 */
html, body { height: 100%; }
body.ei-auth { margin: 0; background: var(--ei-bg); color: var(--ei-ink); font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif; }
.ei-auth-shell { min-height: 100vh; display: flex; }

/* Brand panel */
.ei-auth-brand { flex: 0 0 40%; max-width: 520px; box-sizing: border-box; background: var(--ei-purple); color: #fff; padding: 48px 52px; display: flex; flex-direction: column; justify-content: space-between; }
.ei-auth-logo { background: #fff; border-radius: var(--ei-radius); padding: 14px 18px; align-self: flex-start; display: flex; }
.ei-auth-logo img { height: 30px; display: block; }
.ei-auth-name { margin: 0; font-family: var(--ei-font-display); font-weight: 600; font-size: 4.2rem; line-height: 1; letter-spacing: .5px; color: #fff; }
.ei-auth-tagline { margin: 18px 0 0; font-size: 1.1rem; line-height: 1.55; color: #e6e0f0; max-width: 360px; }
.ei-auth-copy { margin: 0; font-size: .8rem; color: #d9d1e6; }
.ei-auth-mobilebar { display: none; }

/* Card */
.ei-auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.ei-auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--ei-line); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(56, 56, 56, .07); }
.ei-auth-card .ei-strip { border-radius: 0; height: 5px; }
.ei-auth-body { padding: 32px 38px 30px; display: flex; flex-direction: column; gap: 18px; text-align: left; }
.ei-auth-title { margin: 0 0 4px; font-family: var(--ei-font-display); font-weight: 600; font-size: 2.25rem; line-height: 1.1; color: var(--ei-ink); }
.ei-auth-lead { margin: 0; font-size: .95rem; line-height: 1.5; color: var(--ei-muted); }
.ei-auth-step { align-self: flex-start; background: var(--ei-tint); color: var(--ei-purple); font-size: .75rem; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; padding: 4px 10px; border-radius: 10px; }
.ei-auth-body form { display: flex; flex-direction: column; gap: 18px; margin: 0; }

/* Fields */
.ei-auth-label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--ei-ink); }
.ei-auth-input, .ei-auth-body input[type=text], .ei-auth-body input[type=email], .ei-auth-body input[type=password] {
  width: 100%; box-sizing: border-box; height: 46px; border: 1px solid var(--ei-field-line); border-radius: 6px;
  padding: 0 14px; font-size: 15px; color: var(--ei-ink); background: #fff; }
.ei-auth-body input:focus { outline: 2px solid var(--ei-blue); outline-offset: 1px; border-color: var(--ei-blue); box-shadow: none; }
.ei-auth-body input[aria-invalid=true] { border-color: var(--ei-crimson); }
.ei-auth-body input.ei-match-ok { border-color: var(--ei-green); }
.ei-auth-hint { margin: 6px 0 0; font-size: .8rem; color: var(--ei-muted); }
.ei-auth-error { margin: 6px 0 0; font-size: .82rem; color: var(--ei-crimson); }
.ei-auth-error ul { margin: 0; padding-left: 18px; }
.ei-auth-code { height: 58px !important; font-size: 28px !important; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }

/* Show / hide eye */
.ei-pw { position: relative; }
.ei-pw .ei-auth-input, .ei-pw input { padding-right: 48px; }
.ei-eye { position: absolute; right: 4px; top: 4px; width: 38px; height: 38px; border: 0; background: transparent; border-radius: 6px; color: var(--ei-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ei-eye:hover { background: var(--ei-tint); color: var(--ei-purple); }
.ei-eye:focus-visible { outline: 2px solid var(--ei-blue); outline-offset: 0; }
.ei-eye .ei-eye-off { display: none; }
.ei-eye[aria-pressed=true] { background: var(--ei-tint); color: var(--ei-purple); }
.ei-eye[aria-pressed=true] .ei-eye-on { display: none; }
.ei-eye[aria-pressed=true] .ei-eye-off { display: inline; }

/* Live rule checklist, strength bar, match line */
.ei-meter { height: 6px; background: var(--ei-tint); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.ei-meter span { display: block; height: 6px; width: 0; border-radius: 3px; background: var(--ei-crimson); transition: width .15s; }
.ei-rules { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; font-size: .8rem; color: var(--ei-muted); }
.ei-rules li { display: flex; gap: 7px; align-items: baseline; }
.ei-rules li::before { content: '○'; font-weight: 700; width: 12px; flex-shrink: 0; }
.ei-rules li.ei-ok { color: #3f7a1f; }
.ei-rules li.ei-ok::before { content: '✓'; }
.ei-match { margin: 6px 0 0; font-size: .82rem; font-weight: 600; min-height: 1.2em; }
.ei-match.ei-ok { color: #3f7a1f; }
.ei-match.ei-bad { color: var(--ei-crimson); }

/* Checkbox (remember device) */
.ei-auth-check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; line-height: 1.45; cursor: pointer; }
.ei-auth-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ei-purple); flex-shrink: 0; }

/* Buttons and links */
.ei-auth-btn { height: 48px; border-radius: 6px; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; cursor: pointer; width: 100%; }
.ei-auth-btn--primary { background: var(--ei-purple); color: #fff; border: 1px solid var(--ei-purple); }
.ei-auth-btn--primary:hover, .ei-auth-btn--primary:focus { background: var(--ei-plum); border-color: var(--ei-plum); color: #fff; }
.ei-auth-btn--outline { background: #fff; color: var(--ei-purple); border: 1px solid var(--ei-purple); }
.ei-auth-btn--outline:hover, .ei-auth-btn--outline:focus { background: var(--ei-tint); color: var(--ei-plum); }
.ei-auth-btn:focus-visible { outline: 2px solid var(--ei-blue); outline-offset: 2px; }
.ei-auth-link { font-size: .88rem; font-weight: 600; color: var(--ei-purple); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.ei-auth-link:hover { color: var(--ei-plum); text-decoration: underline; }
.ei-auth-link--muted { color: var(--ei-muted); font-weight: 500; }
.ei-auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ei-auth-center { align-self: center; }
.ei-auth-divider { display: flex; align-items: center; gap: 12px; font-size: .82rem; color: var(--ei-muted); }
.ei-auth-divider::before, .ei-auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--ei-line); }
.ei-auth-foot { margin: 0; font-size: .8rem; color: var(--ei-muted); border-top: 1px solid var(--ei-line); padding-top: 14px; }
.ei-auth-fold { border-top: 1px solid var(--ei-line); padding-top: 14px; }
.ei-auth-fold summary { font-size: .88rem; color: var(--ei-muted); cursor: pointer; margin-bottom: 4px; }
.ei-auth-fold[open] summary { margin-bottom: 16px; }

/* Notices (all four kinds live in ei_brand.css) */
.ei-auth .ei-notice { font-size: .88rem; }
.ei-auth .ei-notice-body { flex: 1 1 200px; }

/* Phone */
@media (max-width: 860px) {
  .ei-auth-shell { flex-direction: column; }
  .ei-auth-brand { display: none; }
  .ei-auth-mobilebar { display: flex; align-items: center; justify-content: space-between; background: var(--ei-purple); color: #fff; padding: 16px 18px; }
  .ei-auth-mobilebar strong { font-family: var(--ei-font-display); font-weight: 600; font-size: 1.9rem; line-height: 1; }
  .ei-auth-mobilebar span { background: #fff; border-radius: 6px; padding: 6px 8px; display: flex; }
  .ei-auth-mobilebar img { height: 16px; display: block; }
  .ei-auth-main { align-items: flex-start; padding: 16px; }
  .ei-auth-body { padding: 24px 20px; }
  .ei-auth-input, .ei-auth-body input { font-size: 16px; }
  .ei-rules { grid-template-columns: minmax(0, 1fr); }
}
