/* The screens before the app: setup, login, «نسيت», /reset and /confirm, plus the password pieces Settings
   reuses (.pw-*). Copied from the demo's login.css; the example-email styles were dropped. */

/* The page: the staging bar (when shown) on top, the card centred below it. */
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-page > .env-bar {
  position: sticky;
  top: 0;
  z-index: 20;
}

.auth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 24px) 16px calc(env(safe-area-inset-bottom) + 24px);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 20px 22px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (min-width: 480px) {
  .auth-card {
    padding: 36px 32px 28px;
  }
}

.auth-brand {
  margin-bottom: 24px;
  text-align: center;
}

.auth-wordmark {
  margin: 0;
  color: var(--brand);
  font-size: 46px;
  font-weight: 900;
  line-height: 1.25;
}

.auth-tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.auth-brand-small {
  margin: 4px 0 8px;
}

.auth-brand-small .auth-wordmark {
  font-size: 26px;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}

.auth-text {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.auth-form .field {
  margin-bottom: 18px;
}

.auth-submit {
  margin-top: 4px;
}

.auth-link {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -12px -8px 0;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.auth-back:hover {
  background: var(--brand-soft);
}

.auth-answer {
  text-align: center;
}

.auth-note {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 700;
}

.auth-done-icon {
  display: flex;
  justify-content: center;
  margin: 4px 0 12px;
  color: var(--ok);
}

.auth-done-icon .icon svg {
  width: 56px;
  height: 56px;
  stroke-width: 2;
}

.auth-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

/* ------------------------------------------------------------ password field (also in Settings forms) */

.pw-field {
  position: relative;
}

/* Physical left on purpose. The page is always RTL, so the toggle sits on the left. The input keeps dir="auto"
   (a password may be Arabic or Latin), so a logical padding would follow the typed text: a Latin password would
   put the padding on the right and run its first characters under the toggle. */
.pw-field .pw-input {
  padding-left: 84px;
}

.pw-toggle {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 70px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.pw-toggle:hover {
  background: var(--brand-soft);
}

.input-readonly {
  background: var(--bg);
  color: var(--muted);
}

.pw-rules {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.pw-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.pw-rule-ok {
  color: var(--ok);
  font-weight: 700;
}

.pw-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
}

.pw-rule-ok .pw-dot {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.pw-dot .icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.pw-rule-extra {
  margin-inline-start: auto;
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
