/*
 * voimar-auth.css — THE one stylesheet for every Voimar registration /
 * sign-in / password-reset screen across the digital estate (SMS, APN,
 * Vault, and any app added later). Values are lifted 1:1 from
 * vault.voimar.co.za's own auth card (heita.pro/frontend/vault-app,
 * app/page.tsx + tailwind.config.ts), so every portal matches Vault.
 *
 * Plain CSS on purpose, not Tailwind classes: it works unchanged in a
 * Tailwind v3 app, a Tailwind v4 app, or a Jinja/FastAPI page. Edit it
 * HERE (voimar-shared/auth-kit/) and run sync.sh - never per app.
 */

.va-page {
  --va-red: #d82827;
  --va-red-dark: #b31f1f;
  --va-ink: #1f2937;
  --va-grey-50: #f9fafb;
  --va-grey-100: #f3f4f6;
  --va-grey-200: #e5e7eb;
  --va-grey-300: #d1d5db;
  --va-grey-500: #6b7280;
  --va-grey-600: #4b5563;
  --va-green: #15803d;

  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem 1rem;
  background: var(--va-red);
  color: var(--va-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.va-page--black {
  background: #0b0b0b;
}

.va-page *,
.va-page *::before,
.va-page *::after {
  box-sizing: border-box;
}

.va-wrap {
  width: 100%;
  max-width: 28rem;
}

/* Logo tile overlaps the top of the card - negative margin equals its own height. */
.va-logo {
  position: relative;
  z-index: 10;
  margin: 0 auto -7rem;
  height: 7rem;
  width: 7rem;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2), 0 4px 6px -4px rgb(0 0 0 / 0.2);
}

.va-logo img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.va-card {
  overflow: hidden;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35);
}

.va-card-body {
  padding: 8rem 2rem 2rem;
}

.va-title-row {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.va-title-icon {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgb(216 40 39 / 0.1);
  color: var(--va-red);
}

.va-title-icon svg {
  height: 1.25rem;
  width: 1.25rem;
}

.va-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  color: var(--va-ink);
}

.va-eyebrow {
  margin: 0 0 0.25rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--va-red);
}

.va-badge-row {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.va-badge {
  border-radius: 9999px;
  background: var(--va-grey-100);
  padding: 0.125rem 0.625rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--va-grey-600);
}

.va-intro {
  margin: 0 0 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--va-grey-600);
}

/* Create Account / Sign In segmented tabs */
.va-tabs {
  margin-bottom: 1rem;
  display: flex;
  border-radius: 0.5rem;
  background: var(--va-grey-100);
  padding: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.va-tab {
  flex: 1;
  border-radius: 0.375rem;
  padding: 0.375rem 0;
  text-align: center;
  color: var(--va-grey-600);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.va-tab--active {
  background: #ffffff;
  color: var(--va-ink);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.va-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.va-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.va-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--va-grey-600);
}

.va-input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--va-grey-200);
  background: #ffffff;
  padding: 0.625rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--va-ink);
  outline: none;
  transition: border-color 0.15s;
}

.va-input:focus {
  border-color: var(--va-red);
}

.va-input:disabled {
  background: var(--va-grey-50);
  color: var(--va-grey-500);
}

.va-input--verified {
  border-color: var(--va-green);
}

.va-input-group {
  position: relative;
}

.va-input-group .va-input {
  padding-right: 2.75rem;
}

/* Eye on / eye off toggle inside a password field */
.va-eye {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--va-grey-500);
  cursor: pointer;
}

.va-eye svg {
  height: 1rem;
  width: 1rem;
}

/* Field + inline action button ("Send code" / "Verify") */
.va-with-action {
  display: flex;
  gap: 0.5rem;
}

.va-with-action .va-input {
  flex: 1;
  min-width: 0;
}

.va-inline-btn {
  flex-shrink: 0;
  border-radius: 0.5rem;
  border: 1px solid var(--va-red);
  background: #ffffff;
  padding: 0 0.875rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--va-red);
  cursor: pointer;
  white-space: nowrap;
}

.va-inline-btn:hover:not(:disabled) {
  background: rgb(216 40 39 / 0.06);
}

.va-inline-btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.va-verified-tag {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--va-green);
}

.va-verified-tag svg {
  height: 1rem;
  width: 1rem;
}

.va-hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--va-grey-500);
}

.va-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--va-grey-600);
}

.va-check input {
  margin-top: 0.15rem;
  height: 1rem;
  width: 1rem;
  flex-shrink: 0;
  accent-color: var(--va-red);
}

.va-link {
  color: var(--va-red);
  font-weight: 600;
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.va-link--muted {
  color: var(--va-grey-600);
  font-weight: 400;
}

.va-error {
  margin: 0;
  font-size: 0.875rem;
  color: #dc2626;
}

.va-notice {
  margin: 0;
  font-size: 0.875rem;
  color: var(--va-green);
}

.va-submit {
  width: 100%;
  border: 0;
  border-radius: 0.5rem;
  background: var(--va-red);
  padding: 0.625rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s;
}

.va-submit:hover:not(:disabled) {
  background: var(--va-red-dark);
}

.va-submit:disabled {
  cursor: default;
  opacity: 0.55;
}

/* "Secured by Paystack - we never store your card" panel */
.va-secure {
  display: flex;
  gap: 0.625rem;
  border-radius: 0.5rem;
  border: 1px solid var(--va-grey-200);
  background: var(--va-grey-50);
  padding: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--va-grey-600);
}

.va-secure svg {
  height: 1rem;
  width: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--va-green);
}

.va-footnote {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--va-grey-600);
}

/* Legal line under the card - wording from VOIMAR_BRANDING.md */
.va-legal {
  max-width: 28rem;
  text-align: center;
  font-size: 0.6875rem;
  line-height: 1.6;
  color: rgb(255 255 255 / 0.85);
}

.va-legal a {
  color: #ffffff;
}

@media (max-width: 420px) {
  .va-card-body {
    padding: 8rem 1.25rem 1.5rem;
  }
  .va-row-2 {
    grid-template-columns: 1fr;
  }
}

/* Password rules checklist (PasswordField `rules`) */
.va-input-group--error .va-input {
  border-color: var(--va-red);
  box-shadow: 0 0 0 1px var(--va-red);
}
.va-rules {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.5;
}
.va-rules ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.125rem 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--va-grey-500, #6b7280);
}
.va-rules li {
  overflow-wrap: anywhere;
}
.va-rule--met {
  color: #15803d;
  font-weight: 600;
}
.va-rule--unmet {
  color: var(--va-red);
}
.va-rule--bad {
  margin: 0.375rem 0 0;
  color: var(--va-red);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.va-bad-char {
  display: inline-block;
  margin: 0 0.125rem;
  padding: 0 0.375rem;
  border-radius: 0.25rem;
  background: rgb(216 40 39 / 0.12);
  color: var(--va-red);
  font-family: ui-monospace, monospace;
}
@media (max-width: 380px) {
  .va-rules ul {
    grid-template-columns: 1fr;
  }
}

/* WhatsApp or SMS choice for mobile codes */
.va-via {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  color: var(--va-grey-500);
}
.va-via-option {
  border: 1px solid var(--va-grey-200, #e5e7eb);
  border-radius: 999px;
  background: #ffffff;
  padding: 0.125rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--va-ink, #111827);
  cursor: pointer;
}
.va-via-option--on {
  border-color: #15803d;
  background: #f0fdf4;
  color: #15803d;
}

/* NumericGuard: flash a field red when a character that isn't allowed was dropped */
.va-rejected {
  outline: 2px solid #d82827 !important;
  outline-offset: 1px;
  transition: outline-color 0.2s;
}
