:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f5f8fc;
  color: #0f172a;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 42%, rgba(191, 219, 254, 0.5), transparent 31rem),
    linear-gradient(180deg, #fbfdff 0%, #f4f7fb 100%);
}

.login-shell {
  display: grid;
  width: 100%;
  height: 100dvh;
  padding: 24px;
  place-items: center;
}

.login-panel {
  width: min(100%, 430px);
}

.login-dock {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  background: linear-gradient(145deg, #2f6fec 0%, #1d56d8 55%, #1646be 100%);
  box-shadow:
    0 28px 70px rgba(29, 78, 216, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.login-card {
  display: grid;
  justify-items: center;
  padding: 32px 28px 25px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.12);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #3478f6, #1d4ed8);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.login-heading {
  margin-bottom: 25px;
  text-align: center;
}

.login-eyebrow {
  margin: 0 0 7px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-heading h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(24px, 5vw, 28px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.login-heading > p:last-child {
  margin: 9px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.google-auth-control {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 44px;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
}

#google-button {
  display: flex;
  position: relative;
  z-index: 1;
  width: 100%;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 160ms ease;
}

#google-button > div,
#google-button > div > div {
  width: 100% !important;
}

/*
 * O Google tambem desenha uma copia do botao no documento principal antes de
 * ativar o iframe. Estas regras mantem essa copia estavel caso o CSS externo
 * do Identity Services ainda nao tenha chegado.
 */
#google-button [role="button"] {
  display: flex !important;
  width: 100% !important;
  max-width: 400px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  border: 1px solid #dadce0 !important;
  border-radius: 5px !important;
  background: #fff !important;
  color: #3c4043 !important;
  font-family: Roboto, Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
  line-height: 20px !important;
}

#google-button [role="button"] > div:last-child {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}

#google-button [role="button"] svg {
  display: block !important;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
}

#google-button [role="button"] [id="button-label"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.google-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #d7dce2;
  border-radius: 5px;
  background: #fff;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 120ms ease;
}

.google-auth-control[data-ready="true"] #google-button {
  opacity: 1;
}

.google-auth-control[data-ready="true"] .google-placeholder {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.login-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.login-status[data-kind="error"] {
  color: #b42318;
}

.login-footnote {
  margin: 5px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
}

.zapi-connection {
  width: 100%;
  text-align: center;
}

.zapi-label {
  margin: 0 0 8px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.zapi-instruction {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
}

.zapi-pairing-code {
  display: block;
  width: 100%;
  margin: 18px 0 15px;
  padding: 15px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 13px;
  background: #eff6ff;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(22px, 7vw, 30px);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.zapi-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 520px) {
  .login-shell {
    padding: 16px;
  }

  .login-panel {
    width: 100%;
  }

  .login-dock {
    padding: 9px;
    border-radius: 27px;
  }

  .login-card {
    padding: 28px 20px 22px;
    border-radius: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

