.auth-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 32px;
  width: 100%;
  max-width: 380px;
  color: var(--text);
}

.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted2); font-size: 13px; margin-bottom: 20px; }

.auth-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 5px; }

/* V670: `select` was missing from this list, so #country on /register fell back to
   the browser default -- measured 197x21px beside siblings at 214-314 x 39. Not a
   new rule, just the one element that was never named in an existing one. */
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size:var(--fld-fs,15px);
}
.auth-card input:focus { border-color: var(--muted2); }
.auth-card input:focus:not(:focus-visible){ outline: none; }
/* V671: 39px measured, on three fields on three pages. Five pixels -- and it also
   stops iOS Safari zooming the page when a field under 44px is focused, which it
   does regardless of font size on a short input. The <select> added in V670 is in
   the same rule list above, so it comes along. */
@media (pointer: coarse) {
  .auth-card input[type="text"],
  .auth-card input[type="email"],
  .auth-card input[type="password"],
  .auth-card select { min-height: 44px; }
}

.auth-btn {
  width: 100%;
  margin-top: 20px;
  background: var(--accent);
  color: var(--accent-fg);
  border: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
}
.auth-btn:active { transform: scale(0.98); }

/* V526: the secondary (outline) variant. The backup-codes page used to do this
   with inline background:transparent, which kept .auth-btn's --accent-fg text
   colour - dark text meant for a yellow fill, sitting on a dark panel. It was
   effectively invisible. A ghost button has to restate its OWN colour, not
   inherit the one chosen for a filled button. */
.auth-btn.auth-btn-ghost {
  background: transparent;
  color: var(--text);
  /* --line2 is a panel divider and only reaches 1.87:1 against this panel. A
     ghost button's outline is what identifies it as a control, so use --muted3
     at 3.93:1, clearing the 3:1 WCAG asks of a UI boundary. */
  border: 1px solid var(--muted3);
}
.auth-btn.auth-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.auth-links { margin-top: 16px; font-size: 13px; text-align: center; }
.auth-links a { color: var(--muted2); }
/* V671: 106x15 measured. These are the two links somebody reaches for when something
   has ALREADY gone wrong, which is the worst moment to miss one -- and at 320px they
   wrap onto two lines and their boxes overlap. Padding, not min-width: these sit in a
   sentence. */
@media (pointer: coarse) {
  .auth-links a { display: inline-flex; align-items: center; min-height: 44px;
                  padding: 0 6px; margin: -12px -6px; vertical-align: middle; }
  .auth-links { line-height: 1.3; }
}

.flash {
  background: var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--text);
}

/* tools dashboard */
.tools-page { max-width: 900px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 20px 24px; color: var(--text); }
/* V651, HIS REPORT: "i see some blank space around my iphone screen on left and
   right". MEASURED before changing anything, in Chromium at 390px and 430px: the
   hub was the WIDEST-gutter page on the site at 20px a side, against 14px on QR,
   FinTrack and everything else -- 40px of a 390px phone, 10% of the screen, spent
   on tiles whose names were being cut off in the same release.
   14px matches the rest of the site; 10px under 520px, where the two-column grid
   is what the width is for. max(gutter, safe-area) rather than gutter + area, so
   portrait keeps the 10px and landscape on a notched iPhone clears the notch
   instead of adding to a padding that was already enough. */
@media (max-width: 900px) {
  .tools-page { padding-left: max(14px, env(safe-area-inset-left));
                padding-right: max(14px, env(safe-area-inset-right)); }
}
@media (max-width: 520px) {
  .tools-page { padding-left: max(10px, env(safe-area-inset-left));
                padding-right: max(10px, env(safe-area-inset-right)); }
}
.tools-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.tools-head h1 { font-size: 24px; }
.tools-head .who { color: var(--muted2); font-size: 13px; }
.tools-head form { display: inline; }
.tools-head button, .tools-head a.admin-link {
  background: var(--btn); color: var(--accent); border: 1px solid var(--line2);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; margin-left: 8px;
}
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; perspective: 900px; }
.tool-card {
  position: relative;
  background: linear-gradient(158deg, var(--panel), var(--btn));
  border: 1px solid var(--line2); border-radius: 16px;
  padding: 14px; color: var(--text); text-decoration: none; display: block;
  box-shadow: 0 6px 16px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tool-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 16px 30px rgba(0,0,0,0.48), inset 0 1px 0 rgba(255,255,255,0.14);
}
.tool-card:active { transform: translateY(-1px) scale(0.99); }
.tool-card h2 { font-size: 16px; margin-bottom: 4px; }
.tool-card p { font-size: 13px; color: var(--muted); }

/* honeypot: invisible to humans, irresistible to bots */
.hp { position: absolute !important; left: -5000px !important; width: 1px; height: 1px; opacity: 0; }

.or { text-align: center; color: var(--muted3); font-size: 12px; margin-top: 16px; }

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  background: #ffffff;
  color: #333;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  padding: 11px;
  text-decoration: none;
}
.google-btn:active { transform: scale(0.98); }
