/* =========================================================
   P'rabote — auth.css
   Login, Register, 2FA, Forgot / Reset password, Password updated.
   These screens have no site header/footer in Figma: a single
   card centred on a light page.
   (Shopify: customers/login, customers/register,
    customers/reset_password … templates)
   ========================================================= */

body.auth-page {
  background: var(--color-bg-secondary);
}

/* ---------- Page wrapper: centres the card in the viewport ---------- */
.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 24px;
}

/* ---------- Card ---------- */
.auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 440px;
  max-width: 100%;
  padding: 40px;
  background: var(--color-bg-primary);
  border-radius: 12px;
  box-shadow: 0 8px 28px 0 rgba(15, 23, 18, 0.1);
}
.auth-card--wide {
  width: 460px;
}

/* Logo (reuses .logo from base.css) */
.auth-card .logo {
  display: flex;
}

/* Round icon badge (forgot / reset / 2fa / updated) */
.auth-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--color-brand-subtle);
}
.auth-badge img {
  width: 30px;
  height: 30px;
}
.auth-badge--success {
  background: #ecfdf5;
}

/* ---------- Heading block ---------- */
.auth-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: center;
}
.auth-head--logo {
  gap: 6px;
  padding-top: 8px;
}
.auth-head__title {
  width: 100%;
  color: var(--color-text-primary);
}
.auth-head__text {
  width: 100%;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-neutral-600);
}

/* ---------- Form ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}
.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding-top: 8px;
}

/* Text field (Figma component "Input") */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.field__label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--color-neutral-600);
}
.field__control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 13px; /* 13/14 in Figma minus the 1px border */
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field__control:focus-within {
  border-color: var(--color-brand-default);
  box-shadow: inset 0 0 0 0.5px var(--color-brand-default);
}
.field__control input {
  flex: 1 0 0;
  min-width: 1px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-primary);
}
.field__control input::placeholder {
  color: #94a3b8;
  opacity: 1;
}
.field__toggle {
  display: flex;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.field__toggle img {
  width: 18px;
  height: 18px;
}
.field__toggle-hide,
.field__toggle.is-visible .field__toggle-show {
  display: none;
}
.field__toggle.is-visible .field__toggle-hide {
  display: block;
}

/* Checkbox (Figma component "Checkbox") */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--color-neutral-600);
  cursor: pointer;
}
.checkbox input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-bg-primary) center / 12px 12px no-repeat;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
}
.checkbox input:checked {
  background-color: var(--color-brand-default);
  border-color: var(--color-brand-default);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E");
}
.checkbox input:focus-visible {
  outline: 2px solid var(--color-brand-default);
  outline-offset: 2px;
}
.checkbox--top {
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
}
.checkbox--top span {
  flex: 1 0 0;
  min-width: 1px;
}
.checkbox a {
  color: inherit;
}

/* Remember me / Forgot password row */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.auth-row__link {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--color-brand-default);
  white-space: nowrap;
}
.auth-row__link:hover,
.auth-inline a:hover,
.auth-inline button:hover {
  text-decoration: underline;
}

/* Password requirements (reset password) */
.auth-reqs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.auth-reqs li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-neutral-600);
}
.auth-reqs img {
  width: 16px;
  height: 16px;
}
.auth-reqs__off,
.auth-reqs li:not(.is-met) .auth-reqs__on {
  display: none;
}
.auth-reqs li:not(.is-met) {
  color: #94a3b8;
}
.auth-reqs li:not(.is-met) .auth-reqs__off {
  display: block;
}

/* ---------- "or continue with" divider ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-size: 12px;
  line-height: 16px;
  color: #94a3b8;
  white-space: nowrap;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 0 0;
  min-width: 1px;
  height: 1px;
  background: var(--color-border-default);
}

/* ---------- Social sign-in ---------- */
.auth-social {
  display: flex;
  gap: 12px;
  width: 100%;
}
.auth-social__btn {
  flex: 1 0 0;
  min-width: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 0; /* 12 in Figma minus the 1px border */
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  transition: border-color 0.15s ease;
}
.auth-social__btn:hover {
  border-color: var(--color-text-primary);
}
.auth-social__btn img {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.auth-social__btn img.auth-social__google {
  width: 19.6px;
}

/* ---------- Footer lines ("Don't have an account? Sign up") ---------- */
.auth-inline {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-neutral-600);
}
.auth-inline--pad {
  padding-top: 4px;
}
.auth-inline a,
.auth-inline button {
  font-weight: 600;
  color: var(--color-brand-default);
}

/* Back to login */
.auth-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-neutral-600);
}
.auth-back img {
  width: 16px;
  height: 16px;
}
.auth-back:hover {
  color: var(--color-text-primary);
}
.auth-back--pad {
  padding-top: 4px;
}

/* ---------- One-time code (2FA) ---------- */
.otp {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  margin: 0;
}
.otp input {
  width: 54px;
  height: 60px;
  min-width: 0;
  padding: 0;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  outline: none;
  text-align: center;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.84px;
  color: var(--color-text-primary);
  caret-color: var(--color-brand-default);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.otp input:focus {
  border-color: var(--color-brand-default);
  box-shadow: inset 0 0 0 0.5px var(--color-brand-default);
}

/* =========================================================
   Tablet (Figma "Tablet" 768)
   Reset password + Password updated frames draw the icon badge
   as a 64x30 pill on tablet & mobile (unlike 2FA / Forgot).
   Remove the --compact modifiers to get the round 64px badge.
   ========================================================= */
@media (max-width: 1023px) {
  .auth-badge--compact {
    height: 30px;
  }
}

/* =========================================================
   Mobile (Figma "Mobile" 390): card fills the width, 24px sides
   ========================================================= */
@media (max-width: 767px) {
  .auth {
    padding: 24px var(--page-gutter);
  }
  .auth-card,
  .auth-card--wide {
    width: 100%;
    padding: 40px 24px;
  }
  .otp input {
    flex: 1 0 0;
    width: 0;
  }
  /* Reset / Password updated mobile frames: 24px top & bottom padding */
  .auth-card--compact {
    padding-top: 24px;
    padding-bottom: 24px;
  }
}
