/* ═══════════════════════════════════════════════════════════════════════
   HerWork — public pages (login, register, pending).
   Loaded after app.css, so it reuses its tokens, buttons, toast, loading bar
   and reduced-motion rules. Mobile-first.
   ═══════════════════════════════════════════════════════════════════════ */

select { font: inherit; color: inherit; }

.auth-body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Brand (logo + name) ── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  color: var(--charcoal);
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  object-fit: contain;
  background: #fff;
}

/* ── Card ── */
.auth-card {
  width: 100%;
  padding: clamp(20px, 5vw, 36px);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.05), 0 10px 30px rgb(26 46 59 / 0.07);
}
.auth-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(19px, 4.5vw, 22px);
  line-height: 1.3;
}
.auth-title:focus { outline: none; }
.auth-sub { margin-top: 4px; font-size: 14px; line-height: 1.55; color: var(--slate); }

/* ── Form fields ── */
.field-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 14px; font-weight: 500; }
.field-label .opt { font-weight: 400; color: var(--slate); }
.field-hint { font-size: 12.5px; line-height: 1.5; color: var(--slate); }
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--danger);
}
.field-error::before { content: '!'; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }

.control { position: relative; display: flex; align-items: stretch; }
.control > .i {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  translate: 0 -50%;
  color: var(--slate);
  pointer-events: none;
}
.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px 12px 44px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  font-size: 16px;               /* 16px stops iOS zooming into the field */
  line-height: 1.3;
  color: var(--charcoal);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.input::placeholder { color: var(--gray-400); }
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--brand-strong);
  background: #fff;
  box-shadow: 0 0 0 3px rgb(140 198 63 / 0.25);
}
.input[aria-invalid='true'],
.select[aria-invalid='true'] { border-color: var(--danger); background: var(--danger-50); }
.input[readonly] { color: var(--slate); }
.select {
  appearance: none;
  padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.select:invalid { color: var(--gray-400); }   /* placeholder option */
.select option { color: var(--charcoal); }
.input.has-toggle { padding-inline-end: 52px; }

/* Show / hide password */
.pw-toggle {
  position: absolute;
  inset-inline-end: 2px;
  top: 50%;
  translate: 0 -50%;
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--slate);
}
.pw-toggle:hover { color: var(--charcoal); }

/* Text prefix such as +92 */
.prefix {
  display: flex;
  align-items: center;
  padding-inline: 12px;
  border: 1.5px solid var(--gray-200);
  border-inline-end: 0;
  border-radius: 10px 0 0 10px;
  background: var(--parrot-50);
  font-weight: 600;
  font-size: 15px;
  color: var(--brand-strong);
  white-space: nowrap;
}
.prefix + .input { padding-inline-start: 14px; border-radius: 0 10px 10px 0; }

/* ── Buttons ── */
.btn-block { width: 100%; min-height: 48px; font-size: 15px; }
.btn[aria-busy='true'] { opacity: 0.85; cursor: progress; }
.btn[aria-busy='true'] > .i { display: none; }
.btn[aria-busy='true']::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.link-btn {
  min-height: var(--tap);
  padding: 0 4px;
  border: 0;
  background: none;
  font-weight: 600;
  color: var(--brand-strong);
}
.link-btn:hover { text-decoration: underline; }

/* ── Inline alert (form-level errors / success) ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
}
.alert:empty { display: none; }
.alert[data-tone='error'] { background: var(--danger-50); border-color: #fecaca; color: #991b1b; }
.alert[data-tone='success'] { background: var(--parrot-50); border-color: var(--parrot-100); color: #365314; }
.alert[data-tone='info'] { background: var(--sky-50); border-color: #bfdbfe; color: #1e3a8a; }

/* ── Trust line ── */
.trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--slate);
}

/* ── "Checking your session…" placeholder ── */
.checking {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-block: 40px;
  font-size: 14px;
  color: var(--slate);
}
.checking::before {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--parrot-100);
  border-top-color: var(--brand-strong);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}
