/* Customer authentication flow — isolated from the signed-in application. */

.auth-gate:not(.is-loading) {
  background: var(--app-background);
}

.auth-gate:not(.is-loading) .auth-shell {
  position: relative;
  isolation: isolate;
  background: transparent;
}

.auth-gate:not(.is-loading) .auth-shell::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: none;
  content: "";
  pointer-events: none;
}

.auth-gate:not(.is-loading) .auth-brand {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 76px;
  align-items: flex-end;
  justify-content: flex-start;
  margin: 0 0 6px;
  padding: 0 0 5px 8px;
}

.auth-gate:not(.is-loading) .auth-brand img {
  display: block;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.auth-gate:not(.is-loading) .auth-brand-logo {
  width: 108px;
  height: auto;
  filter: drop-shadow(0 9px 20px rgba(29,3,59,.18));
}

.auth-gate:not(.is-loading) .auth-brand-joao {
  position: absolute;
  right: 8px;
  bottom: -13px;
  z-index: 3;
  display: block;
  width: 82px;
  height: 108px;
  filter: drop-shadow(0 10px 16px rgba(29,3,59,.2));
  pointer-events: none;
  user-select: none;
}

.auth-gate:not(.is-loading) .auth-brand-joao-main-clip {
  position: absolute;
  inset: 0 0 7px;
  overflow: hidden;
}

.auth-gate:not(.is-loading) .auth-brand-joao-main {
  width: 82px;
  height: auto;
}

.auth-gate:not(.is-loading) .auth-brand-joao::before,
.auth-gate:not(.is-loading) .auth-brand-joao::after {
  position: absolute;
  bottom: 0;
  height: 7px;
  background-image: url("./assets/vehicles/joao-auth-edge-v1.png");
  background-repeat: no-repeat;
  background-size: 82px 108px;
  content: "";
}

.auth-gate:not(.is-loading) .auth-brand-joao::before {
  left: 11px;
  width: 20px;
  background-position: -11px -101px;
}

.auth-gate:not(.is-loading) .auth-brand-joao::after {
  left: 52px;
  width: 20px;
  background-position: -52px -101px;
}

.auth-gate:not(.is-loading) .auth-card {
  overflow: hidden;
  padding: 18px 20px 22px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 27px;
  background: linear-gradient(145deg, #fff 0%, #fff 60%, #faf7fc 100%);
  box-shadow: 0 24px 58px rgba(29,3,58,.28);
}

.auth-gate:not(.is-loading) .auth-card::after {
  position: absolute;
  top: -74px;
  right: -68px;
  width: 158px;
  height: 158px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127,31,190,.08), transparent 68%);
  content: "";
  pointer-events: none;
}

.auth-flow-progress {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 7px;
  margin: 0 0 20px;
  padding: 0 2px 16px;
  border-bottom: 1px solid #eee8f1;
}

.auth-flow-progress > span {
  display: grid;
  grid-template-columns: 24px;
  justify-items: center;
  gap: 5px;
  color: #a399a8;
}

.auth-flow-progress b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #dfd8e3;
  border-radius: 50%;
  color: #8c818f;
  background: #f7f4f8;
  font-size: 9px;
  font-weight: 950;
}

.auth-flow-progress small {
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .1em;
}

.auth-flow-progress > i {
  height: 1px;
  margin-top: -14px;
  background: #e7e1ea;
}

.auth-gate[data-auth-step="loading"] .auth-flow-progress,
.auth-gate[data-auth-step="error"] .auth-flow-progress {
  display: none;
}

.auth-gate[data-auth-step="phone"] .auth-progress-phone,
.auth-gate[data-auth-step="code"] :is(.auth-progress-phone,.auth-progress-code),
.auth-gate[data-auth-step="profile"] :is(.auth-progress-phone,.auth-progress-code,.auth-progress-profile) {
  color: #6d1bb7;
}

.auth-gate[data-auth-step="phone"] .auth-progress-phone b,
.auth-gate[data-auth-step="code"] .auth-progress-code b,
.auth-gate[data-auth-step="profile"] .auth-progress-profile b {
  border-color: #7720bd;
  color: #fff;
  background: #7720bd;
  box-shadow: 0 5px 12px rgba(102,23,174,.2);
}

.auth-gate[data-auth-step="code"] .auth-progress-phone b,
.auth-gate[data-auth-step="profile"] :is(.auth-progress-phone,.auth-progress-code) b {
  border-color: #e4d6ee;
  color: #6d1bb7;
  background: #f3eaf9;
}

.auth-gate[data-auth-step="code"] .auth-flow-progress > i:first-of-type,
.auth-gate[data-auth-step="profile"] .auth-flow-progress > i {
  background: #caa8e2;
}

.auth-gate:not(.is-loading) .auth-step {
  position: relative;
  z-index: 1;
}

.auth-gate:not(.is-loading) .auth-eyebrow {
  width: max-content;
  margin-bottom: 9px;
  padding: 5px 8px;
  border-radius: 99px;
  color: #6f1ab7;
  background: #f3ebf8;
  font-size: 8px;
  letter-spacing: .14em;
}

.auth-gate:not(.is-loading) .auth-step h1 {
  max-width: 310px;
  color: #251b2b;
  font-size: 25px;
  line-height: 1.1;
}

.auth-gate:not(.is-loading) .auth-step > p {
  max-width: 330px;
  margin: 9px 0 18px;
  color: #786e7e;
  font-size: 12.5px;
  line-height: 1.48;
}

.auth-gate:not(.is-loading) .auth-form {
  gap: 12px;
}

.auth-gate:not(.is-loading) .auth-field {
  gap: 7px;
  color: #44384a;
  font-size: 11px;
  font-weight: 900;
}

.auth-gate:not(.is-loading) .auth-field input,
.auth-gate:not(.is-loading) .auth-phone-control {
  min-height: 54px;
  border: 1px solid #ded7e2;
  border-radius: 15px;
  background: #faf9fb;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.auth-gate:not(.is-loading) .auth-field input {
  font-size: 16px;
  font-weight: 760;
}

.auth-gate:not(.is-loading) .auth-field input::placeholder {
  color: #aaa1ae;
  opacity: 1;
}

.auth-gate:not(.is-loading) .auth-field input:focus,
.auth-gate:not(.is-loading) .auth-phone-control:focus-within {
  border-color: #7721bd;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(109,27,183,.1);
}

.auth-gate:not(.is-loading) .auth-phone-prefix {
  min-height: 52px;
  padding-inline: 13px;
  border-right-color: #e3dde7;
  color: #5c5261;
  background: #f2eff4;
}

.auth-gate:not(.is-loading) .auth-phone-control input {
  background: transparent;
}

.auth-gate:not(.is-loading) .auth-primary {
  min-height: 52px;
  border: 1px solid rgba(83,15,154,.24);
  border-radius: 15px;
  background: linear-gradient(108deg, #5912a5 0%, #7620be 58%, #8c26c7 100%);
  box-shadow: 0 12px 24px rgba(86,17,158,.18);
  font-size: 12px;
  letter-spacing: .055em;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.auth-gate:not(.is-loading) .auth-primary:active {
  box-shadow: 0 7px 15px rgba(86,17,158,.18);
  transform: translateY(1px);
}

.auth-gate:not(.is-loading) .auth-helper {
  color: #827887 !important;
  font-size: 10px !important;
}

.auth-gate:not(.is-loading) .auth-login-privacy {
  padding-top: 10px;
  border-top: 1px solid #eee9f0;
  color: #948b98 !important;
  font-size: 8px !important;
}

.auth-gate:not(.is-loading) .auth-login-privacy > span,
.auth-gate:not(.is-loading) .auth-login-privacy > a {
  display: block;
}

.auth-gate:not(.is-loading) .auth-login-privacy > a {
  width: max-content;
  margin: 3px auto 0;
  white-space: nowrap;
}

.auth-gate:not(.is-loading) .auth-phone-summary {
  margin: 13px 0 15px;
  padding: 8px 9px 8px 13px;
  border: 1px solid #e6dcec;
  border-radius: 14px;
  background: linear-gradient(145deg,#faf7fc,#f5eef9);
}

.auth-gate:not(.is-loading) .auth-phone-summary::before {
  color: #7a24bd;
  content: "WHATSAPP";
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .13em;
}

.auth-gate:not(.is-loading) .auth-phone-summary span {
  margin-right: auto;
  color: #3e3344;
}

.auth-gate:not(.is-loading) .auth-link {
  padding: 7px 10px;
  border: 1px solid #e1d4e9;
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  font-size: 9px;
}

.auth-gate:not(.is-loading) .auth-code-input {
  height: 64px;
  color: #5f159f !important;
  background:
    linear-gradient(#faf9fb,#faf9fb) padding-box,
    linear-gradient(90deg,#e4d8ec,#eee8f1) border-box;
  font-size: 27px !important;
  letter-spacing: .28em;
}

.auth-gate:not(.is-loading) .auth-code-meta {
  padding: 0 2px;
  font-size: 10px;
}

.auth-gate:not(.is-loading) .auth-code-meta button {
  padding: 6px 8px;
  border-radius: 9px;
  background: #f4edf8;
  font-size: 9px;
}

.auth-gate:not(.is-loading) .auth-consent-list {
  gap: 9px;
  padding: 12px;
  border-color: #e4dce8;
  border-radius: 15px;
  background: linear-gradient(145deg,#fbfafc,#f7f2fa);
}

.auth-gate:not(.is-loading) .auth-consent-option {
  grid-template-columns: 20px minmax(0,1fr);
  gap: 10px;
  color: #4d4253;
  font-size: 10px;
}

.auth-gate:not(.is-loading) .auth-consent-option input {
  width: 19px;
  height: 19px;
}

.auth-gate:not(.is-loading) .auth-consent-option small,
.auth-gate:not(.is-loading) .auth-consent-privacy {
  color: #8c8191;
  font-size: 8px;
}

.auth-gate:not(.is-loading) .auth-feedback {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(163,33,57,.1);
  border-radius: 12px;
}

@media (max-height: 760px) {
  .auth-gate:not(.is-loading) .auth-shell {
    justify-content: flex-start;
    padding-top: max(22px, calc(10px + env(safe-area-inset-top)));
    padding-bottom: max(22px, calc(12px + env(safe-area-inset-bottom)));
  }
  .auth-gate:not(.is-loading) .auth-brand { min-height: 69px; margin-bottom: 5px; padding-bottom: 4px; }
  .auth-gate:not(.is-loading) .auth-brand-logo { width: 100px; }
  .auth-gate:not(.is-loading) .auth-brand-joao { right: 8px; bottom: -12px; width: 76px; height: 100px; }
  .auth-gate:not(.is-loading) .auth-brand-joao-main { width: 76px; }
  .auth-gate:not(.is-loading) .auth-brand-joao::before,
  .auth-gate:not(.is-loading) .auth-brand-joao::after { background-size: 76px 100px; }
  .auth-gate:not(.is-loading) .auth-brand-joao::before { left: 10px; width: 19px; background-position: -10px -93px; }
  .auth-gate:not(.is-loading) .auth-brand-joao::after { left: 49px; width: 18px; background-position: -49px -93px; }
  .auth-gate:not(.is-loading) .auth-card { padding-top: 15px; }
  .auth-flow-progress { margin-bottom: 15px; padding-bottom: 12px; }
  .auth-gate:not(.is-loading) .auth-step > p { margin-bottom: 14px; }
}

@media (max-width: 350px) {
  .auth-gate:not(.is-loading) .auth-shell { padding-inline: 14px; }
  .auth-gate:not(.is-loading) .auth-card { padding-inline: 17px; }
  .auth-flow-progress small { letter-spacing: .05em; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate:not(.is-loading) .auth-step { animation: none; }
  .auth-gate:not(.is-loading) .auth-primary { transition: none; }
}
