/* ============================================================
   COMPANY AUTH — CENTERED CARD (Login)
   Standalone full-screen design (Figma node 21718-5102 background)
   Scoped under .auth-card-* so it never affects other auth pages.
   ============================================================ */

:root {
  --avc-primary: #12715b;
  --avc-primary-dark: #0d5344;
  --avc-navy: #141b34;
  --avc-input-bg: #f3f4f6;
  --avc-input-border: #e5e7eb;
  --avc-muted: #6b7280;
  --avc-placeholder: #9ca3af;
}

* {
  box-sizing: border-box;
}

.auth-card-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--avc-navy);
  /* Figma background: soft radial glow over the gradient + world-map image */
  background-color: #eafaf3;
  background-image:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 42%),
    url("../images/auth-bg.png");
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: cover, cover;
  background-attachment: fixed, fixed;
}

.auth-card-stage {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* ===== CARD ===== */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.10), 0 2px 8px rgba(17, 24, 39, 0.04);
  padding: 40px 36px;
}

/* ===== HEADER ===== */
.auth-card-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-card-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.auth-card-title {
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.3;
  color: var(--avc-navy);
}

.auth-card-subtitle {
  margin: 6px 0 0;
  text-align: center;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--avc-muted);
}

/* ===== ALERTS ===== */
.auth-card-alert {
  display: none;
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.8125rem;
}

/* Server-rendered alerts (forgot-password) are visible on load */
.auth-card-alert.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-card-alert.show iconify-icon {
  flex-shrink: 0;
}

.auth-card-alert-success.show p {
  margin: 0;
}

.auth-card-alert-error {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.auth-card-alert-error ul {
  margin: 0;
  padding-left: 18px;
  color: #b91c1c;
  list-style: disc;
}

.auth-card-alert-success {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.auth-card-alert-success p {
  margin: 0;
  font-weight: 600;
  color: #065f46;
}

/* ===== FORM ===== */
.auth-card-form {
  margin-top: 24px;
}

.auth-card-field {
  margin-bottom: 16px;
}

.auth-card-input-wrapper {
  position: relative;
}

.auth-card-input {
  width: 100%;
  height: 48px;
  background: var(--avc-input-bg);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--avc-navy);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

/* Space for the password eye toggle */
.auth-card-input.has-toggle {
  padding-right: 46px;
}

.auth-card-input::placeholder {
  color: var(--avc-placeholder);
  font-weight: 400;
}

.auth-card-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--avc-primary);
  box-shadow: 0 0 0 3px rgba(18, 113, 91, 0.12);
}

.auth-card-input.field-error-border {
  border-color: #ef4444 !important;
}

.auth-card-input.field-error-border:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.auth-card-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--avc-placeholder);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.auth-card-toggle:hover {
  color: var(--avc-muted);
}

/* ===== OPTIONS ROW ===== */
.auth-card-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 22px;
  font-size: 0.8125rem;
}

.auth-card-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--avc-muted);
  font-weight: 400;
}

.auth-card-remember input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  background: var(--avc-input-bg);
  border: 1px solid var(--avc-input-border);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.auth-card-remember input[type="checkbox"]:checked {
  background: var(--avc-primary);
  border-color: var(--avc-primary);
}

.auth-card-remember input[type="checkbox"]:checked::after {
  content: "\2713";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.auth-card-forgot {
  color: var(--avc-primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-card-forgot:hover {
  color: var(--avc-primary-dark);
}

/* ===== SUBMIT BUTTON ===== */
.auth-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 10px;
  background: var(--avc-navy);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, background 0.2s;
}

.auth-card-btn:hover {
  background: #1d2647;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 27, 52, 0.22);
}

.auth-card-btn:active {
  transform: translateY(0);
}

.auth-card-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-card-btn-resend {
  background: var(--avc-primary);
}

.auth-card-btn-resend:hover {
  background: var(--avc-primary-dark);
}

/* ===== FOOTER ===== */
.auth-card-footer {
  margin: 22px 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--avc-navy);
}

.auth-card-footer a {
  color: var(--avc-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-card-footer a:hover {
  color: var(--avc-primary-dark);
}

.auth-card-verify {
  margin-top: 16px;
}

/* ============================================================
   SIGNUP-SPECIFIC (Create Account card)
   ============================================================ */

/* Field-level inline error text */
.auth-card-field-error {
  display: none;
  margin-top: 6px;
  font-size: 0.75rem;
  color: #ef4444;
}

/* Password strength meter */
.auth-card-strength {
  margin-top: 8px;
  display: none;
}

.auth-card-strength.show {
  display: block;
}

.auth-card-strength-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.auth-card-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.auth-card-strength-fill.weak   { width: 33%;  background: #ef4444; }
.auth-card-strength-fill.medium { width: 66%;  background: #f59e0b; }
.auth-card-strength-fill.strong { width: 100%; background: #10b981; }

.auth-card-strength-text {
  display: block;
  margin-top: 5px;
  font-size: 0.6875rem;
  color: var(--avc-muted);
}

/* Terms row */
.auth-card-terms {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 22px;
}

.auth-card-terms input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  background: var(--avc-input-bg);
  border: 1px solid var(--avc-input-border);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.auth-card-terms input[type="checkbox"]:checked {
  background: var(--avc-primary);
  border-color: var(--avc-primary);
}

.auth-card-terms input[type="checkbox"]:checked::after {
  content: "\2713";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.auth-card-terms-text {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--avc-muted);
}

.auth-card-terms-text a {
  color: var(--avc-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-card-terms-text a:hover {
  color: var(--avc-primary-dark);
}

/* Error alert can carry a heading + list on the signup card */
.auth-card-alert-error p {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #991b1b;
}

/* ============================================================
   VERIFY EMAIL (OTP card)
   ============================================================ */

/* The OTP card centers its content */
.auth-card-otp-desc {
  margin: 6px 0 0;
  text-align: center;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--avc-muted);
  line-height: 1.5;
}

.auth-card-otp-email {
  font-weight: 600;
  color: var(--avc-navy);
}

/* OTP input group */
.auth-card-otp-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 26px 0 0;
}

.auth-card-otp-input {
  width: 48px;
  height: 52px;
  padding: 0;
  text-align: center;
  background: var(--avc-input-bg);
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--avc-navy);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-card-otp-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--avc-primary);
  box-shadow: 0 0 0 3px rgba(18, 113, 91, 0.12);
}

.auth-card-otp-input.field-error-border {
  border-color: #ef4444 !important;
}

.auth-card-otp-input.field-error-border:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Timer text */
.auth-card-timer {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--avc-muted);
}

/* Verify button gets its own top spacing inside the OTP card */
.auth-card-otp-group + .auth-card-timer + .auth-card-btn,
.auth-card-timer + .auth-card-btn {
  margin-top: 18px;
}

/* Resend row */
.auth-card-resend {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--avc-muted);
}

.auth-card-resend-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--avc-primary);
  cursor: pointer;
}

.auth-card-resend-link:hover {
  color: var(--avc-primary-dark);
}

.auth-card-resend-link:disabled {
  color: var(--avc-placeholder);
  cursor: not-allowed;
}

/* "Back to Sign In" footer link (plain, centered) */
.auth-card-back {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.875rem;
}

.auth-card-back a {
  color: var(--avc-navy);
  text-decoration: none;
}

.auth-card-back a:hover {
  color: var(--avc-primary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .auth-card-stage {
    padding: 20px 14px;
  }
  .auth-card {
    padding: 32px 22px;
    border-radius: 14px;
  }
  .auth-card-title {
    font-size: 1.25rem;
  }
  .auth-card-otp-group {
    gap: 8px;
  }
  .auth-card-otp-input {
    width: 44px;
    height: 50px;
    font-size: 1.25rem;
  }
}

@media (max-width: 360px) {
  .auth-card {
    padding: 28px 18px;
  }
  .auth-card-otp-group {
    gap: 6px;
  }
  .auth-card-otp-input {
    width: 38px;
    height: 46px;
    font-size: 1.125rem;
  }
}

/* Short / landscape phones — let the page scroll instead of clipping */
@media (max-height: 640px) {
  .auth-card-stage {
    align-items: flex-start;
  }
}

/* ============================================================
   EMAIL-CODE SIGN-IN / SIGN-UP (company-code-auth.js)
   Steps, the 8-character code, Google / Apple, the "both" choice
   and the onboarding questions. Built only from the card's own
   tokens above, so it matches the rest of the card.
   ============================================================ */

[data-step][hidden],
.auth-card [hidden] {
  display: none !important;
}

.auth-card-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* "Step 1 of 2" over each screen's title */
.auth-card-step {
  margin: 0 0 8px;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--avc-muted);
}

/* A step whose title sits inside its form */
.auth-card-form-step {
  margin-top: 0;
}

/* "Change email" and other inline text buttons */
.auth-card-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--avc-primary);
  cursor: pointer;
  white-space: nowrap;
}
.auth-card-link:hover {
  color: var(--avc-primary-dark);
}
.auth-card-link:disabled {
  color: var(--avc-placeholder);
  cursor: not-allowed;
}

/* A link inside an alert ("Create an account instead") */
.auth-card-alert-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ----- the 8-character code: two groups of four ----- */
.auth-card-code {
  display: flex;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.auth-card-code-group {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.auth-card-code-input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0;
  text-align: center;
  text-transform: uppercase;
  background: var(--avc-input-bg);
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--avc-navy);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.auth-card-code-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--avc-primary);
  box-shadow: 0 0 0 3px rgba(18, 113, 91, 0.12);
}
.auth-card-code-input.field-error-border {
  border-color: #ef4444 !important;
}
.auth-card-code-input:disabled {
  opacity: 0.6;
}
.auth-card-code + .auth-card-field-error {
  text-align: center;
}
.auth-card-timer.is-urgent {
  color: #b91c1c;
}
.auth-card-timer + .auth-card-btn {
  margin-top: 18px;
}

/* ----- buttons: outline variant, icons, stacks ----- */
.auth-card-btn {
  gap: 10px;
}
.auth-card-btn-outline {
  background: #ffffff;
  color: var(--avc-navy);
  border: 1px solid var(--avc-input-border);
}
.auth-card-btn-outline:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 6px 16px rgba(20, 27, 52, 0.08);
}
.auth-card-btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.auth-card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}

/* ----- "or" + Google / Apple ----- */
.auth-card-social {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.auth-card-social .auth-card-alert {
  margin-top: 0;
}
.auth-card-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--avc-placeholder);
}
.auth-card-divider::before,
.auth-card-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--avc-input-border);
}
/* Google's real button sits invisible over ours and takes the click. */
.auth-card-google {
  position: relative;
}
.auth-card-google-slot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
}
.auth-card-google:hover .auth-card-btn-outline {
  background: #f9fafb;
  border-color: #d1d5db;
}
.auth-card-google:focus-within .auth-card-btn-outline {
  border-color: var(--avc-primary);
  box-shadow: 0 0 0 3px rgba(18, 113, 91, 0.12);
}
.auth-card-google.is-busy .auth-card-btn-outline {
  opacity: 0.6;
}
.auth-card-google.is-busy .auth-card-google-slot {
  pointer-events: none;
}
.auth-card-social-note {
  margin: 0;
  text-align: center;
}

/* ----- onboarding questions ----- */
.auth-card-question {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.auth-card-label {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--avc-navy);
}
.auth-card-label span {
  font-weight: 400;
  color: var(--avc-muted);
}
.auth-card-choices {
  display: grid;
  gap: 8px;
}
.auth-card-choices-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.auth-card-choices-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.auth-card-choice {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--avc-input-bg);
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--avc-navy);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.auth-card-choice:hover {
  border-color: var(--avc-input-border);
}
.auth-card-choice.is-checked {
  background: rgba(18, 113, 91, 0.08);
  border-color: var(--avc-primary);
  color: var(--avc-primary-dark);
  font-weight: 600;
}
.auth-card-choice:focus-within {
  box-shadow: 0 0 0 3px rgba(18, 113, 91, 0.12);
}
.auth-card-choice-center {
  justify-content: center;
  padding: 8px 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.auth-card-other {
  margin: 10px 0 0;
}

@media (max-width: 480px) {
  .auth-card-code {
    gap: 10px;
  }
  .auth-card-code-group {
    gap: 5px;
  }
  .auth-card-code-input {
    height: 48px;
    font-size: 1.125rem;
  }
  .auth-card-choices-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .auth-card-code {
    gap: 8px;
  }
  .auth-card-code-group {
    gap: 4px;
  }
  .auth-card-code-input {
    height: 44px;
    font-size: 1rem;
  }
  .auth-card-choices-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================
   Subtle scrollbar: a slim, soft bar on a transparent track instead of
   the browser's default (which turns into a dark strip with a dark OS
   theme). Scrolling itself is unchanged. Firefox and current Chrome/Edge
   read scrollbar-width/-color; Safari and older Chrome read the
   ::-webkit-scrollbar rules, which also give the green hover.
   ============================================================ */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 27, 52, 0.25) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(20, 27, 52, 0.25);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #12715b;
}
